Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 55 additions & 35 deletions Doc/library/xml.dom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@
Node Objects
^^^^^^^^^^^^

All of the components of an XML document are subclasses of :class:`Node`.
.. class:: Node

All of the components of an XML document are subclasses of :class:`Node`.


.. attribute:: Node.nodeType
Expand Down Expand Up @@ -403,14 +405,16 @@
NodeList Objects
^^^^^^^^^^^^^^^^

A :class:`NodeList` represents a sequence of nodes. These objects are used in
two ways in the DOM Core recommendation: an :class:`Element` object provides
one as its list of child nodes, and the :meth:`getElementsByTagName` and
:meth:`getElementsByTagNameNS` methods of :class:`Node` return objects with this
interface to represent query results.
.. class:: NodeList

A :class:`NodeList` represents a sequence of nodes. These objects are used in

Check warning on line 410 in Doc/library/xml.dom.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:meth reference target not found: getElementsByTagNameNS [ref.meth]

Check warning on line 410 in Doc/library/xml.dom.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:meth reference target not found: getElementsByTagName [ref.meth]
two ways in the DOM Core recommendation: an :class:`Element` object provides
one as its list of child nodes, and the :meth:`getElementsByTagName` and
:meth:`getElementsByTagNameNS` methods of :class:`Node` return objects with this
interface to represent query results.

The DOM Level 2 recommendation defines one method and one attribute for these
objects:
The DOM Level 2 recommendation defines one method and one attribute for these
objects:


.. method:: NodeList.item(i)
Expand Down Expand Up @@ -442,16 +446,18 @@
DocumentType Objects
^^^^^^^^^^^^^^^^^^^^

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 :attr:`doctype`
attribute; if there is no ``DOCTYPE`` declaration for the document, the
document's :attr:`doctype` attribute will be set to ``None`` instead of an
instance of this interface.
.. class:: DocumentType

Information about the notations and entities declared by a document (including

Check warning on line 451 in Doc/library/xml.dom.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: doctype [ref.attr]

Check warning on line 451 in Doc/library/xml.dom.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: doctype [ref.attr]
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 :attr:`doctype`
attribute; if there is no ``DOCTYPE`` declaration for the document, the
document's :attr:`doctype` attribute will be set to ``None`` instead of an
instance of this interface.

:class:`DocumentType` is a specialization of :class:`Node`, and adds the
following attributes:
:class:`DocumentType` is a specialization of :class:`Node`, and adds the
following attributes:


.. attribute:: DocumentType.publicId
Expand Down Expand Up @@ -502,9 +508,11 @@
Document Objects
^^^^^^^^^^^^^^^^

A :class:`Document` represents an entire XML document, including its constituent
elements, attributes, processing instructions, comments etc. Remember that it
inherits properties from :class:`Node`.
.. class:: Document

A :class:`Document` represents an entire XML document, including its constituent
elements, attributes, processing instructions, comments etc. Remember that it
inherits properties from :class:`Node`.


.. attribute:: Document.documentElement
Expand Down Expand Up @@ -582,8 +590,10 @@
Element Objects
^^^^^^^^^^^^^^^

:class:`Element` is a subclass of :class:`Node`, so inherits all the attributes
of that class.
.. class:: Element

:class:`Element` is a subclass of :class:`Node`, so inherits all the attributes
of that class.


.. attribute:: Element.tagName
Expand Down Expand Up @@ -686,7 +696,9 @@
Attr Objects
^^^^^^^^^^^^

:class:`Attr` inherits from :class:`Node`, so inherits all its attributes.
.. class:: Attr

:class:`Attr` inherits from :class:`Node`, so inherits all its attributes.


.. attribute:: Attr.name
Expand Down Expand Up @@ -719,7 +731,9 @@
NamedNodeMap Objects
^^^^^^^^^^^^^^^^^^^^

:class:`NamedNodeMap` does *not* inherit from :class:`Node`.
.. class:: NamedNodeMap

:class:`NamedNodeMap` does *not* inherit from :class:`Node`.


.. attribute:: NamedNodeMap.length
Expand All @@ -743,8 +757,10 @@
Comment Objects
^^^^^^^^^^^^^^^

:class:`Comment` represents a comment in the XML document. It is a subclass of
:class:`Node`, but cannot have child nodes.
.. class:: Comment

:class:`Comment` represents a comment in the XML document. It is a subclass of
:class:`Node`, but cannot have child nodes.


.. attribute:: Comment.data
Expand All @@ -759,14 +775,16 @@
Text and CDATASection Objects
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The :class:`Text` interface represents text in the XML document. If the parser
and DOM implementation support the DOM's XML extension, portions of the text
enclosed in CDATA marked sections are stored in :class:`CDATASection` objects.
These two interfaces are identical, but provide different values for the
:attr:`nodeType` attribute.
.. class:: Text

These interfaces extend the :class:`Node` interface. They cannot have child
nodes.
The :class:`Text` interface represents text in the XML document. If the parser

Check warning on line 780 in Doc/library/xml.dom.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: nodeType [ref.attr]

Check warning on line 780 in Doc/library/xml.dom.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:class reference target not found: CDATASection [ref.class]
and DOM implementation support the DOM's XML extension, portions of the text
enclosed in CDATA marked sections are stored in :class:`CDATASection` objects.
These two interfaces are identical, but provide different values for the
:attr:`nodeType` attribute.

These interfaces extend the :class:`Node` interface. They cannot have child
nodes.


.. attribute:: Text.data
Expand All @@ -787,8 +805,10 @@
ProcessingInstruction Objects
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Represents a processing instruction in the XML document; this inherits from the
:class:`Node` interface and cannot have child nodes.
.. class:: ProcessingInstruction

Represents a processing instruction in the XML document; this inherits from the
:class:`Node` interface and cannot have child nodes.


.. attribute:: ProcessingInstruction.target
Expand Down
Loading