Tagged Questions
0
votes
2answers
19 views
Search xml for text and return element/node
I'd like to be able to search an xml formatted file by the text value and return the id it is part of. I've looked through the python library at the xml commands but only saw examples for searching by ...
2
votes
1answer
29 views
python remove element containing namespace
I am trying to remove an element in an xml which contains a namespace.
Here is my code:
templateXml = """<?xml version="1.0" encoding="UTF-8"?>
<Metadata ...
0
votes
2answers
29 views
Why does ElementTree reencode my string?
See:
>>> import xml.etree.ElementTree as et
>>> xmlstring = """<?xml version="1.0" encoding="UTF-8"?>
... <dm><?xml version="1.0" encoding="UTF-8"?>
... ...
0
votes
1answer
16 views
Python XML Serialisation using attributes
I am trying to serialise (several) complicated datastructures from python into a very explicit XML string.
In C#, this is as easy as creating the data structure, marking fields with some attributes ...
0
votes
1answer
37 views
Python 2.7.2: plistlib with itunes xml
I'm reading an itunes generated xml playlist with plistib. The xml has a utf8 header.
When I read the xml with plistib, I get both unicode (e.g., 'Name': u'Don\u2019t You Remember') and byte strings ...
-1
votes
0answers
41 views
ValueError: could not convert string to float: (buffer related?)
full code:
http://dl.dropbox.com/u/10405722/siesta_pdos.py
critical part:
if( self.parts['energy_values'] ):
if( ch != '\n' ):
self.data.energy_values.append( ...
0
votes
2answers
42 views
Most efficient way of extracting data from xml using lxml
I have the following snippet of a large xml file. I would like to extract specific namespaces, such as xmlns:dc="http://purl.org/dc/elements/1.1/". currently i am able to do this like follows:
tree = ...
0
votes
1answer
17 views
Python XML parsing with complicated structure (timestamp)
How can I properly parse the follwoing xml codes?
I have tried a number of other examples codes, but they seem not work in my case.
Especially for the comma separated data structure.
This one might ...
1
vote
2answers
55 views
Python - Generator function resets between calls?
I'm parsing a language dictionary, represented in an XML file, with ElementTree's iterparse function. I'm filtering it with a generator function, and some weird order of execution misunderstanding ...
1
vote
1answer
17 views
Configuring eulexistdb with python bringing errors in django setting module
I have following code written in python in order to communicate with ExistDB using eulexistdb module.
from eulexistdb import db
class TryExist:
def __init__(self):
self.db = ...
0
votes
2answers
32 views
Python SAX parser fails to handle  character
I try to parse XML file via xml.sax.handler.ContentHandler subclass. The parser fails at the following line:
<desc>some_text</desc>
and I get the following error:
...
-1
votes
0answers
25 views
Building a web xml input/output with user authentication? [on hold]
So, first of all I have to say I'm not too familiar with web development. However I need to build this rather simple web application which would do:
User authentication
Once user logs in he can ...
0
votes
2answers
12 views
Parsing XML with Python ElementTree with incorrect tags
I am trying to use Python to parse an XML file to get the title, author, URL, and summary out of the XML feed. Then I ensure The XML where we are gathering the data is like this:
<?xml ...
1
vote
1answer
24 views
Parse XML with ElementTree
I'm trying to parse a xml with the below content
<File version="5.6">
<Parent name="A">
<Child name="a"/>
<Child name="b"/>
</Parent>
<Parent name="B">
<Child ...
2
votes
4answers
2k views
Error 'failed to load external entity' when using Python lxml
I'm trying to parse an XML document I retrieve from the web, but it crashes after parsing with this error:
': failed to load external entity "<?xml version="1.0" encoding="UTF-8"?>
...