[IronPython] pyexpat for IronPython and xml.dom
Sanghyeon Seo
sanxiyn at gmail.com
Wed Oct 25 04:02:15 CEST 2006
I have made some changes to my pyexpat module for IronPython, and it
can run some simple xml.dom codes now.
https://svn.sourceforge.net/svnroot/fepy/trunk/lib/pyexpat.py
Test cases were written too. It exercises DOM Level 1 constructs
(tagName, getAttribute, childNodes, data) and DOM Level 2 namespace
supports (prefix, localName, namespaceURI).
https://svn.sourceforge.net/svnroot/fepy/trunk/example/dom_test.py
Following DOM interfaces currently don't work: DocumentType, Comment,
CDATASection, ProcessingInstruction. Undoubtedly there are more.
To make pyexpat.py work with xml.dom.minidom, I had to implement
ordered_attributes and namespace_prefixes parsing options.
ordered_attributes let pyexpat return attributes in list instead of
dict to preserve the ordering.
namespace_prefixes let pyexpat return namespace prefixes, in addition
to URI. In theory, namespace prefixes are meaningless, but in reality,
several specifications, including XPath and C14N, need this
information.
--
Seo Sanghyeon
More information about the Ironpython-users
mailing list