Re: [xsl] compare two nodes (the child elements, not the string values) in XSLT 1.0

Subject: Re: [xsl] compare two nodes (the child elements, not the string values) in XSLT 1.0
From: Wolfhart Totschnig <wolfhart@xxxxxxxxxxxxx>
Date: Wed, 06 Jul 2011 15:40:27 -0500
How about this (not very cool):

test="concat(path/person/first, '|', path/person/first, '|', path/person/first) = concat(first, '|', middle, '|', last)

This does not work. The concat() function transforms the node sets into strings, and so the expression "concat(path/person/first, '|', path/person/middle, '|', path/person/last)" takes the values of the <first>, <middle>, and <last> elements of the *first* <person> element (the string value of a node set is by definition the string value of the first node in the node set) and concatenates them. So the test you propose will always yield "false" unless the context node happens to be equal to the first <person> element.


Wolfhart

Current Thread