|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Can't identify last ancestor node
Mat, you do want last() to identify the last menu. For example, with your
input (below), this XSL:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <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></xsl:stylesheet> Produces: <?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>--A From: Mat Bergman <matbergman@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: Can't identify last ancestor node Date: Tue, 28 Jun 2005 09:20:23 -0700 (PDT) _________________________________________________________________ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/
|
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








