This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Comparing two large stylesheets
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 28 Mar 2002 09:24:46 -0000
- Subject: RE: [xsl] Comparing two large stylesheets
- Reply-to: xsl-list at lists dot mulberrytech dot com
>
> 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@ntlworld.com
work: Michael.Kay@softwareag.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list