Subject: Re: [xsl] deep-equal behaves differently when node is stored in a variable From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 15 Apr 2025 21:15:15 -0000 |
On 15/04/2025 23:11, Wolfhart Totschnig wolfhart.totschnig@xxxxxxxxxxx wrote:
Dear list,
I would like to ask for your help with the following puzzling behavior that I have encountered. The situation is that I am testing whether the context node, which is a <person> element with child elements (first?, middle?, last), is deep-equal to one of a set of other nodes. I found the following solution:
some $p in //person satisfies deep-equal($p, .)
However, when I store the context node in a variable, like so:
<xsl:variable name="person"> \xA0\xA0 <xsl:copy-of select="."/> </xsl:variable>
That creates a document node containing a copy of the context node, so you either need
A document node is not deep-equal to an element node.
and then make the comparison with the variable, like so:
some $p in //person satisfies deep-equal($p, $person)
then the test comes out false. Why is that? Why does it make a difference whether I store the context node in a variable or call it directly?
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] deep-equal behaves differentl, Wolfhart Totschnig w | Thread | Re: [xsl] deep-equal behaves differ, Michael Kay michaelk |
[xsl] deep-equal behaves differentl, Wolfhart Totschnig w | Date | Re: [xsl] deep-equal behaves differ, Michael Kay michaelk |
Month |