BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
DOMDocument Class Reference
Inheritance diagram for DOMDocument:
Collaboration diagram for DOMDocument:

Public Member Functions

 createElement ($name, $value=null)
 
 createDocumentFragment ()
 
 createTextNode ($content)
 
 createComment ($data)
 
 createCDATASection ($data)
 
 createProcessingInstruction ($target, $data=null)
 
 createAttribute ($name)
 
 createEntityReference ($name)
 
 getElementsByTagName ($name)
 
 importNode (DOMNode $importedNode, $deep=null)
 
 createElementNS ($namespaceURI, $qualifiedName, $value=null)
 
 createAttributeNS ($namespaceURI, $qualifiedName)
 
 getElementsByTagNameNS ($namespaceURI, $localName)
 
 getElementById ($elementId)
 
 adoptNode (DOMNode $source)
 
 normalizeDocument ()
 
 renameNode (DOMNode $node, $namespaceURI, $qualifiedName)
 
 load ($filename, $options=null)
 
 save ($filename, $options=null)
 
 loadXML ($source, $options=null)
 
 saveXML ($node=null, $options=null)
 
 __construct ($version, $encoding)
 
 validate ()
 
 xinclude ($options=null)
 
 loadHTML ($source, $options=0)
 
 loadHTMLFile ($filename, $options=0)
 
 saveHTML (DOMNode $node=NULL)
 
 saveHTMLFile ($filename)
 
 schemaValidate ($filename, $options=null)
 
 schemaValidateSource ($source, $flags)
 
 relaxNGValidate ($filename)
 
 relaxNGValidateSource ($source)
 
 registerNodeClass ($baseclass, $extendedclass)
 
- Public Member Functions inherited from DOMNode
 insertBefore (DOMNode $newnode, DOMNode $refnode=null)
 
 replaceChild (DOMNode $newnode, DOMNode $oldnode)
 
 removeChild (DOMNode $oldnode)
 
 appendChild (DOMNode $newnode)
 
 hasChildNodes ()
 
 cloneNode ($deep=null)
 
 normalize ()
 
 isSupported ($feature, $version)
 
 hasAttributes ()
 
 compareDocumentPosition (DOMNode $other)
 
 isSameNode (DOMNode $node)
 
 lookupPrefix ($namespaceURI)
 
 isDefaultNamespace ($namespaceURI)
 
 lookupNamespaceUri ($prefix)
 
 isEqualNode (DOMNode $arg)
 
 getFeature ($feature, $version)
 
 setUserData ($key, $data, $handler)
 
 getUserData ($key)
 
 getNodePath ()
 
 getLineNo ()
 
 C14N ($exclusive, $with_comments, array $xpath=null, $ns_prefixes=null)
 
 C14NFile ($uri, $exclusive, array $with_comments, array $xpath=null, $ns_prefixes=null)
 

Public Attributes

 $actualEncoding
 
 $config
 
 $doctype
 
 $documentElement
 
 $documentURI
 
 $encoding
 
 $formatOutput
 
 $implementation
 
 $preserveWhiteSpace = true
 
 $recover
 
 $resolveExternals
 
 $standalone
 
 $strictErrorChecking = true
 
 $substituteEntities
 
 $validateOnParse = false
 
 $version
 
 $xmlEncoding
 
 $xmlStandalone
 
 $xmlVersion
 
- Public Attributes inherited from DOMNode
 $nodeName
 
 $nodeValue
 
 $nodeType
 
 $parentNode
 
 $childNodes
 
 $firstChild
 
 $lastChild
 
 $previousSibling
 
 $nextSibling
 
 $attributes
 
 $ownerDocument
 
 $namespaceURI
 
 $prefix
 
 $localName
 
 $baseURI
 
 $textContent
 

Detailed Description

The DOMDocument class represents an entire HTML or XML document; serves as the root of the document tree. http://php.net/manual/class.domdocument.php

Constructor & Destructor Documentation

Member Function Documentation

DOMDocument::adoptNode ( DOMNode  $source)
Parameters
DOMNode$source
DOMDocument::createAttribute (   $name)

Create new attribute string $name The name of the attribute.

Returns
DOMAttr The new DOMAttr or false if an error occured.
Since
5.0
DOMDocument::createAttributeNS (   $namespaceURI,
  $qualifiedName 
)

Create new attribute node with an associated namespace string $namespaceURI The URI of the namespace.

Parameters
string$qualifiedName

The tag name and prefix of the attribute, as prefix:tagname.

Returns
DOMAttr The new DOMAttr or false if an error occured.
Since
5.0
DOMDocument::createCDATASection (   $data)

Create new cdata node string $data The content of the cdata.

Returns
DOMCDATASection The new DOMCDATASection or false if an error occured.
Since
5.0
DOMDocument::createComment (   $data)

Create new comment node string $data The content of the comment.

Returns
DOMComment The new DOMComment or false if an error occured.
Since
5.0
DOMDocument::createDocumentFragment ( )
DOMDocument::createElement (   $name,
  $value = null 
)

Create new element node string $name The tag name of the element.

Parameters
string$value[optional]

The value of the element. By default, an empty element will be created. You can also set the value later with DOMElement->nodeValue.

Returns
DOMElement a new instance of class DOMElement or false if an error occured.
Since
5.0
DOMDocument::createElementNS (   $namespaceURI,
  $qualifiedName,
  $value = null 
)

Create new element node with an associated namespace string $namespaceURI The URI of the namespace.

Parameters
string$qualifiedName

The qualified name of the element, as prefix:tagname.

Parameters
string$value[optional]

The value of the element. By default, an empty element will be created. You can also set the value later with DOMElement->nodeValue.

Returns
DOMElement The new DOMElement or false if an error occured.
Since
5.0
DOMDocument::createEntityReference (   $name)

Create new entity reference node string $name The content of the entity reference, e.g. the entity reference minus the leading & and the trailing ; characters.

Returns
DOMEntityReference The new DOMEntityReference or false if an error occured.
Since
5.0
DOMDocument::createProcessingInstruction (   $target,
  $data = null 
)

Creates new PI node string $target The target of the processing instruction.

Parameters
string$data[optional]

The content of the processing instruction.

Returns
DOMProcessingInstruction The new DOMProcessingInstruction or false if an error occured.
Since
5.0
DOMDocument::createTextNode (   $content)

Create new text node string $content The content of the text.

Returns
DOMText The new DOMText or false if an error occured.
Since
5.0
DOMDocument::getElementById (   $elementId)

Searches for an element with a certain id string $elementId The unique id value for an element.

Returns
DOMElement the DOMElement or if the element is not found.
Since
5.0
DOMDocument::getElementsByTagName (   $name)

Searches for all elements with given tag name string $name The name of the tag to match on. The special value * matches all tags.

Returns
DOMNodeList A new DOMNodeList object containing all the matched elements.
Since
5.0
DOMDocument::getElementsByTagNameNS (   $namespaceURI,
  $localName 
)

Searches for all elements with given tag name in specified namespace string $namespaceURI The namespace URI of the elements to match on. The special value * matches all namespaces.

Parameters
string$localName

The local name of the elements to match on. The special value * matches all local names.

Returns
DOMNodeList A new DOMNodeList object containing all the matched elements.
Since
5.0
DOMDocument::importNode ( DOMNode  $importedNode,
  $deep = null 
)

Import node into current document DOMNode $importedNode The node to import.

Parameters
bool$deep[optional]

If set to true, this method will recursively import the subtree under the importedNode.

To copy the nodes attributes deep needs to be set to true

Returns
DOMNode The copied node or false, if it cannot be copied.
Since
5.0
DOMDocument::load (   $filename,
  $options = null 
)

Load XML from a file string $filename The path to the XML document.

Parameters
int$options[optional]

Bitwise OR of the libxml option constants.

Returns
mixed true on success or false on failure. If called statically, returns a DOMDocument and issues E_STRICT warning.
Since
5.0
DOMDocument::loadHTML (   $source,
  $options = 0 
)

Load HTML from a string string $source The HTML string.

Parameters
string$options[optional]

Since PHP 5.4.0 and Libxml 2.6.0, you may also use the options parameter to specify additional Libxml parameters.

Returns
bool true on success or false on failure. If called statically, returns a DOMDocument and issues E_STRICT warning.
Since
5.0
DOMDocument::loadHTMLFile (   $filename,
  $options = 0 
)

Load HTML from a file string $filename The path to the HTML file.

Parameters
string$options[optional]

Since PHP 5.4.0 and Libxml 2.6.0, you may also use the options parameter to specify additional Libxml parameters.

Returns
bool true on success or false on failure. If called statically, returns a DOMDocument and issues E_STRICT warning.
Since
5.0
DOMDocument::loadXML (   $source,
  $options = null 
)

Load XML from a string string $source The string containing the XML.

Parameters
int$options[optional]

Bitwise OR of the libxml option constants.

Returns
mixed true on success or false on failure. If called statically, returns a DOMDocument and issues E_STRICT warning.
Since
5.0
DOMDocument::normalizeDocument ( )

Normalizes the document void 5.0

DOMDocument::registerNodeClass (   $baseclass,
  $extendedclass 
)

Register extended class used to create base node type string $baseclass The DOM class that you want to extend. You can find a list of these classes in the chapter introduction.

Parameters
string$extendedclass

Your extended class name. If is provided, any previously registered class extending baseclass will be removed.

Returns
bool true on success or false on failure.
Since
5.2.0
DOMDocument::relaxNGValidate (   $filename)

Performs relaxNG validation on the document string $filename The RNG file.

Returns
bool true on success or false on failure.
Since
5.0
DOMDocument::relaxNGValidateSource (   $source)

Performs relaxNG validation on the document string $source A string containing the RNG schema.

Returns
bool true on success or false on failure.
Since
5.0
DOMDocument::renameNode ( DOMNode  $node,
  $namespaceURI,
  $qualifiedName 
)
Parameters
DOMNode$node
$namespaceURI
$qualifiedName
DOMDocument::save (   $filename,
  $options = null 
)

Dumps the internal XML tree back into a file string $filename The path to the saved XML document.

Parameters
int$options[optional]

Additional Options. Currently only LIBXML_NOEMPTYTAG is supported.

Returns
int the number of bytes written or false if an error occurred.
Since
5.0
DOMDocument::saveHTML ( DOMNode  $node = NULL)
DOMDocument::saveHTMLFile (   $filename)

Dumps the internal document into a file using HTML formatting string $filename The path to the saved HTML document.

Returns
int the number of bytes written or false if an error occurred.
Since
5.0
DOMDocument::saveXML (   $node = null,
  $options = null 
)

Dumps the internal XML tree back into a string DOMNode $node [optional] Use this parameter to output only a specific node without XML declaration rather than the entire document.

Parameters
int$options[optional]

Additional Options. Currently only LIBXML_NOEMPTYTAG is supported.

Returns
string the XML, or false if an error occurred.
Since
5.0
DOMDocument::schemaValidate (   $filename,
  $options = null 
)

Validates a document based on a schema string $filename The path to the schema.

Parameters
int$options[optional]

Bitwise OR of the libxml option constants.

Returns
bool true on success or false on failure.
Since
5.0
DOMDocument::schemaValidateSource (   $source,
  $flags 
)

Validates a document based on a schema string $source A string containing the schema.

Parameters
int$flags[optional]

A bitmask of Libxml schema validation flags. Currently the only supported value is LIBXML_SCHEMA_CREATE. Available since PHP 5.5.2 and Libxml 2.6.14.

Returns
bool true on success or false on failure.
Since
5.0
DOMDocument::xinclude (   $options = null)

Substitutes XIncludes in a DOMDocument Object int $options [optional] libxml parameters. Available since PHP 5.1.0 and Libxml 2.6.7.

Returns
int the number of XIncludes in the document.
Since
5.0

The documentation for this class was generated from the following file: