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

RE: comparing a part of the XML tree

Subject: RE: comparing a part of the XML tree
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 15 Jul 2007 22:26:12 +0100
RE:  comparing a part of the XML tree
I was assuming a deep-equal comparison applied to the Target element - but
perhaps I didn't examine the problem carefully enough.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Owen Rees [mailto:owen.rees@xxxxxx] 
> Sent: 15 July 2007 22:01
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  comparing a part of the XML tree
> 
> --On 15 July 2007 18:15 +0100 Michael Kay wrote:
> 
> > Calling deep-equal on every element would do the trick. It could 
> > potentially be quite expensive, but with luck deep-equal 
> doesn't take 
> > very long when the arguments are obviously not equal, for 
> example when 
> > they are elements with different names.
> 
> For the example given, deep-equal would not find any pair of 
> items that match. The 'selection' element has two children 
> but does not itself appear in the 'original' so there is no 
> item in the selection that can be deep-equal to any item in 
> the 'original'.
> 
> The first child of 'selection' does seem to be deep-equal to 
> an item in 'original' but the 'selection' item's following 
> sibling - a text node - is not equal to the following sibling 
> of the item in the 'original'. If spaces were to be 
> normalised then the content of the 'selection' text node 
> would be a prefix of the content of the 'original' text node.
> 
> -- 
> Owen Rees
> =======================================================
> Hewlett-Packard Limited
> Registered Office: Cain Road, Bracknell, Berks RG12 1HN
> Registered No: 690597 England

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-2011 All Rights Reserved.