summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-11-30 15:37:33 (GMT)
committerFred Drake <fdrake@acm.org>2001-11-30 15:37:33 (GMT)
commitbd34b6bc3d18f968a985d745416aa0e54bdfce0c (patch)
treea5e174f12c0cdc01d16fcef0a8570c80fb317749
parentb3be216b41a4755556a887baa6ab440279fbe1dc (diff)
downloadcpython-bd34b6bc3d18f968a985d745416aa0e54bdfce0c.zip
cpython-bd34b6bc3d18f968a985d745416aa0e54bdfce0c.tar.gz
cpython-bd34b6bc3d18f968a985d745416aa0e54bdfce0c.tar.bz2
Added the convenience constants that are present in PyXML to make these
more similar.
-rw-r--r--Doc/lib/xmldom.tex35
-rw-r--r--Lib/xml/dom/__init__.py6
2 files changed, 41 insertions, 0 deletions
diff --git a/Doc/lib/xmldom.tex b/Doc/lib/xmldom.tex
index b97d972..58b944d 100644
--- a/Doc/lib/xmldom.tex
+++ b/Doc/lib/xmldom.tex
@@ -112,6 +112,40 @@ raise an \exception{ImportError}. The features list must be a sequence of
(feature, version) pairs which are passed to hasFeature.
\end{funcdesc}
+
+Some convenience constants are also provided:
+
+\begin{datadesc}{EMPTY_NAMESPACE}
+ The value used to indicate that no namespace is associated with a
+ node in the DOM. This is typically found as the
+ \member{namespaceURI} of a node, or used as the \var{namespaceURI}
+ parameter to a namespaces-specific method.
+ \versionadded{2.2}
+\end{datadesc}
+
+\begin{datadesc}{XML_NAMESPACE}
+ The namespace URI associated with the reserved prefix \code{xml}, as
+ defined by
+ \citetitle[http://www.w3.org/TR/REC-xml-names/]{Namespaces in XML}
+ (section~4).
+ \versionadded{2.2}
+\end{datadesc}
+
+\begin{datadesc}{XMLNS_NAMESPACE}
+ The namespace URI for namespace declarations, as defined by
+ \citetitle[http://www.w3.org/TR/DOM-Level-2-Core/core.html]{Document
+ Object Model (DOM) Level 2 Core Specification} (section~1.1.8).
+ \versionadded{2.2}
+\end{datadesc}
+
+\begin{datadesc}{XHTML_NAMESPACE}
+ The URI of the XHTML namespace as defined by
+ \citetitle[http://www.w3.org/TR/xhtml1/]{XHTML 1.0: The Extensible
+ HyperText Markup Language} (section~3.1.1).
+ \versionadded{2.2}
+\end{datadesc}
+
+
% Should the Node documentation go here?
In addition, \module{xml.dom} contains a base \class{Node} class and
@@ -124,6 +158,7 @@ concrete \class{Node} objects; they are located within the class
rather than at the module level to conform with the DOM
specifications.
+
\subsection{Objects in the DOM \label{dom-objects}}
The definitive documentation for the DOM is the DOM specification from
diff --git a/Lib/xml/dom/__init__.py b/Lib/xml/dom/__init__.py
index aa19ca1..dab06ac 100644
--- a/Lib/xml/dom/__init__.py
+++ b/Lib/xml/dom/__init__.py
@@ -116,4 +116,10 @@ class NamespaceErr(DOMException):
class InvalidAccessErr(DOMException):
code = INVALID_ACCESS_ERR
+
+XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
+XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/"
+XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml"
+EMPTY_NAMESPACE = None
+
from domreg import getDOMImplementation,registerDOMImplementation