blob: 0c9049efcb0183b08461dcf13c83430b9dc2f1a1 [file] [log] [blame]
Fred Drakee85c3502000-06-29 19:28:01 +00001"""W3C Document Object Model implementation for Python.
2
Fred Drake6bcf4c22000-12-11 22:29:23 +00003The Python mapping of the Document Object Model is documented in the
4Python Library Reference in the section on the xml.dom package.
Fred Drakee85c3502000-06-29 19:28:01 +00005
6This package contains the following modules:
7
8minidom -- A simple implementation of the Level 1 DOM with namespace
Fred Drake6bcf4c22000-12-11 22:29:23 +00009 support added (based on the Level 2 specification) and other
10 minor Level 2 functionality.
11
12pulldom -- DOM builder supporting on-demand tree-building for selected
13 subtrees of the document.
Fred Drakee85c3502000-06-29 19:28:01 +000014
15"""
Fred Drake6bcf4c22000-12-11 22:29:23 +000016
17
18class Node:
19 """Class giving the NodeType constants."""
20
21 # DOM implementations may use this as a base class for their own
22 # Node implementations. If they don't, the constants defined here
23 # should still be used as the canonical definitions as they match
24 # the values given in the W3C recommendation. Client code can
25 # safely refer to these values in all tests of Node.nodeType
26 # values.
27
28 ELEMENT_NODE = 1
29 ATTRIBUTE_NODE = 2
30 TEXT_NODE = 3
31 CDATA_SECTION_NODE = 4
32 ENTITY_REFERENCE_NODE = 5
33 ENTITY_NODE = 6
34 PROCESSING_INSTRUCTION_NODE = 7
35 COMMENT_NODE = 8
36 DOCUMENT_NODE = 9
37 DOCUMENT_TYPE_NODE = 10
38 DOCUMENT_FRAGMENT_NODE = 11
39 NOTATION_NODE = 12