PyXML: SAX vs. DOM

M

Matthias Kaeppler

Hi,

I have to say I am confused about the documentation on pyxml.sf.net.
When I want to use DOM, I effectively am using a class called Sax2? ^^
I also have to catch SAXExceptions, which reside in xml.sax._exceptions.

I thought DOM and SAX are two completely different things. Why is PyXML
mixing them up like this?

Thanks,
Matthias
 
M

Matthias Kaeppler

Oh and:
Where can I find an API reference for PyXML? Am I supposed to /guess/
which methods and attributes e.g. Sax2 supplies? :D

Thanks again,
Matthias
 
S

Steven Bethard

Matthias said:
I have to say I am confused about the documentation on pyxml.sf.net.
When I want to use DOM, I effectively am using a class called Sax2? ^^
I also have to catch SAXExceptions, which reside in xml.sax._exceptions.

I thought DOM and SAX are two completely different things. Why is PyXML
mixing them up like this?

I don't have an answer to your real question, but if you're not
committed to a particular XML package yet, you might consider ElementTree:
http://effbot.org/zone/element-index.htm

The API is much simpler, and the package has a much more sane
organization. ;) Plus, it will be part of the Python standard library
in Python 2.5.

STeVe
 
M

Matthias Kaeppler

Steven said:
I don't have an answer to your real question, but if you're not
committed to a particular XML package yet, you might consider ElementTree:
http://effbot.org/zone/element-index.htm

The API is much simpler, and the package has a much more sane
organization. ;) Plus, it will be part of the Python standard library
in Python 2.5.

That sounds great, thanks.

Regards,
Matthias
 
I

Ivan Herman

-------- Original Message --------
From: Matthias Kaeppler <[email protected]>
To:
Subject: Re:pyXML: SAX vs. DOM
Date: 20/1/2006 21:26
Oh and:
Where can I find an API reference for PyXML? Am I supposed to /guess/
which methods and attributes e.g. Sax2 supplies? :D

Thanks again,
Matthias


Matthias,

your question is valid, and I just tell you how *I* do it...

- the core of the methods in DOM are described by the W3C recommendations. I
think the most relevant ones are:

http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html

where you can find all objects and methods that are defined by DOM Level 2 and,
as far as I could see, all properly implemented by PyXML.

The only caveat is that DOM2 defines the interface in abstract (more exactly, in
IDL), and one has to know (or guess) how those are mapped onto Python. Having
said that, by looking at the PyXML documentation:

http://pyxml.sourceforge.net/topics/howto/

mainly

http://pyxml.sourceforge.net/topics/howto/section-DOM.html

one can do a very good educated guess so it is not sooo bad as it sounds.

I know this is not the ideal answer, but maybe it helps...

Ivan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top