[XML-SIG] Re: New to Python OO

Michael Sanborn michael@graphion.com
Mon, 14 Dec 1998 13:25:10 -0800


Fred L. Drake writes:

>   There are two questions that need to be addressed here:  1) How
> should all this work, and 2) how to make it work now.
>   Let's start with the second question, since it's easier.  This is
> an
> approach I've used to write out an ESIS stream, so I can claim it
> works.  Write the transform you want as a function (or maybe an
> object, if that's more conventient for state management), and pass
> the
> document to it.  It just needs to walk the tree and handle each node
> type appropriately.

Yes, this gets me over the hump just fine, thanks. I'm now able to write
out the result of SQL queries as XML and then, with only a few lines of
additional code (subclassing Walker), alternatively write it out in my
company's proprietary typesetting markup. And this after less than a
month's acquaintance with Python. I think I'm in love!

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. :-)

Thanks for everything.

Michael Sanborn
Graphion Typesetting