libxml2 and mindom

Discussion in 'Python' started by ankit, Dec 21, 2005.

  1. ankit

    ankit Guest

    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 ?
    ankit, Dec 21, 2005
    #1
    1. Advertising

  2. ankit

    Paul Boddie Guest

    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
    Paul Boddie, Dec 21, 2005
    #2
    1. Advertising

  3. ankit

    ankit Guest

    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
    ankit, Dec 21, 2005
    #3
  4. ankit

    Paul Boddie Guest

    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
    Paul Boddie, Dec 21, 2005
    #4
  5. ankit

    ankit Guest

    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.
    ankit, Dec 26, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. zen

    libxml2 and parsing

    zen, Aug 3, 2005, in forum: XML
    Replies:
    0
    Views:
    497
  2. Victor Ng

    libxml2 and node identity

    Victor Ng, Jun 17, 2004, in forum: Python
    Replies:
    1
    Views:
    395
    Victor Ng
    Jun 23, 2004
  3. Replies:
    2
    Views:
    1,032
    Jean-Roch SOTTY
    Dec 5, 2005
  4. Steve Ball
    Replies:
    0
    Views:
    2,683
    Steve Ball
    Nov 24, 2008
  5. Kevin Ar18
    Replies:
    1
    Views:
    521
    Stefan Behnel
    Nov 4, 2009
Loading...

Share This Page