[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Semantics of deep-equal function

Subject: Semantics of deep-equal function
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Wed, 20 Jul 2005 13:45:35 +0530
equals xsl
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.