diff options
author | Fred Drake <fdrake@acm.org> | 2000-12-11 22:29:23 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-12-11 22:29:23 (GMT) |
commit | 6bcf4c2a0b51ecb9002bcc96d71c354c6afe7990 (patch) | |
tree | 621c7a29c5183b125cde9c057597139539044b19 /Lib/xml/dom | |
parent | e1578ce20464dfda61d3b113f95fd006783beed6 (diff) | |
download | cpython-6bcf4c2a0b51ecb9002bcc96d71c354c6afe7990.zip cpython-6bcf4c2a0b51ecb9002bcc96d71c354c6afe7990.tar.gz cpython-6bcf4c2a0b51ecb9002bcc96d71c354c6afe7990.tar.bz2 |
Update the docstring.
Add a Node class that defines the NodeType constants, based on discussion
in the XML-SIG.
Diffstat (limited to 'Lib/xml/dom')
-rw-r--r-- | Lib/xml/dom/__init__.py | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/Lib/xml/dom/__init__.py b/Lib/xml/dom/__init__.py index 7096c39..0c9049e 100644 --- a/Lib/xml/dom/__init__.py +++ b/Lib/xml/dom/__init__.py @@ -1,10 +1,39 @@ """W3C Document Object Model implementation for Python. -The Python mapping of the Document Object Model is documented in <...>. +The Python mapping of the Document Object Model is documented in the +Python Library Reference in the section on the xml.dom package. This package contains the following modules: minidom -- A simple implementation of the Level 1 DOM with namespace - support added (based on the Level 2 specification). + support added (based on the Level 2 specification) and other + minor Level 2 functionality. + +pulldom -- DOM builder supporting on-demand tree-building for selected + subtrees of the document. """ + + +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 |