xml.Document

A Document object represents an XML document information item.

class xml.Document

Attributes

xml.Document.base_URI

The base URI of the document entity.

xml.Document.character_encoding_scheme

The name of the character encoding scheme in which the document entity is expressed.

xml.Document.children

An ordered list of child information items, in document order. The list contains exactly one element information item. The list also contains one processing instruction information item for each processing instruction outside the document element, and one comment information item for each comment outside the document element. Processing instructions and comments within the DTD are excluded. If there is a document type declaration, the list also contains a document type declaration information item.

xml.Document.document_element

The element information item corresponding to the document element.

xml.Document.notations

An unordered set of notation information items, one for each notation declared in the DTD.

xml.Document.standalone

An indication of the standalone status of the document, either True or False. This attribute is derived from the optional standalone document declaration in the XML declaration at the beginning of the document entity, and returns None if there is no standalone document declaration.

xml.Document.unparsed_entities

An unordered set of unparsed entity information items, one for each unparsed entity declared in the DTD.

xml.Document.version

A string representing the XML version of the document. This attribute is derived from the XML declaration optionally present at the beginning of the document entity, and is None if there is no XML declaration.

Special methods

__bool__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__