ElementTree and ContentHandler

Neil Benn <[email protected]>
Newsgroups gmane.comp.python.xml
Message-ID <[email protected]>
Hello,

          I have a generated parsing system which parses data which is 
not XML and then generates SAX events for the parsed data.  The system 
can then have a contenthandler bound to it which will capture the events 
and can them output it in a variety of formats (raw XML to a file, DOM, 
collections, custom ValueObject, etc).  If you need an example of it 
then one published case of this (sorry it's in Java) is at : 
http://www.biojava.org/tutorials/blastlikeParsingCookBook/index.html.

    Anyways, that lays out my use case, one of the extra output formats 
I would like to use is to output is an ElementTree object, however from 
what I can see I can't see that there is a class that implements the 
ContentHandler interface and spits out an ElementTree in the downloaded 
package.  I can do this myself (and contribute it back to the project if 
it is wanted) but I wanted to first check that it doesn;t already exist 
before doing the work.

    I know I could output the structure as XML into a 'file-like object' 
but that would slow the parsing down which would be noticable on large 
data sets (although you shouldn't be using ElementTree on large data 
sets anyways ;-) ).

    Thanks for your help.

Cheers,

Neil

-- 

Neil Benn
Senior Automation Engineer
Cenix BioScience
BioInnovations Zentrum
Tatzberg 46
D-01307
Dresden
Germany

Tel : +49 (0)351 4173 154
e-mail : [email protected]
Cenix Website : http://www.cenix-bioscience.com

_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.