[IronPython] An issue with using System.Xml as a Python DOM implementation
curt at hagenlocher.org
Thu Oct 30 18:01:51 PDT 2008
It's not reasonable to view the specification as prescribing syntax; what it
specifies are the *semantics* of the DOM, and naturally, different languages
and environments will implement these semantics differently.
Presumably, NodeType wasn't described as an enumeration in the document
because neither IDL nor Java supported enumerations at the time.
My question is, why does the answer matter?
On Thu, Oct 30, 2008 at 5:05 PM, Seo Sanghyeon <sanxiyn at gmail.com> wrote:
> I am not sure to whom this mail should be addressed. Please help if you
> I am considering the idea of using System.Xml as a Python DOM
> implementation again. After some experimentation, one issue is this:
> an idiomatic way to check for the type of DOM node in Python is:
> if node.nodeType == node.ELEMENT_NODE:
> nodeType is spelled NodeType with capital N in .NET, but that's fine.
> I can translate naming convention. The problem is that .NET's XmlNode
> type does not have attributes for DOM node types, that is,
> ELEMENT_NODE, ATTRIBUTE_NODE, etc. Instead, these attributes ara
> available under XmlNodeType enumeration, with wholly different names,
> like Element, Attribute, etc.
> My question is, why is this blatant incompatibility?
> DOM level 1 Core standard
> seems to clearly say that Node interface should have constants like
> ELEMENT_NODE, ATTRIBUTE_NODE, etc. defined.
> Seo Sanghyeon
> Users mailing list
> Users at lists.ironpython.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Users