libxml2 - Attribute

R

Richard Mertens

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
 

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,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top