Subject: Re: [xsl] Identifying two tags that share some attribute names and values From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Mon, 6 May 2002 09:17:48 +0100 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Identifying two tags that, Zack Brown | Thread | Re: [xsl] Identifying two tags that, Zack Brown |
Re: [xsl] Identifying two tags that, Jeni Tennison | Date | [xsl] One texdocument in and severa, Tove Nilstun |
Month |