Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Sort transformation result Sort transformation resultTo: NULL Date: 5/18/2009 10:03:00 AM I have the following code:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="root/tree[not(@parentid)]">
<xsl:apply-templates select=".">
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
<xsl:template match="tree">
<xsl:variable name="ID" select="@menuid"/>
<menu>
<xsl:attribute name="name"><xsl:value-of
select="@name"/></xsl:attribute>
<xsl:attribute name="menuid"><xsl:value-of
select="@menuid"/></xsl:attribute>
<xsl:attribute name="parentid"><xsl:value-of
select="@parentid"/></xsl:attribute>
<xsl:attribute name="link"><xsl:value-of
select="@link"/></xsl:attribute>
<xsl:attribute name="line_id"><xsl:value-of
select="@line_id"/></xsl:attribute>
<xsl:attribute name="dept_id"><xsl:value-of
select="@dept_id"/></xsl:attribute>
<xsl:attribute name="salesrepid"><xsl:value-of
select="@salesrepid"/></xsl:attribute>
<xsl:attribute name="category"><xsl:value-of
select="@category"/></xsl:attribute>
<xsl:apply-templates select="//tree[@parentid=$ID]">
</xsl:apply-templates>
</menu>
</xsl:template>
</xsl:stylesheet>
I need to sort my tree showing folders first. Can someome help, please?
Thanks
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
