Thread: sorting nodes
View Single Post
  #6 (permalink)  
Old July 7th, 2009, 04:40 AM
mhkay's Avatar
mhkay mhkay is online now
Wrox Author
Points: 12,738, Level: 48
Points: 12,738, Level: 48 Points: 12,738, Level: 48 Points: 12,738, Level: 48
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 3,924
Thanks: 0
Thanked 82 Times in 80 Posts
Default

Just replace the copy-of with an apply-templates select=".", and write a template rule for Employee something like

Code:
<xsl:template match="employee">
  <xsl:copy>
    <xsl:copy-of select="*"/>
    <xsl:copy-of select="../Id"/>
  </xsl:copy>
</xsl:template>
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote