[XML-SIG] Re: New to Python OO

Gabe Wachob gwachob@aimnet.com
Mon, 14 Dec 1998 14:43:31 -0800 (PST)


On Mon, 14 Dec 1998, Michael Sanborn wrote:

> Fred L. Drake writes:
> When I have a little more time, I'll also look at Gabe Wachob's Visitor
> class (recently posted to this list), to see if I can also do it the way
> it 'should' be done. :-)

I'm reworking it constantly -- I've added a notion of "subtree value" to
it -- the idea that an entire subtree can be visited and produce a string
which represents its "value" (alternatively, visiting a subtree can
produce side effects like populating a dictionary for use by another
subtree).

Its not terribly clean (ie, the default behavior for node's value is to
take the node's "Value" as returned by the visit method called on that
node and append that value to the value of each of the node's children.
This will basically "flatten" an XML file (The default value of a text
node is the text itself -- other nodes' default values are "").

Anyway, when I get the current version working I'll post it up at the same
URL -- http://www.aimnet.com/~gwachob/DOMVisitor.py

	-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