Velocity Reviews

Velocity Reviews (
-   Python (
-   -   libxml2 - Attribute (

Richard Mertens 07-11-2003 08:00 AM

libxml2 - Attribute
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

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

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/", line 189, in __getattr__
raise AttributeError,attr
AttributeError: AttributeCount

All times are GMT. The time now is 10:53 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.