Sorting Attributes in xsl with other elements surrounding it

AK47M

New Member
Been frusterated by this problem for a couple days now.I'm trying to copy an xml file while sorting an attribute of a nested element. What i've got I feel should work \[code\]<xsl:stylesheet version="2.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:xs="http://www.w3.org/2001/XMLSchema"xmlns:my="my:my"><xsl:eek:utput method="xml" indent="yes" /> <xsl:template match="node() | @*"> <xsl:copy> <xsl:apply-templates select="node() | @*"/> </xsl:copy> </xsl:template> <xsl:template match="PrProduct"> <xsl:copy> <xsl:apply-templates select="node()|@* " > <xsl:sort select="@TEC" order="descending" /> </xsl:apply-templates> </xsl:copy> </xsl:template></xsl:stylesheet>\[/code\]heres the xml\[code\]<body><issueobject><page></page><prproduct TEC="TOR"></prproduct><prproduct TEC="UVA"><partPage></partPage></issueobject></body>\[/code\]I think the problem lies in that theres elements at the same level on either side of the element I'm sorting as in playing around I can get the data to sort but wind up missing the data after/before.Thanks
 
Top