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

getting equivalent nodes

Subject: getting equivalent nodes
From: mjyoungblut@xxxxxxx
Date: Wed, 24 Oct 2001 10:14:03 -0500
equivalent nodes
If I have two sets of elements between two documents, how can I see whether
or not there are matching elements, based on both the @* and value.

I know how to gather up the elements I want to compare, but I would like an
efficient way of comparing them.

For example,

Group 1:
<Characteristic Name="A">value of A</Characteristic>
<Characteristic Name="B">value of B</Characteristic>
<Characteristic Name="C">value of C</Characteristic>
<Characteristic Name="D">value of D</Characteristic>

Group 2:
<Characteristic Name="A">value of A</Characteristic>
<Characteristic Name="B">value of b</Characteristic>
<Characteristic Name="C">value of c</Characteristic>
<Characteristic Name="D">value of C</Characteristic>

I want to say something like
<xsl:copy-of select="$TODAY_PROD//Characteristic[@Name
= $YEST_PROD//Characteristic//@Name and not(.
=$YEST_PROD//Characteristic)]"/>

meaning that if the @Names are equivalent and the values are equivalent,
then copy the node.  But the xsl snippet above compares the value of
$TODAY_PROD//Characterisic against all of the $YEST_PROD//Characteristics.
I want to only compare it against those with the same @Name.

I can currently do this if I take all of the Characteristics from each
group and 'stringify' them(including the @Name) and then iterating through
Group 1, stringifying each Characteristic and comparing it to the list of
stringified nodes from Group 2.  If possible, I would like to make this
simpler.

I expect the output to look like
<Characteristic Name="A">value of A</Characteristic>

but I am currently getting
<Characteristic Name="A">value of A</Characteristic>
<Characteristic Name="C">value of C</Characteristic>

Thanks in advance,
     Matt



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.