W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1998

Re: [XML-SIG] RE: Equality tests on DOM nodes

From: Gabe Wachob <gwachob@aimnet.com>
Date: Fri, 11 Dec 1998 14:45:09 -0500 (EST)
To: "Fred L. Drake, Jr." <fdrake@acm.org>
cc: www-dom@w3.org, xml-sig@python.org
Message-ID: <Pine.GSO.4.05.9812111128530.24079-100000@shell1.ncal.verio.com>
On Fri, 11 Dec 1998, Fred L. Drake wrote:

> 
> Gabe Wachob writes:
>  > Before you define equality generally for nodes, don't you have to define
>  > equality for each element and even each attribute? This may be a trivial
> ..
>  > Another issue would be order of children. Without a DTD, how do you tell
>  > when order of child elements is significant? Perhaps this has to be an
> 
>   Very good points.  This makes it incredibly expensive to "do it
> right" with any level of abstraction.
>   I guess it's not that hard to just write a routine that "does the
> right thing" for exactly what is needed in each case.  And it's
> looking increasingly appropriate.

Someone mentioned in this list or another that a set of objects
corresponding to a Visitor pattern is something that should be added to
DOM. There could be a default "equalityVisitor" that would have certain
default equality rules built in (lets say, a separate equality test method
for each DOM class). You could simply subclass the equalityVisitor to
modify the semantics of the equality test for whatever particular elements
you needed. Perhaps the equality visitor could simply have enough
configurable parameters to make it do what you want without having to
subclass.

The original context of the Visitor suggestion was for rendering XML into
HTML (I believe).

For info on Visitor Pattern see the Gang of Four book "Design Patterns"
http://iamwww.unibe.ch/CHOOSE/Articles/95-1/DP-book-review.html
 
	-Gabe


-------------------------------------------------------------------
http://www.aimnet.com/~gwachob               http://www.findlaw.com
"A popular Government, without popular information, or the means of 
acquiring it, is but a Prologue to a Farce or a Tragedy; or perhaps 
both." -- James Madison 
                       import std.disclaimer
Received on Monday, 14 December 1998 08:39:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:46 GMT