[ZPT] ZPT and DOM-methods ??

Guido van Rossum guido@digicool.com
Thu, 26 Apr 2001 09:27:06 -0500


> Has anyone thought about acessing pageTemplate nodes through
> DOM-methods ?? - or even better, has anybody implemented something
> like it ?
> 
> I could really use an implementation of getElementByID() to pull out
> the core content from a PageTemplate for cataloging and other such operations..
> 
> Would it be a horror to implement ?? - There is after all a lot of
> XML-compliancy at the bottom of them..

Funny you should ask.  I originally started with a DOM-based
implementation, but found that it was much too slow, mostly due to the
cost of building DOM trees.  Unfortunately, I buried the DOM code too
deeply to dig it up easily.

But you can do this yourself: when your input is XML, your output is
too, so nothing stops you from parsing the output into a DOM tree.  Or
is that not what you need?  (I have to say that I don't understand
exactly what you want to do -- a concrete example would be helpful.)

--Guido van Rossum (home page: http://www.python.org/~guido/)