[XML-SIG] help - attributes namespace - is this a bug in PyXML
abra9823 at mail.usyd.edu.au
Tue Aug 17 04:38:00 CEST 2004
no, there isn't any particular feature of 4DOM that i need.
the problem though seems that i can't use xpath in PyXML with a document
parsed using xml.dom.minidom
the following piece of code
dataNodes = xpath.Evaluate(".//*[local-name()='DATA']",document.documentEle
works perfectly fine when i pass in a document parsed using
document = reader.fromStream(open("test.xml", 'r'))
however when i pass a document parsed using minidom i get the following
File "C:\PYTHON23\Lib\site-packages\_xmlplus\xpath\__init__.py", line 70,
retval = parser.new().parse(expr).evaluate(con)
cationPath.py", line 52, in evaluate
res = Set.Union(res,subRt)
File "C:\PYTHON23\Lib\site-packages\_xmlplus\xpath\Set.py", line 25, in
return compare + filter(lambda x,compare = compare:x not in
TypeError: can only concatenate list (not "tuple") to list
i would actually prefer using just minidom and not even have xpath. the
application may be ported to a PDA and the pythonce distribution does not
include the PyXML package.
since i use xpath to just locate node subsets, i would have to rewrite
funtions to do that by just looping through the different nodes (i don't
know how hard that will be) --- is there someone who has already done
on the PyXML documentation page under the section on compliance issues, it
"Never gets the attribute - always returns false for hasAttribute, empty
string for getAttribute, or null for getAttributeNode."
funny. i should have read that before trying hours on why my calls weren't
efficiency and a future port to a PDA are the reasons why i didn't use
pxdom. that and being a newbie meant i knew very little about the
> Alternatively both minidom and pxdom do a bit better with namespaces in
> general and allow access to DOM Level 1 and 2 methods at the same time.
> Is there a particular feature of 4DOM you need?
> Andrew Clover
> mailto:and at doxdesk.com
> XML-SIG maillist - XML-SIG at python.org
This message was sent using IMP, the Internet Messaging Program.
More information about the XML-SIG