473,606 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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">ku limuh</muh>
</test>

example python - script

ctxt = doc.xpathNewCon text()
res = ctxt.xpathEval( "//test/muh")
for myres in res:
print myres.Attribute Count
File "/usr/lib/python2.2/site-packages/libxml2.py", line 189, in __getattr__
raise AttributeError, attr
AttributeError: AttributeCount

Jul 18 '05 #1
0 2131

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

Similar topics

0
1569
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 I get the following error: Python 2.1.3 (#1, Feb 10 2003, 10:37:44) on linux2
5
4014
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 your setup.py scipt, please). Thanks in advance, Rene O.
1
2018
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 to help at all with the following query: http://www.google.com/search?q=libxml2+node+identity Here's a snippet to show the problem: >>> import libxml2
1
2174
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 = doc.xpathNewContext() ctxt.xpathRegisterNs("xlink","http://www.w3.org/1999/xlink")
2
6614
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 extract the line number and product code from the repeating line elements: <order xmlns="some-ns"> <header> <orderno>123456</orderno> </header>
1
4120
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 consumption rises till the process ends (I check it with the 'top' command). I don´t know if I am forgetting something in the code, as I have not been able to find any example on the web.
1
2351
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 using the python that comes with cygwin. When I try using ActivePython (2.3) or Python IDLE (2.5) there does not seem to be a libxml2 module there. I thought libxml2 was a std python module.
6
4540
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 libxml2 parser in SHIFT-JIS format. The following error is thrown by libxml2 -
2
2896
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/ libxml2.py'> While the another one get this:
0
8036
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8461
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8448
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8317
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6796
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5470
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1572
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1313
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.