473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

<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

Jul 18 '05 #1
0 2126

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Juergen R. Plasser | last post by:
Hi, I have installed libxml2-2.5.7, libxslt-1.0.30 from source and the bindings libxml2-python-2.5.7. Everything seems to compile fine, but when I try to import the libxml2 library in python...
5
by: Rene Olsthoorn | last post by:
Dear readers, py2exe has a problem including libxml2. Not at building time, but at runtime. The libxml2.dll cannot be loaded... Is there anyone that NOT has the problem? (and can you drop me...
1
by: Victor Ng | last post by:
I've been trying to find information with how to figure out node identity in libxml2 - but I'm at a loss. I can't seem to find what I'm looking for on the xmlsoft.org site and google doesn't seem...
1
by: bdecker | last post by:
Hello, I was hoping that someone here can please answer two questions concerning libxml2 python module use: 1. Is this snippet correct? doc = libxml2.parseDoc(readfile(filename)) ctxt =...
2
by: nickheppleston | last post by:
I'm trying to iterate through repeating elements to extract data using libxml2 but I'm having zero luck - any help would be appreciated. My XML source is similar to the following - I'm trying to...
1
by: cesar.ortiz | last post by:
Hi all, I have created an example using libxml2 based in the code that appears in http://xmlsoft.org/python.html. My example processes an enough amount of html files to see that the memory...
1
by: Andrew Marlow | last post by:
guys, I have been using libxml2 with python with no problems for just over a week but now I come to see if my script will work in someone else's environment and the libxml2 import fails. I am...
6
by: saumya.agarwal | last post by:
Hi, I am using libxml2 for xml parsing. When the client application sends data to libxml2 in UTF-8 format, it works fine. But, I have a scenarion in which the client application sends data to...
2
by: jianbing.chen | last post by:
Hi, I have this weird situation where on the same machine(solaris 8, python 2.5), one user can do this with no problem: <module 'libxml2' from '/usr/local/lib/python2.5/site-packages/...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.