[Zope] Zope XML processing
Phillip J. Eby
pje@telecommunity.com
Tue, 02 Feb 1999 16:46:41 -0500
Just a quickie note... I've begun doing some XML processing using the
xml-sig's xml library and Z Templates. Specifically, walking a DOM tree in
ZTML. Just demo stuff so far, like:
<!--#var standard_html_header-->
<!--#with firstChild-->
<PRE><!--#in childNodes
-->'<!--#var tagName-->' Node: "<!--#var toxml html_quote-->"
<!--#/in--></PRE>
<!--#/with-->
<!--#var standard_html_footer-->
The only Python I had to write in order to integrate XML objects with my
framework was:
from xml.sax.saxexts import make_parser
from xml.dom.sax_builder import SaxBuilder
_parser = make_parser()
def xml_loader_(filename,**kwargs):
h = SaxBuilder()
_parser.setDocumentHandler( h )
_parser.parseFile( open(filename,'r') )
return h.document
xml_classinfo_ = None,xml_loader_
I imagine integration with Zope would be a bit more complex, but not
because of the XML aspects. I may take a whack at making an XMLDocument
product for Zope when I have some spare time, if nobody else is currently
working on one.