Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e21e2bb1
Commit
e21e2bb1
authored
Oct 26, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up a number of small problems with the DOM documentation.
There's still a lot to do, but it's better now.
parent
b83769cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
20 deletions
+35
-20
Doc/lib/xmldom.tex
Doc/lib/xmldom.tex
+16
-6
Doc/lib/xmldomminidom.tex
Doc/lib/xmldomminidom.tex
+19
-14
No files found.
Doc/lib/xmldom.tex
View file @
e21e2bb1
...
...
@@ -114,8 +114,15 @@ raise an \exception{ImportError}. The features list must be a sequence of
% Should the Node documentation go here?
In addition,
\module
{
xml.dom
}
contains the
\class
{
Node
}
, and the DOM
exceptions.
In addition,
\module
{
xml.dom
}
contains a base
\class
{
Node
}
class and
the DOM exception classes. The
\class
{
Node
}
class provided by this
module does not implement any of the methods or attributes defined by
the DOM specification; concrete DOM implementations must provide
those. The
\class
{
Node
}
class provided as part of this module does
provide the constants used for the
\member
{
nodeType
}
attribute on
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
}}
...
...
@@ -358,7 +365,10 @@ Information about the notations and entities declared by a document
(including the external subset if the parser uses it and can provide
the information) is available from a
\class
{
DocumentType
}
object. The
\class
{
DocumentType
}
for a document is available from the
\class
{
Document
}
object's
\member
{
doctype
}
attribute.
\class
{
Document
}
object's
\member
{
doctype
}
attribute; if there is no
\code
{
DOCTYPE
}
declaration for the document, the document's
\member
{
doctype
}
attribute will be set to
\code
{
None
}
instead of an
instance of this interface.
\class
{
DocumentType
}
is a specialization of
\class
{
Node
}
, and adds the
following attributes:
...
...
@@ -381,8 +391,7 @@ following attributes:
\begin{memberdesc}
[DocumentType]
{
name
}
The name of the root element as given in the
\code
{
DOCTYPE
}
declaration, if present. If the was no
\code
{
DOCTYPE
}
declaration,
this will be
\code
{
None
}
.
declaration, if present.
\end{memberdesc}
\begin{memberdesc}
[DocumentType]
{
entities
}
...
...
@@ -589,7 +598,8 @@ DOM. Each item is an attribute node. Get its value with the
There are also experimental methods that give this class more mapping
behavior. You can use them or you can use the standardized
\method
{
getAttribute*()
}
-family methods on the
\class
{
Element
}
objects.
\method
{
getAttribute*()
}
family of methods on the
\class
{
Element
}
objects.
\subsubsection
{
Comment Objects
\label
{
dom-comment-objects
}}
...
...
Doc/lib/xmldomminidom.tex
View file @
e21e2bb1
...
...
@@ -180,8 +180,10 @@ following mapping rules apply:
\item
The type
\code
{
DOMString
}
maps to Python strings.
\refmodule
{
xml.dom.minidom
}
supports either byte or Unicode
strings, but will normally produce Unicode strings. Attributes
of type
\code
{
DOMString
}
may also be
\code
{
None
}
.
strings, but will normally produce Unicode strings. Values
of type
\code
{
DOMString
}
may also be
\code
{
None
}
where allowed
to have the IDL
\code
{
null
}
value by the DOM specification from
the W3C.
\item
\keyword
{
const
}
declarations map to variables in their
respective scope
...
...
@@ -193,9 +195,12 @@ following mapping rules apply:
\refmodule
{
xml.dom.minidom
}
uses standard Python exceptions such
as
\exception
{
TypeError
}
and
\exception
{
AttributeError
}
.
\item
\class
{
NodeList
}
objects are implemented as Python's built-in
list type, so don't support the official API, but are much more
``Pythonic.''
\item
\class
{
NodeList
}
objects are implemented using Python's built-in
list type. Starting with Python 2.2, these objects provide the
interface defined in the DOM specification, but with earlier
versions of Python they do not support the official API. They
are, however, much more ``Pythonic'' than the interface defined
in the W3C recommendations.
\end{itemize}
...
...
@@ -203,23 +208,23 @@ The following interfaces have no implementation in
\refmodule
{
xml.dom.minidom
}
:
\begin{itemize}
\item
DOMTimeStamp
\item
\class
{
DOMTimeStamp
}
\item
DocumentType
(added in Python 2.1)
\item
\class
{
DocumentType
}
(added in Python 2.1)
\item
DOMImplementation
(added in Python 2.1)
\item
\class
{
DOMImplementation
}
(added in Python 2.1)
\item
CharacterData
\item
\class
{
CharacterData
}
\item
CDATASection
\item
\class
{
CDATASection
}
\item
Notation
\item
\class
{
Notation
}
\item
Entity
\item
\class
{
Entity
}
\item
EntityReference
\item
\class
{
EntityReference
}
\item
DocumentFragment
\item
\class
{
DocumentFragment
}
\end{itemize}
Most of these reflect information in the XML document that is not of
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment