5
votes
3answers
2k views

Good python XML parser to work with namespace heavy documents

Python elementTree seems unusable with namespaces. What are my alternatives? BeautifulSoup is pretty rubbish with namespaces too. I don't want to strip them out. Examples of how a particular python ...
3
votes
1answer
387 views

XML and Python: Get the namespaces declared in root element

How do I access the multiple xmlns declarations at the root element of an XML tree? For example: import xml.etree.cElementTree as ET data = """<root ...
1
vote
1answer
231 views

XHTML namespace issues with cssselect in lxml

I have problems using cssselect with a XHTML (or XML with namespace). Although the documentation says how to use namespace in csselect I do not understand it: cssselect namespaces My Input XHTML ...
3
votes
1answer
969 views

Python lxml iterfind w/ namespace but prefix=None

I want to perform iterfind() for elements which have a namespace but no prefix. I'd like to call iterfind([tagname]) or iterfind([tagname], [namespace dict]) I don't care to enter the tag as ...