Fred Drake | e85c350 | 2000-06-29 19:28:01 +0000 | [diff] [blame] | 1 | """W3C Document Object Model implementation for Python. |
| 2 | |
Fred Drake | 6bcf4c2 | 2000-12-11 22:29:23 +0000 | [diff] [blame^] | 3 | The Python mapping of the Document Object Model is documented in the |
| 4 | Python Library Reference in the section on the xml.dom package. |
Fred Drake | e85c350 | 2000-06-29 19:28:01 +0000 | [diff] [blame] | 5 | |
| 6 | This package contains the following modules: |
| 7 | |
| 8 | minidom -- A simple implementation of the Level 1 DOM with namespace |
Fred Drake | 6bcf4c2 | 2000-12-11 22:29:23 +0000 | [diff] [blame^] | 9 | support added (based on the Level 2 specification) and other |
| 10 | minor Level 2 functionality. |
| 11 | |
| 12 | pulldom -- DOM builder supporting on-demand tree-building for selected |
| 13 | subtrees of the document. |
Fred Drake | e85c350 | 2000-06-29 19:28:01 +0000 | [diff] [blame] | 14 | |
| 15 | """ |
Fred Drake | 6bcf4c2 | 2000-12-11 22:29:23 +0000 | [diff] [blame^] | 16 | |
| 17 | |
| 18 | class 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 |