xsl-list
[Top] [All Lists]

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

2011-07-06 15:22:38
Am 06.07.2011 um 20:54 schrieb Wolfhart Totschnig:

I have a seemingly simple xslt problem to which I cannot find the solution. I 
want to test whether the context node, which is an <author> element with the 
form (first?, middle?, last), is equal to one of a set of <person> elements. 
By "equal" I mean having the same child elements and values of these 
elements. At first, I thought it would be as easy as

test="path/person = ."

But then I realized that the "=" operator compares the string values of the 
nodes

Wolfhart,

How about this (not very cool):

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

- Michael Müller-Hillebrand


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--