[XML-SIG] SAX Events to DOM Tree

Neil Benn benn at cenix-bioscience.com
Fri Feb 18 13:20:04 CET 2005


    I have a couple of questions :

          I'm looking for some code which takes SAX Events and converts 
them to a DOM Tree, the sax events don;t have a namespace decleration - 
however I'm lost, from this page 
(http://pyxml.sourceforge.net/topics/howto/node10.html) I can see :

    Classes for building DOM trees from various input sources: SAX1 and
    SAX2 parsers, htmllib, and directly using Expat.

However running help from the command line bring back a reader which 
states that it can only receive streams of strings (I would expect it to 
implement ContentHandler).  I also found a class on ActiveState 
cookbooks but it only works with name spaced SAX events.  Before I go 
about writing something is there a class which can do what I need?

    The next bit is that the XMLGenerator only prints out code in one 
huge big contiguous sequence of chars, I would like to have something 
that pretty prints (with \t and \n) to the 'file-like' object (aka 
output stream ;-)).  Again this seems like a common thing so I was gonna 
check to see if I there is already a class that does this?

    As you can see I don't like writing code if it exists in a standard 
distribution, I've checked for the api docs with google (used 'pyxml 
doc', 'pyxml api doc', 'pyxml api docs', 'pyxml docs') and nada (only 
howtos and tutorials on xml).

    Thanks, in advance for your help.




Neil Benn
Senior Automation Engineer
Cenix BioScience
BioInnovations Zentrum
Tatzberg 46

Tel : +49 (0)351 4173 154
e-mail : benn at cenix-bioscience.com
Cenix Website : http://www.cenix-bioscience.com

More information about the XML-SIG mailing list