|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] deep-equal?Michael Kay mike at saxonica.comWed Oct 17 11:23:56 PDT 2007
The XML specification doesn't define such a thing as insignificant whitespace, because there are many contexts in which whitespace is indeed significant. deep-equal() follows this precedent. If you don't want whitespace taken into account, get rid of it before calling deep-equal. In practice the spec of deep-equal() is full of compromises, there are many specific requirements that it won't meet. You can always write your own function. Saxon has an option saxon:deep-equal() with a third parameter containing option flags that can be used to customize its behaviour (including a flag that causes diagnostic messages to be output saying WHY the two trees were deemed unequal). Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: http://x-query.com/mailman/listinfo/talk > [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf Of Florian Wendland > Sent: 17 October 2007 10:02 > To: XQuery Talk > Subject: deep-equal? > > Hi all, > > i have a question concerning the euality of sequences. > Therefore i have prepared two documents, which seemed to be > identically. > > -------------------------------------------------- > First: > > <?xml version="1.0" encoding="utf-8"?> > <webcritics> > <book id="1">Dunkeltann</book> > > </webcritics> > > Second: > > <?xml version="1.0" encoding="utf-8"?> > <webcritics> > <book id="1">Dunkeltann</book> > </webcritics> > --------------------------------------------------- > > The first document contains a linebreak in the > document-element. The deep-equal function returns false, > although the documents are obviously the same (whitespaces > should not be included in the compare mechanism, i think). > > Is this behaviour of the deep-equal function coorect? > > Thx > > mfw > > _______________________________________________ > http://x-query.com/mailman/listinfo/talk > http://x-query.com/mailman/listinfo/talk
|
Purchase Stylus Studio Online Today!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






