Need the list of XML parsers

Discussion in 'Python' started by Venu, Jan 17, 2011.

  1. Venu

    Venu Guest

    Hi,

    I am getting into serious Python programming for Electronic CAD tools,
    I am trying to find the best XML parser modules available. I need good
    searching capability for attributes, nodes and block of XML. I am
    looking for either a recommendation or previous forum links.

    Thanks
    Venu
     
    Venu, Jan 17, 2011
    #1
    1. Advertising

  2. On Monday 17 January 2011 11:05 PM, Venu wrote:
    > Hi,
    >
    > I am getting into serious Python programming for Electronic CAD tools,
    > I am trying to find the best XML parser modules available. I need good
    > searching capability for attributes, nodes and block of XML. I am
    > looking for either a recommendation or previous forum links.
    >
    > Thanks
    > Venu

    lxml is a good XML parser. It supports xpath and IIRC, xquery.

    I wrote a blog post about it a while ago -
    http://techchorus.net/web-scraping-lxml


    --
    With warm regards,
    Sudheer. S
    Personal home page - http://sudheer.net | Tech Chorus -
    http://techchorus.net
    Web and IT services - http://binaryvibes.co.in
     
    Sudheer Satyanarayana, Jan 17, 2011
    #2
    1. Advertising

  3. Venu

    hackingKK Guest

    Hi Venu,
    Use element tree module.
    This comes with Python itself and does all that you need with presision.
    I have already used it and it does a very very good job.
    Happy hacking.
    Krishnakant.

    On 17/01/11 23:05, Venu wrote:
    > Hi,
    >
    > I am getting into serious Python programming for Electronic CAD tools,
    > I am trying to find the best XML parser modules available. I need good
    > searching capability for attributes, nodes and block of XML. I am
    > looking for either a recommendation or previous forum links.
    >
    > Thanks
    > Venu
    >
     
    hackingKK, Jan 17, 2011
    #3
  4. Venu, 17.01.2011 18:35:
    > I am getting into serious Python programming for Electronic CAD tools,
    > I am trying to find the best XML parser modules available. I need good
    > searching capability for attributes, nodes and block of XML. I am
    > looking for either a recommendation or previous forum links.


    Canonical answers: cElementTree and lxml.

    The first, if you want to use stdlib tools, the second, if you can afford
    external dependencies.

    Both are mostly compatible, very fast and memory friendly. lxml has lots of
    features in addition.

    Stefan
     
    Stefan Behnel, Jan 17, 2011
    #4
  5. Venu, 17.01.2011 21:34:
    > Using cElementTree, would you be willing show to me how to find the nodes with certain attribute, ie search using attributes and attibute values.
    > I did not see any example code from the cElementTree official website.


    Check out the documentation of ElementTree and lxml.etree. That should get
    you going.

    Stefan
     
    Stefan Behnel, Jan 18, 2011
    #5
  6. Venu Allipuram, 17.01.2011 21:01:
    > lxml is a great one, but it is not simple to install libxml and libxslt on
    > Linux using user permissions.


    Well, you have to build it, obviously. Just pass "--static-deps" to the
    build script and it will build and link libxml2 and libxslt automatically
    for you.

    Stefan
     
    Stefan Behnel, Jan 18, 2011
    #6
    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. Replies:
    1
    Views:
    782
    Esmond Pitt
    Mar 27, 2005
  2. Thomas Guettler

    xml.parsers.expat vs. xml.sax

    Thomas Guettler, Apr 27, 2004, in forum: Python
    Replies:
    2
    Views:
    921
    Martijn Faassen
    Apr 27, 2004
  3. Replies:
    2
    Views:
    383
  4. kaens
    Replies:
    6
    Views:
    345
    Stefan Behnel
    May 23, 2007
  5. kaens
    Replies:
    0
    Views:
    388
    kaens
    May 23, 2007
Loading...

Share This Page