Where is Source for Node Class?

Fernando Pérez fperez528 at yahoo.com
Mon Jul 1 19:27:41 EDT 2002


Harvey Frey wrote:

> 
>  I searched through the other .py files in xml/dom, but I can't find the
>  original node class that minidom is importing.
> 

In [9]: import xml.dom

In [10]: xml.dom.Node ?
Type:           class
String Form:    xml.dom.Node
Namespace:      Currently not defined in user session.
File:           
/usr/local/lib/python2.2/site-packages/_xmlplus/dom/__init__.py
Docstring:
    Class giving the NodeType constants.


In [11]: @psource xml.dom.Node
class Node:
    """Class giving the NodeType constants."""

    # DOM implementations may use this as a base class for their own
    # Node implementations.  If they don't, the constants defined here
    # should still be used as the canonical definitions as they match
    # the values given in the W3C recommendation.  Client code can
    # safely refer to these values in all tests of Node.nodeType
    # values.

    ELEMENT_NODE                = 1
    ATTRIBUTE_NODE              = 2
    TEXT_NODE                   = 3
    CDATA_SECTION_NODE          = 4
    ENTITY_REFERENCE_NODE       = 5
    ENTITY_NODE                 = 6
    PROCESSING_INSTRUCTION_NODE = 7
    COMMENT_NODE                = 8
    DOCUMENT_NODE               = 9
    DOCUMENT_TYPE_NODE          = 10
    DOCUMENT_FRAGMENT_NODE      = 11
    NOTATION_NODE               = 12


Cheers,

f.



More information about the Python-list mailing list