View Single Post
  #2 (permalink)  
Old January 14th, 2011, 12:33 PM
Martin Honnen Martin Honnen is offline
Friend of Wrox
Points: 6,676, Level: 34
Points: 6,676, Level: 34 Points: 6,676, Level: 34 Points: 6,676, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Nov 2007
Location: Germany
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts

Let's try to identify sub problems and solve them. You say you need special treatment for the "slot" elements inside the "slots" elements of "pagelet-component" and want to sort the "slot" elements according to the "definition-name". That could be achieved with
  <xsl:strip-space elements="*"/>
  <xsl:output indent="yes"/>
  <xsl:template match="@* | text() | comment() | processing-instruction()">
  <xsl:template match="*[*]">
      <xsl:apply-templates select="@*"/>
      <xsl:apply-templates select="*">
        <xsl:sort select="local-name()" data-type="text"/>
        <xsl:sort select="@id" data-type="text"/>
  <xsl:template match="*[not(*)]">
      <xsl:apply-templates select="@* | node()"/>
  <xsl:template match="impex:pagelet-component/impex:slots" priority="5">
      <xsl:apply-templates select="@*"/>
      <xsl:apply-templates select="impex:slot">
        <xsl:sort select="impex:definition-name"/>

Does that do what you want for those "slot" elements?
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
Reply With Quote