Public Member Functions | |
Constructor method | |
| __construct () | |
| Create a new DOM document instance. | |
Property methods | |
These methods can used to get or set several properties of the document. | |
| get_document_type () | |
| Get the document type. | |
| set_document_type ($doctype) | |
| Set the document type. | |
| get_content_type () | |
| Get the content type. | |
| set_content_type ($content_type) | |
| Set the content type. | |
| get_encoding () | |
| Get the document encoding. | |
| set_encoding ($encoding) | |
| Set the document encoding. | |
| get_standalone () | |
| Get whether this document is standalone. | |
| set_standalone ($standalone) | |
| Set whether this document is standalone. | |
Node methods | |
These methods can be used to add new nodes to this document, or to create new nodes for this document. Note that you can also construct AnewtXMLDomNode subclasses directly. | |
| append_child ($root_element) | |
| Append a child element to this document. | |
| & | create_element ($tagname, $attributes=null) |
| Create a new element for this document. | |
| & | create_text_node ($data) |
| Create a text node for the given data. | |
| & | create_raw_node ($data) |
| Create a raw text node for the given data. | |
| & | create_comment ($data) |
| Create a comment node for the given data. | |
| & | create_document_fragment () |
| Create a document fragment node. | |
Rendering methods | |
| render () | |
| Render this document to a string. | |
| flush () | |
| Flush output to the browser. | |
| flush_to_file ($filename) | |
| Flush output to a file. | |
Public Attributes | |
| $node_type = ANEWT_XML_DOM_DOCUMENT_NODE | |
| The node type. | |
| $node_name = '#document' | |
| The name of this node, depending on its type. | |
| $document_element = null | |
| Reference to the document element. | |
Protected Attributes | |
| $render_xml_declaration = null | |
| Whether to render the XML declaration. | |
Private Member Functions | |
| xml_declaration () | |
| Return the XML declaration for this document. | |
Private Attributes | |
| $_xml_encoding = 'UTF-8' | |
| The character encoding for this document. | |
| $_xml_standalone = null | |
| Whether this document is specified to be standalone. | |
| $_xml_version = '1.0' | |
| The XML version for this document. | |
| $_content_type = 'text/xml' | |
| The content type for this document. | |
| $_doctype = null | |
| The document type declaration. | |
| $__object_id_counter = 0 | |
| Object id counter. | |
The Document interface represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data.
Definition at line 400 of file dom.lib.php.
| AnewtXMLDomDocument::get_document_type | ( | ) |
Get the document type.
null if none is set.Definition at line 488 of file dom.lib.php.
| AnewtXMLDomDocument::set_document_type | ( | $ | doctype | ) |
Set the document type.
| $doctype | The document type as string, or null to unset. |
Definition at line 501 of file dom.lib.php.
| AnewtXMLDomDocument::get_content_type | ( | ) |
Get the content type.
The default value is UTF-8.
Definition at line 515 of file dom.lib.php.
| AnewtXMLDomDocument::set_content_type | ( | $ | content_type | ) |
Set the content type.
| $content_type | The content type as string. |
Definition at line 528 of file dom.lib.php.
| AnewtXMLDomDocument::get_encoding | ( | ) |
Get the document encoding.
null if none is set.Definition at line 542 of file dom.lib.php.
| AnewtXMLDomDocument::set_encoding | ( | $ | encoding | ) |
Set the document encoding.
| $encoding | The encoding as string, or null to unset. |
Definition at line 555 of file dom.lib.php.
| AnewtXMLDomDocument::get_standalone | ( | ) |
Get whether this document is standalone.
This is a boolean value defaulting to null, which means no standalone attribute is added to the XML prolog.
null if not set.Definition at line 571 of file dom.lib.php.
| AnewtXMLDomDocument::set_standalone | ( | $ | standalone | ) |
Set whether this document is standalone.
| $standalone | Boolean or null to unset. |
Definition at line 584 of file dom.lib.php.
| AnewtXMLDomDocument::append_child | ( | $ | root_element | ) |
Append a child element to this document.
Documents can have only one child node (the document's root node), so this method can be called only once.
This method verrides the AnewtXMLDomNode::append_child() method to make sure there is only one top level element.
| $root_element | The root element to add. |
Reimplemented from AnewtXMLDomNode.
Definition at line 610 of file dom.lib.php.
| & AnewtXMLDomDocument::create_element | ( | $ | tagname, | |
| $ | attributes = null | |||
| ) |
Create a new element for this document.
You should add the returned instance to the document yourself.
| $tagname | The tag name for this element | |
| $attributes | Associative array with initial attribute values for this element (optional). This parameter is for convenience only; you can always set attributes later. |
Definition at line 638 of file dom.lib.php.
| & AnewtXMLDomDocument::create_text_node | ( | $ | data | ) |
Create a text node for the given data.
You should add the returned instance to the document yourself.
| $data | The textual data for this node. |
Definition at line 657 of file dom.lib.php.
| & AnewtXMLDomDocument::create_raw_node | ( | $ | data | ) |
Create a raw text node for the given data.
This is useful to add XML snippets generated by other means to a DOM tree.
You should add the returned instance to the document yourself.
| $data | The textual data for this node. |
Definition at line 679 of file dom.lib.php.
| & AnewtXMLDomDocument::create_comment | ( | $ | data | ) |
Create a comment node for the given data.
You should add the returned instance to the document yourself.
| $data | The comment text. |
Definition at line 698 of file dom.lib.php.
| & AnewtXMLDomDocument::create_document_fragment | ( | ) |
Create a document fragment node.
You should add the returned instance to the document yourself.
Definition at line 714 of file dom.lib.php.
| AnewtXMLDomDocument::render | ( | ) |
Render this document to a string.
Definition at line 734 of file dom.lib.php.
| AnewtXMLDomDocument::flush | ( | ) |
Flush output to the browser.
This serializes the document into a string and sends it to the browser with the specified content type.
Definition at line 770 of file dom.lib.php.
| AnewtXMLDomDocument::flush_to_file | ( | $ | filename | ) |
Flush output to a file.
This method renders the document and outputs it to the specified file.
| $filename | The filename to write the output to. |
Definition at line 791 of file dom.lib.php.
| AnewtXMLDomDocument::xml_declaration | ( | ) | [private] |
Return the XML declaration for this document.
Definition at line 810 of file dom.lib.php.
| AnewtXMLDomDocument::$node_type = ANEWT_XML_DOM_DOCUMENT_NODE |
| AnewtXMLDomDocument::$node_name = '#document' |
The name of this node, depending on its type.
Reimplemented from AnewtXMLDomNode.
Definition at line 403 of file dom.lib.php.
AnewtXMLDomDocument::$_xml_encoding = 'UTF-8' [private] |
The character encoding for this document.
Definition at line 411 of file dom.lib.php.
AnewtXMLDomDocument::$_xml_standalone = null [private] |
Whether this document is specified to be standalone.
Definition at line 419 of file dom.lib.php.
AnewtXMLDomDocument::$_xml_version = '1.0' [private] |
The XML version for this document.
This is always the literal value 1.0.
Definition at line 425 of file dom.lib.php.
AnewtXMLDomDocument::$_content_type = 'text/xml' [private] |
The content type for this document.
Defaults to text/xml.
Definition at line 438 of file dom.lib.php.
AnewtXMLDomDocument::$_doctype = null [private] |
AnewtXMLDomDocument::$__object_id_counter = 0 [private] |
AnewtXMLDomDocument::$render_xml_declaration = null [protected] |
Whether to render the XML declaration.
This is detected automatically by default.
Definition at line 456 of file dom.lib.php.
1.5.9