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

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

Subject: Re: select element based on value of one of the children
From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Date: Tue, 11 Oct 2005 11:42:12 +0200
Re:  select element based on value of one of the childr
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

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.