libxml2 - Attribute

Discussion in 'Python' started by Richard Mertens, Jul 11, 2003.

  1. I'd like to read the attributes from a node in my xml - file, but i didn't
    found an example for this. Could someone help me please?
    I ghet the attribute count work neither.

    example - xml file

    <test>
    <muh attr1="test1" attr2="test">kulimuh</muh>
    </test>

    example python - script

    ctxt = doc.xpathNewContext()
    res = ctxt.xpathEval("//test/muh")
    for myres in res:
    print myres.AttributeCount


    File "/usr/lib/python2.2/site-packages/libxml2.py", line 189, in __getattr__
    raise AttributeError,attr
    AttributeError: AttributeCount
     
    Richard Mertens, Jul 11, 2003
    #1
    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. Alain Ketterlin

    libxml2/libxslt crash

    Alain Ketterlin, Feb 26, 2004, in forum: XML
    Replies:
    0
    Views:
    507
    Alain Ketterlin
    Feb 26, 2004
  2. Replies:
    1
    Views:
    556
    Patrick TJ McPhee
    Mar 2, 2004
  3. Replies:
    0
    Views:
    494
  4. Ale Vesely
    Replies:
    0
    Views:
    589
    Ale Vesely
    Mar 21, 2005
  5. Laurens

    libxml2 overhead?

    Laurens, Jun 28, 2005, in forum: XML
    Replies:
    0
    Views:
    480
    Laurens
    Jun 28, 2005
Loading...

Share This Page