|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: select nodes only one level with same name
There are a number of ways. One is to nest your template tags:
<xsl:template match="/">
<xsl:apply-templates>
<xsl:template match="operation">
do something for level 1 ...
<xsl:apply-templates>
<xsl:template match="operation">
before doing something for level 2
</xsl:template>
</xsl:apply-templates>
</xsl:template>
</xsl:apply-templates>
</xsl:template>
This will match a level 1 operation tag, then all of its child operation
tags, before moving on to the next level 1 tag. However, if you want all
level 1 operation tags to be processed before you match all level 2
operation tags, then do:
<xsl:template match="operation">
don't do another apply-templates here
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="operation">
</xsl:apply-templates>
<xsl:apply-templates select="operation/operation">
</xsl:apply-templates>
</xsl:template>
Regards,
Mark
> -----Original Message-----
> From: xsl-list@xxxxxxxxx
> Sent: 24 May 1999 16:00
> To: undisclosed-recipients
> Subject: select nodes only one level with same name
>
>
> hi*
>
> Example of xml:
>
> <rootnode>
> <operation>
> bla-bla-bla...
> <operation>
> another bla-bla-bla...
> </operation>
> another bla-bla-bla again
> </operation>
>
> Example of xsl:
>
>
> <xsl:template match="/">
>
> bla-bla...
> <xsl:apply-templates select="I want to select first operation node">
> bla-bla-...
> <xsl:apply-templates select="I want to second level operation node">
> </xsl:template>
>
> How can I do it?
> Thanks.
> Eugeny.
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








