[XML-SIG] [ pyxml-Bugs-1639086 ] 1) XmlProc is not "pure" python 2) Problems with name spaces
SourceForge.net
noreply at sourceforge.net
Fri Jan 19 01:49:40 CET 2007
Bugs item #1639086, was opened at 2007-01-18 19:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=1639086&group_id=6473
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: xmlproc
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Yoav Zibin (zyoav)
Assigned to: Lars Marius Garshol (larsga)
Summary: 1) XmlProc is not "pure" python 2) Problems with name spaces
Initial Comment:
Hi,
First thanks for XmlProc, we really needed a pure python parser that will work in mobile phones.
However, it uses cPickle, which is not a standard Python extension. (You should just mention it in the documentation)
Second issue is a problem with namespaces when using Sax2DOM.
The problem has two parts:
1) In drv_xmlproc.py method
def handle_start_tag(self,name,attrs):
You have this code:
if not self.rep_ns_attrs:
del attrs[a]
That deletes the xmlns attributes.
However, if I write the following code:
import xml.sax
import xml.dom.minidom
yoav_parser = xml.sax.make_parser(['xml.sax.drivers2.drv_xmlproc'])
print xml.dom.minidom.parse("example.xml", yoav_parser).toxml()
Then the resulting xml does not have the xmlns attributes.
Therefore you should not delete those attributes.
2) The second problem is in the SAX interface for giving the qualified names: you only give the namespace for elements. However attributes can have a namespace as well:
... type="tns:ArrayOfTheater"/>
And you do not supply a function to find the qualified names of attributes.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=1639086&group_id=6473
More information about the XML-SIG
mailing list