This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Comparing two large stylesheets


> 
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]