is the sort.xslt in the htmltidy helper wrong?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • koen
    Visitor
    • Oct 2011
    • 4

    is the sort.xslt in the htmltidy helper wrong?

    I found that the current sort xslt did not do any sorting on my JDF XML files.
    This works better. It first sorts the attributes and then the elements.
    I tested it with a few of my XML (JDF) files and it worked well.
    Hopefully it is universal

    <xsl:template match="@* | node()">
    <xsl:copy>
    <xsl:apply-templates select="@*">
    <xsl:sort select="name()"/>
    </xsl:apply-templates>
    <xsl:apply-templates select="node()">
    <xsl:sort select="name()"/>
    </xsl:apply-templates>
    </xsl:copy>
    </xsl:template>
    Last edited by koen; 21-Oct-2011, 05:12 PM. Reason: some attributes lost for some files
  • Aaron
    Team Scooter
    • Oct 2007
    • 16017

    #2
    Hello,

    Thanks for the feedback. We would appreciate some user feedback on if this XSLT script seems to work better in more cases than our current one.

    From my own testing, this handles our example files with different node names, but has some odd results if the node is the same and the value of the node name is the sort object.
    Aaron P Scooter Software

    Comment

    Working...