473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

PyXML: SAX vs. DOM

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
Jan 20 '06 #1
5 2108
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
Jan 20 '06 #2
Matthias Kaeppler wrote:
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
Jan 20 '06 #3
Steven Bethard wrote:
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
Jan 20 '06 #4
-------- Original Message --------
From: Matthias Kaeppler <vo**@void.com>
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-Le...Core-20001113/
http://www.w3.org/TR/2000/REC-DOM-Le...1113/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/...ction-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
Jan 21 '06 #5
Ivan Herman wrote:
I know this is not the ideal answer, but maybe it helps...


It does, thanks Ivan.

Regards,
Matthias
Jan 21 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: leo | last post by:
hi there i want to write a little SOAP client and thought about using ZSI. now i have read that ZSI only works with PyXML versions later than 0.6 and earlier than 0.7. unfortunaltly i can...
2
by: David Dorward | last post by:
I'm attempting to read an XHTML 1.1 file, perform some DOM manipulation, then write the results to a different file. I've found myself rather stuck at the first hurdle. I have the following: ...
1
by: Dan | last post by:
I'm writing a Python program that does some XML parsing, though nothing heavy, and I want to avoid requiring the user to install additional libraries like PyXML. The documentation for my version...
3
by: Thomas W | last post by:
I've tried to install the pyxml-package, available at http://pyxml.sourceforge.net/, both from source and using some hack on the win32-binary package available for python2.4, but without luck....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.