Subject: RE: [xsl] Can't identify last ancestor node From: "Aron Bock" <aronbock@xxxxxxxxxxx> Date: Tue, 28 Jun 2005 18:19:10 +0000 |
<xsl:template match="node()|@*"> <xsl:copy><xsl:apply-templates select="node()|@*"/></xsl:copy> </xsl:template>
<xsl:template match="menu[not(*) and position() = last()]"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:attribute name="last">1</xsl:attribute> </xsl:copy> </xsl:template>
<?xml version="1.0" encoding="UTF-8"?> <menudata> <menu name="link1"> <menu name="link1a"/> <menu name="link1b"/> <menu name="link1c" last="1"/> </menu> <menu name="link2"> <menu name="link2a"/> <menu name="link2b"/> <menu name="link2c" last="1"/> </menu> </menudata>
From: Mat Bergman <matbergman@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] Can't identify last ancestor node Date: Tue, 28 Jun 2005 09:20:23 -0700 (PDT)
This is close to what I need, but I need to be more clear. In this case, the context node is /menudata/menu/menu. I want to apply unique output for the last <menu> nodes in /menudata/menu/menu. For instance:
<menudata> <menu name="link1"> <menu name="link1a"/> <menu name="link1b"/> <menu name="link1c"/> </menu> <menu name="link2"> <menu name="link2a"/> <menu name="link2b"/> <menu name="link2c"/> </menu> </menudata>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Can't identify last ances, Michael Kay | Thread | [xsl] both single and double quotes, Arian Hojat |
RE: [xsl] finding the position of t, Michael Kay | Date | [xsl] both single and double quotes, Arian Hojat |
Month |