tags:

views:

493

answers:

1

I am looking at using Beyond Compare 3 with XML Tidy compare comparison format. XML Tidy formats all the nodes with proper line breaks and indentation if an XML file is all slopped onto one line. ...So I would love a tool that can do this and can ignore differences in attributes, or not even show attributes at all (this is because attributes are irrelevant to my users).

Is there a tool that can do this?

Thanks!

+1  A: 

An XSLT identity transform that omits the attributes and sets the output to indent should work:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output indent="yes" />

<xsl:template match="/">
    <xsl:apply-templates />
</xsl:template>

<xsl:template match="node()">
    <xsl:copy>
        <xsl:apply-templates />
    </xsl:copy>
</xsl:template>

</xsl:stylesheet>
Mads Hansen