xsl-list
[Top] [All Lists]

Re: [xsl] xdiff. XML file comparison using xslt

2010-04-10 07:17:21
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>