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

Re: comparing nodesets to each other

Subject: Re: comparing nodesets to each other
From: "Kai Hackemesser" <kaha@xxxxxx>
Date: Mon, 11 Apr 2005 18:18:47 +0200 (MEST)
findnumber
Hello, David,

Thanks for the response. The errors you mentioned already have happened,
that's why I'm currently clueless how to solve it.

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)

So I need to extract all differences like attribute change, missing nodes,
altered nodes, added nodes. To identify a node I use the findnumber
Attribute node of each relation node. A missing node is one, where the
corresponding Findnumber Attribute value is missing in nodelist 'b'. An
added node is one where the corresponding Findnumber Attribute value is
missing in nodelist 'a'. An altered node means the Findnumber Attribute
value is there in bothe nodelists, but the Attribute nodes or the
object/Attribute nodes are different. I think a simple text compare would be
enough for the test of alternation.

Regards,
Kai

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.