xml editor

   XML Editor
   XML Author
      DITA Editor
      DocBook Editor
      TEI Editor
      XHTML Editor
      Schema Editor
      XML Schema Editor
      RelaxNG Editor
   XQuery
   SVN Client
      Office Open XML
      XSL:FO Editor
      SVG Editor
      WSDL Editor
Supported platforms
Compatible with Windows7 & Mac OS X Snow Leopard
Ready for
data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Testing 2 XML documents for equality - a solution


Subject: Re: [xsl] Testing 2 XML documents for equality - a solution
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 4 Apr 2005 14:19:39 +0100

> This is a nice feature provided by Saxon (infact very
> nice). And is much more optimized than the named
> template I wrote (in the stylesheet I posted last), as
> Saxon's function runs in native Java code.. 

For the vast majority of nodes this is still a) very expensive way of
comparing them and b) doesn't help with the comparison.

For a given element node if you calculate an XPath to the current node,
and then use that XPath to find a node in the other document, you have
two nodes, you then need to compare whether they are equal, but that is
_exactly_ the problem you are trying to solve. The earlier stylesheet
just took the string value of the node but that is just the
concatenation of all the element content so loses most of the markup
information. 

What is wrong with the much simpler alternative of just writing out the
string corresponding to a specific "canonical" linearisation, and then
jsut comparing those two strings?

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2009 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>® XML Editor