Re: [xsl] comparing a part of the XML tree

Subject: Re: [xsl] comparing a part of the XML tree
From: Jethro Borsje <jethro@xxxxxxxxxxxx>
Date: Mon, 16 Jul 2007 12:20:50 +0200
Hi everybody,

I can not manage to make the deep-equal function work with the node() function.

I am usting the following template:
<xsl:template match="/">
<xsl:choose>
<xsl:when test="deep-equal(body/selection/node(), body/original/node())">true</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:template>


With the following XML as input:
<body>
	<selection>
		<z color="blue" flavor="vanilla">test 1</z>
	</selection>
	<original>
		<z color="blue" flavor="vanilla">test 1</z>
	</original>
</body>

The output of this is "false" (although I expected "true"). The strange thing is that when using the following template the output is "true":
<xsl:template match="/">
<xsl:choose>
<xsl:when test="deep-equal(body/selection/z, body/original/z)">true</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:template>


So there is probably something wrong with how I use the node() function.

--
Best regards,
Jethro Borsje

http://www.jborsje.nl

Jethro Borsje wrote:
Hi there,

Yes, that was it. I now implemented Saxon and at least I can run the application. I will play around with the stylesheet a bit more to see if I can manage to get it to work...

Current Thread