xsl-list
[Top] [All Lists]

Re: select element based on value of one of the children

2005-10-11 02:42:12
Either you can select the nodeset like:
<xsl:apply-templates select="a[b='7']"/>

<xsl:template match="a">
..
</template>

This is more like a pull method: picking only the interesting part from the 
source tree.

<xsl:apply-templates select="a"/>

<xsl:template match="a[b='7']">
  <!-- This template will overrule the more general one, provided that
the predicate is true (that the child element b has a string value of
'7') -->
..
</xsl:template>

While this is more of a push method: just start template matching all and figure out later what to ignore or not..

(loosly translated, I bet there are lots of articles on this..)

Cheers,
Geert


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>