The Dom\XMLDocument class

Introduction

Represents an XML document.

Class synopsis

final Dom\XMLDocument
extends Dom\Document
/* Inherited constants */
public const int Dom\Node::DOCUMENT_POSITION_DISCONNECTED = 0x1;
public const int Dom\Node::DOCUMENT_POSITION_PRECEDING = 0x2;
public const int Dom\Node::DOCUMENT_POSITION_FOLLOWING = 0x4;
public const int Dom\Node::DOCUMENT_POSITION_CONTAINS = 0x8;
public const int Dom\Node::DOCUMENT_POSITION_CONTAINED_BY = 0x10;
public const int Dom\Node::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
/* Properties */
public readonly string $xmlEncoding;
public bool $xmlStandalone;
public string $xmlVersion;
public bool $formatOutput;
/* Inherited properties */
public readonly Dom\Implementation $implementation;
public string $URL;
public string $documentURI;
public string $characterSet;
public string $charset;
public string $inputEncoding;
public readonly Dom\DocumentTypenull $doctype;
public readonly Dom\Elementnull $documentElement;
public readonly Dom\Elementnull $firstElementChild;
public readonly Dom\Elementnull $lastElementChild;
public readonly int $childElementCount;
public Dom\HTMLElementnull $body;
public readonly Dom\HTMLElementnull $head;
public string $title;
public readonly int $nodeType;
public readonly string $nodeName;
public readonly string $baseURI;
public readonly bool $isConnected;
public readonly Dom\Documentnull $ownerDocument;
public readonly Dom\Nodenull $parentNode;
public readonly Dom\Elementnull $parentElement;
public readonly Dom\NodeList $childNodes;
public readonly Dom\Nodenull $firstChild;
public readonly Dom\Nodenull $lastChild;
public readonly Dom\Nodenull $previousSibling;
public readonly Dom\Nodenull $nextSibling;
public stringnull $nodeValue;
public stringnull $textContent;
/* Methods */
/* Not documented yet */
/* Inherited methods */
/* Not documented yet */

Properties

Note: While the DOMDocument class allows setting certain properties to influence parser behaviour, this class only uses the LIBXML_* constants to configure the parser.

xmlEncoding

An attribute specifying, as part of the XML declaration, the encoding of this document. This is null when unspecified or when it is not known, such as when the Document was created in memory.

xmlStandalone

An attribute specifying, as part of the XML declaration, whether this document is standalone. This is false when unspecified. A standalone document is one where there are no external markup declarations. An example of such a markup declaration is when the DTD declares an attribute with a default value.

xmlVersion

An attribute specifying, as part of the XML declaration, the version number of this document. If there is no declaration and if this document supports the "XML" feature, the value is "1.0".

formatOutput
Nicely formats output with indentation and extra space.

Notes

Note: The DOM extension uses UTF-8 encoding when working with methods or properties. The parser methods auto-detect the encoding or allow the caller to specify an encoding.