Skip to content

Commit 9e94614

Browse files
gh-155631: Document the Entity and Notation interfaces and Attr.specified
Entity and Notation were not mentioned at all, although they are implemented and DocumentType.entities and DocumentType.notations contain such nodes.
1 parent cef4943 commit 9e94614

1 file changed

Lines changed: 76 additions & 2 deletions

File tree

Doc/library/xml.dom.rst

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ following attributes:
534534

535535
.. attribute:: DocumentType.entities
536536

537-
This is a :class:`NamedNodeMap` giving the definitions of external entities.
537+
This is a :class:`NamedNodeMap` of :class:`Entity` nodes
538+
giving the definitions of external entities.
538539
For entity names defined more than once, only the first definition is provided
539540
(others are ignored as required by the XML recommendation). This may be
540541
``None`` if the information is not provided by the parser, or if no entities are
@@ -543,7 +544,8 @@ following attributes:
543544

544545
.. attribute:: DocumentType.notations
545546

546-
This is a :class:`NamedNodeMap` giving the definitions of notations. For
547+
This is a :class:`NamedNodeMap` of :class:`Notation` nodes
548+
giving the definitions of notations. For
547549
notation names defined more than once, only the first definition is provided
548550
(others are ignored as required by the XML recommendation). This may be
549551
``None`` if the information is not provided by the parser, or if no notations
@@ -864,6 +866,14 @@ Attr Objects
864866
This is a read-only attribute.
865867

866868

869+
.. attribute:: Attr.specified
870+
871+
Whether the value of the attribute was explicitly set in the document,
872+
as opposed to being defaulted from the DTD.
873+
Always ``False`` in :mod:`xml.dom.minidom`.
874+
This is a read-only attribute.
875+
876+
867877
.. attribute:: Attr.value
868878

869879
The text value of the attribute. This is a synonym for the
@@ -1099,6 +1109,70 @@ Represents a processing instruction in the XML document; this inherits from the
10991109
character.
11001110

11011111

1112+
.. _dom-entity-objects:
1113+
1114+
Entity Objects
1115+
^^^^^^^^^^^^^^
1116+
1117+
.. class:: Entity
1118+
:no-typesetting:
1119+
1120+
:class:`Entity` represents a parsed or unparsed entity declared in the DTD.
1121+
It is a subclass of :class:`Node`.
1122+
Entity nodes are contained in :attr:`DocumentType.entities`
1123+
and cannot be inserted into the document tree.
1124+
The name of the entity is its :attr:`~Node.nodeName`.
1125+
1126+
1127+
.. attribute:: Entity.publicId
1128+
1129+
The public identifier of the entity,
1130+
or ``None`` if it is not specified.
1131+
This is a read-only attribute.
1132+
1133+
1134+
.. attribute:: Entity.systemId
1135+
1136+
The system identifier of the entity.
1137+
This is a read-only attribute.
1138+
1139+
1140+
.. attribute:: Entity.notationName
1141+
1142+
The name of the notation for an unparsed entity,
1143+
or ``None`` for a parsed entity.
1144+
This is a read-only attribute.
1145+
1146+
1147+
.. _dom-notation-objects:
1148+
1149+
Notation Objects
1150+
^^^^^^^^^^^^^^^^
1151+
1152+
.. class:: Notation
1153+
:no-typesetting:
1154+
1155+
:class:`Notation` represents a notation declared in the DTD.
1156+
It is a subclass of :class:`Node` and cannot have child nodes.
1157+
Notation nodes are contained in :attr:`DocumentType.notations`
1158+
and cannot be inserted into the document tree.
1159+
The name of the notation is its :attr:`~Node.nodeName`.
1160+
1161+
1162+
.. attribute:: Notation.publicId
1163+
1164+
The public identifier of the notation,
1165+
or ``None`` if it is not specified.
1166+
This is a read-only attribute.
1167+
1168+
1169+
.. attribute:: Notation.systemId
1170+
1171+
The system identifier of the notation,
1172+
or ``None`` if it is not specified.
1173+
This is a read-only attribute.
1174+
1175+
11021176
.. _dom-exceptions:
11031177

11041178
Exceptions

0 commit comments

Comments
 (0)