libxml2 and mindom

A

ankit

I am parsing xml file using libxml2 and for navigating the document
object tree I want to use minidom. Is it possible. Can anyone give me
any example for the same ?
 
P

Paul Boddie

ankit said:
I am parsing xml file using libxml2 and for navigating the document
object tree I want to use minidom. Is it possible. Can anyone give me
any example for the same ?

Try libxml2dom [1] if you want to use a minidom-style API on documents
parsed by libxml2. Recent namespace discussions notwithstanding, it
should mostly behave itself to your satisfaction. You should even be
able to import libxml2dom nodes into minidom, if you really need
minidom for some reason, but this isn't extensively tested.

Paul

[1] http://www.python.org/pypi/libxml2dom
 
A

ankit

Hi Paul,
I checked for it and here are my comments on it:
libxml2dom has Alpha release . So there may be some bugs in it. In our
project we cant take risk to move back after deciding for one. Thanks
for your reply.

I checked some other options like libgdome2. Can you make some comments
on that?
The reason for using minidom is its simplicity for traversing document
tree.

And also I want schema support in the package along with minidom
support.
Can you provide any other option(package) which would suffice this
requirement.
As far as I know no other package instead of libxml2 provides schema
support.
Am I right.

Please clear me. I would be thankful to you
 
P

Paul Boddie

ankit said:
I checked for it and here are my comments on it:
libxml2dom has Alpha release . So there may be some bugs in it. In our
project we cant take risk to move back after deciding for one. Thanks
for your reply.

Understood. I accept that there's some way to go before libxml2dom can
be considered mature.
I checked some other options like libgdome2. Can you make some comments
on that?

Sorry, but I've only investigated the libxml2 DOM libraries for other
languages in passing - I haven't actually used any of them.
The reason for using minidom is its simplicity for traversing document
tree.
Right.

And also I want schema support in the package along with minidom
support.
Can you provide any other option(package) which would suffice this
requirement.

Whilst lxml also wraps libxml2, that package doesn't expose a DOM API
as far as I know, although one was once proposed/discussed/partially
developed. Here's a link to that project:

http://codespeak.net/lxml/
As far as I know no other package instead of libxml2 provides schema
support.
Am I right.

I think you'd be best served asking on the XML-SIG mailing list and
searching its archives. See here:

http://mail.python.org/pipermail/xml-sig/

Paul
 
A

ankit

Hi Paul,
Now I am fixed with libxml2 and libxml2dom. but can you tell me to what
extent libxml2dom supports minidom.
because I want minidom for traversing. Where I can find the
documentation of libxml2dom.
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top