Subject: RE: Comparing two large stylesheets
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 28 Mar 2002 09:24:46 -0000
|
>
> I am looking for way of comparing two large stylesheets. In
> this instance
> they are both very similar, but the templates are in a
> different order and a
> few of the element names they match are slightly different.
I would first sort them:
<xsl:template match="xsl:stylesheet">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:for-each select="*">
<xsl:sort select="name()"/>
<xsl:sort select="@name"/>
<xsl:sort select="@match"/>
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:copy>
</xsl:template>
and then apply a standard XML differencing tool to the result.
Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|