Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > libxml2 and mindom

Reply
Thread Tools

libxml2 and mindom

 
 
ankit
Guest
Posts: n/a
 
      12-21-2005
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 ?

 
Reply With Quote
 
 
 
 
Paul Boddie
Guest
Posts: n/a
 
      12-21-2005
ankit wrote:
> 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

 
Reply With Quote
 
 
 
 
ankit
Guest
Posts: n/a
 
      12-21-2005
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

 
Reply With Quote
 
Paul Boddie
Guest
Posts: n/a
 
      12-21-2005
ankit wrote:
> 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

 
Reply With Quote
 
ankit
Guest
Posts: n/a
 
      12-26-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: How do I install libxml2 and libxslt? Kevin Ar18 Python 1 11-04-2009 01:41 PM
XPath 2 and XSLT 2 for libxml2, libxslt Steve Ball XML 0 11-24-2008 11:16 PM
libxml2 and XPath - Iterate through repeating elements? nickheppleston@gmail.com Python 2 12-05-2005 10:31 AM
libxml2 and parsing zen XML 0 08-03-2005 01:53 PM
libxml2 and node identity Victor Ng Python 1 06-23-2004 11:35 AM



Advertisments