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

Skip to content

Commit bd34b6b

Browse files
committed
Added the convenience constants that are present in PyXML to make these
more similar.
1 parent b3be216 commit bd34b6b

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

Doc/lib/xmldom.tex

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,40 @@ \subsection{Module Contents}
112112
(feature, version) pairs which are passed to hasFeature.
113113
\end{funcdesc}
114114

115+
116+
Some convenience constants are also provided:
117+
118+
\begin{datadesc}{EMPTY_NAMESPACE}
119+
The value used to indicate that no namespace is associated with a
120+
node in the DOM. This is typically found as the
121+
\member{namespaceURI} of a node, or used as the \var{namespaceURI}
122+
parameter to a namespaces-specific method.
123+
\versionadded{2.2}
124+
\end{datadesc}
125+
126+
\begin{datadesc}{XML_NAMESPACE}
127+
The namespace URI associated with the reserved prefix \code{xml}, as
128+
defined by
129+
\citetitle[http://www.w3.org/TR/REC-xml-names/]{Namespaces in XML}
130+
(section~4).
131+
\versionadded{2.2}
132+
\end{datadesc}
133+
134+
\begin{datadesc}{XMLNS_NAMESPACE}
135+
The namespace URI for namespace declarations, as defined by
136+
\citetitle[http://www.w3.org/TR/DOM-Level-2-Core/core.html]{Document
137+
Object Model (DOM) Level 2 Core Specification} (section~1.1.8).
138+
\versionadded{2.2}
139+
\end{datadesc}
140+
141+
\begin{datadesc}{XHTML_NAMESPACE}
142+
The URI of the XHTML namespace as defined by
143+
\citetitle[http://www.w3.org/TR/xhtml1/]{XHTML 1.0: The Extensible
144+
HyperText Markup Language} (section~3.1.1).
145+
\versionadded{2.2}
146+
\end{datadesc}
147+
148+
115149
% Should the Node documentation go here?
116150

117151
In addition, \module{xml.dom} contains a base \class{Node} class and
@@ -124,6 +158,7 @@ \subsection{Module Contents}
124158
rather than at the module level to conform with the DOM
125159
specifications.
126160

161+
127162
\subsection{Objects in the DOM \label{dom-objects}}
128163

129164
The definitive documentation for the DOM is the DOM specification from

Lib/xml/dom/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,10 @@ class NamespaceErr(DOMException):
116116
class InvalidAccessErr(DOMException):
117117
code = INVALID_ACCESS_ERR
118118

119+
120+
XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
121+
XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/"
122+
XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml"
123+
EMPTY_NAMESPACE = None
124+
119125
from domreg import getDOMImplementation,registerDOMImplementation

0 commit comments

Comments
 (0)