[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Identifying two tags that share some attribute nam

Subject: Re: Identifying two tags that share some attribute names and values
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 6 May 2002 09:17:48 +0100
Re:  Identifying two tags that share some attribute nam
Hi Joerg,

> And my comments/questions to Jeni's stylesheet:
>
>  >><xsl:template match="a">
>  >>  <xsl:variable name="a" select="." />
>  >>  <xsl:for-each select="$file2/b[@* = $a/@*]">
>
> I thought of a filter too, but I didn't find a sensible one. The
> above one isn't completely logical to me. What exactly does it mean?
> Maybe "all <b>s, whose all attributes are in <a> and don't have a
> different value"?

It means "all <b>s that have an attribute that has the same value as
at least one of <a>'s attributes". It's not a very strong filter, but
it means that if <a> is:

<a x="1" y="2" z="3" />

then you won't process <b> if it's:

<b x="4" y="5" />

but would process <b> if it was:

<b a="2" />

(and then discard it in the xsl:for-each).

Actually, given that the attributes on a have to be a subset of the
attributes on b (I think that's the way round it is now), then a
stronger filter would count the attributes as well:

   $file2/b[@* = $a/@* and
            count(@*) >= count($b/@*)]

There's a balance here between the amount of work that goes on in the
filter, and the amount of work that goes on within the xsl:for-each;
Zack should really test where the balance is to work out what filter
to use.
            
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.