This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

getting 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]