Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6bcf4c2

Browse files
committed
Update the docstring.
Add a Node class that defines the NodeType constants, based on discussion in the XML-SIG.
1 parent e1578ce commit 6bcf4c2

1 file changed

Lines changed: 31 additions & 2 deletions

File tree

Lib/xml/dom/__init__.py

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,39 @@
11
"""W3C Document Object Model implementation for Python.
22
3-
The Python mapping of the Document Object Model is documented in <...>.
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.
45
56
This package contains the following modules:
67
78
minidom -- A simple implementation of the Level 1 DOM with namespace
8-
support added (based on the Level 2 specification).
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.
914
1015
"""
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

0 commit comments

Comments
 (0)