Re: [xsl] comparing nodesets to each other

Subject: Re: [xsl] comparing nodesets to each other
From: "Aron Bock" <aronbock@xxxxxxxxxxx>
Date: Tue, 12 Apr 2005 03:56:46 +0000
Kai, this is slightly better, but please see below:


I try to be more exact in my definition:
- two nodes 'relation' are different, if they have the same value in
relation/Attribute[@Name='FindNumber']/Value but the text value of both
node's children at all is different.

I get the part about 2 <relation> elements being comparable if the Value of both contain the same text. However, do you really mean to compare just the "text value" of their descendent nodes to determine changes? I interpret "text value" to mean only those descendent nodes that are text() nodes, and I suspect you mean something else. Also, does this mean your "unit of difference" is the <relation> element, and it's suffucient to stop "differencing" at that level? (Meaning, if a relation element is deemed to be "added", it and contained nodes will be shown, with no effort to determine which contained nodes changed.)


Using your samples below, would you provide a "result document" that you're after? Actually seeing a result, with annotations if necessary, would help in making this more concrete.

Regards,

--A

> >I try to show the structure of the recipe (eased):
> >
> ><object>
> >   <relation>
> >     <Attribute Type="string" Name="FindNumber">
> >       <Value><![CDATA[0005]]></Value>
> >     <Attribute>
> >     <Attribute Type="float" Name="...
> >     <object>
> >       <Attribute Type="string" Name="PartNumber">
> >         <Value><![CDATA[Part1]]></Value>
> >       </Attribute>
> >     </object>
> >   </relation>
> >   <relation>
> >     <Attribute Type="string" Name="FindNumber">
> >       <Value><![CDATA[0010]]></Value>
> >     <Attribute>
> >     <Attribute Type="float" Name="...
> >     <object>
> >       <Attribute Type="string" Name="PartNumber">
> >         <Value><![CDATA[Part2]]></Value>
> >       </Attribute>
> >     </object>
> >   </relation>
> >   <relation>
> >     <Attribute Type="string" Name="FindNumber">
> >       <Value><![CDATA[0015]]></Value>
> >     <Attribute>
> >     <Attribute Type="float" Name="...
> >     <object>
> >       <Attribute Type="string" Name="PartNumber">
> >         <Value><![CDATA[Part3]]></Value>
> >       </Attribute>
> >     </object>
> >   </relation>
> ></object>
> >
> >needs to be compared against a similar structure:
> ><object>
> >   <relation>
> >     <Attribute Type="string" Name="FindNumber">
> >       <Value><![CDATA[0005]]></Value>
> >     <Attribute>
> >     <Attribute Type="float" Name="...
> >     <object>
> >       <Attribute Type="string" Name="PartNumber">
> >         <Value><![CDATA[Part1]]></Value>
> >       </Attribute>
> >     </object>
> >   </relation>
> >   <relation>
> >     <Attribute Type="string" Name="FindNumber">
> >       <Value><![CDATA[0015]]></Value>
> >     <Attribute>
> >     <Attribute Type="float" Name="...
> >     <object>
> >       <Attribute Type="string" Name="PartNumber">
> >         <Value><![CDATA[Part3b]]></Value>
> >       </Attribute>
> >     </object>
> >   </relation>
> ></object>
> >
> >(Attribute nodes are more than one per object or relation node)

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


Current Thread