xsl-list
[Top] [All Lists]

RE: Sorting the complete xml file

2005-12-07 09:05:35

The primary reason that I want to do this is to see if 2 
generated xml files are identical.

You mean, you want to see if they differ only in the order of the elements.

You could try:

<xsl:template match="*">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates select="node()">
        <xsl:sort select="."/>
    </xsl:apply-templates>
  </xsl:copy>
</xsl:template>


Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--