|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: building hierarchy from path string
Jenni & others,
Sorry to clutter up the list... The corrected template follows. Thanks again for all your help! John-Mason -- http://john-mason.shackelford.org <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text/xml" indent="yes" /> <xsl:variable name="tierChars" select="tree/descriptor/@chars-per-tier"/> <xsl:key name="children" match="node" use="substring(@path, 1, @depth * $tierChars)" /> <xsl:template match="tree"> <tree> <xsl:apply-templates select="key('children','')" /> </tree> </xsl:template> <xsl:template match="node"> <node name="{@name}"> <xsl:apply-templates select="key('children', substring(@path,1,(@depth + 1) * $tierChars))"> <xsl:sort select="@path" /> </xsl:apply-templates> </node> </xsl:template> </xsl:stylesheet> 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








