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

Re: xdiff. XML file comparison using xslt

Subject: Re: xdiff. XML file comparison using xslt
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 10 Apr 2010 13:17:03 +0100
Re:  xdiff. XML file comparison using xslt
On 10/04/2010 12:49, Dave Pawson wrote:
2010-04-10T12:39:24Z
DaveP ideas on what an xdiff should do.

HL requirement, to compare two XML files as being 'equal', using XSLT.

KISS
  compare doc1, doc2
1. traverse the tree of doc1 in its entirity
2. for each element node:
      have access to doc2, same xpath access
      # children is the same
        order of children is the same
      # attributes is the same (irrespective of order)
3. for each attribute node
      have access to doc2, same xpath access
      check normalized space value is the same for doc2
4  for each text node
       have access to doc2, same xpath access
       check normalized space value is the same for doc2
5. for each comment - ignore
6. for each PI
       have access to doc2, same xpath access
       check name is the same
       check normalized space value is the same for doc2

At first error, report both node contents, xpath [line number]
        halt processing.

For any node, inability to access the matching node in doc2
is deemed a failure.


'How' to be based on this.


Thoughts?



regards


isn't that more or less deep-equal, perhaps one of the saxon-extended variants?


David

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.