[xsl] Semantics of deep-equal function

Subject: [xsl] Semantics of deep-equal function
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Wed, 20 Jul 2005 13:45:35 +0530
I am playing with deep-equal function of XSLT 2.0 using Saxon 8.4.. I
have written following XML and XSLT so far:

XML file -
<?xml version="1.0"?>
<root>
  <x>
    <a>1</a>
    <p>2</p>
  </x>
  <y>
    <a>1</a>
    <p>2</p>
  </y>
</root>

XSLT file -
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="2.0">

<xsl:output method="text" />

<xsl:template match="/root">
   <xsl:if test="deep-equal(x/node(),y/node())">
     Equal
   </xsl:if>
   <xsl:if test="not(deep-equal(x/node(),y/node()))">
     Not Equal
   </xsl:if>
</xsl:template>

</xsl:stylesheet>

The results are as expected. It seems deep-equal considers white
spaces significant. Is there any way I can do deep equals comparison
ignoring the white spaces?

Regards,
Mukul

Current Thread