Property | Type | Description | |
---|---|---|---|
$_xmldoc | DOMDocument | The XML document this object works with. |
Method | Description | |
---|---|---|
__construct ( DOMDocument $xmldoc ) | Constructor | |
__toString ( ) : string | Output the document as XML string. | |
appendXml ( DOMNode $parent_node, string $xml ) : DOMNode | Append an XML snippet. | |
createNewNode ( DOMNode $parent_node, string $name ) : DOMNode | Create a new node. | |
createNodeValue ( DOMNode $parent_node, string $name, string $value ) : DOMNode | Store a value as a new text node. | |
fetchNodeValue ( DOMNode $node ) : string | null | Fetch the value of a node. | |
findNode ( string $query ) : DOMNode | false | Return a single named node matching the given XPath query. | |
findNodeRelativeTo ( string $query, DOMNode $context ) : DOMNode | false | Return a single named node below the given context matching the given XPath query. | |
findNodes ( string $query ) : DOMNodeList | Return all nodes matching the given XPath query. | |
findNodesRelativeTo ( string $query, DOMNode $context ) : DOMNodeList | Return all nodes matching the given XPath query. | |
removeNodes ( DOMNode $parent_node, string $name ) : null | Remove named nodes from a parent node. | |
replaceFirstNodeTextValue ( DOMNode $node, string $value ) : null | Store a value as a new text node. | |
storeNewNodeValue ( DOMNode $parent_node, string $name, string $value ) : DOMNode | Store a value as a new text node. |
Method | Description | |
---|---|---|
_fetchFirstTextNode ( DOMNode $node ) : DOMNode | null | Fetch the the first text node. |
public __construct ( DOMDocument $xmldoc ) | ||
$xmldoc | DOMDocument | The XML document this object works with. |
public __toString ( ) : string | ||
return | string | The XML output. |
public createNewNode ( DOMNode $parent_node, string $name ) : DOMNode | ||
$parent_node | DOMNode | Attach the new node to this parent. |
$name | string | Name of the new child node. |
return | DOMNode | The new child node. |
public createNodeValue ( DOMNode $parent_node, string $name, string $value ) : DOMNode | ||
$parent_node | DOMNode | Attach the new node to this parent. |
$name | string | Name of the new child node. |
$value | string | Text value of the new child node. |
return | DOMNode | The new child node. |
public fetchNodeValue ( DOMNode $node ) : string | null | ||
$node | DOMNode | Retrieve the text value for this node. |
return | string | null | The text value or null if no value was identified. |
public findNodeRelativeTo ( string $query, DOMNode $context ) : DOMNode | false | ||
$query | string | The query. |
$context | DOMNode | Search below this node. |
return | DOMNode | false | The named DOMNode or empty if no node was found. |
public findNodesRelativeTo ( string $query, DOMNode $context ) : DOMNodeList | ||
$query | string | The query. |
$context | DOMNode | Search below this node. |
return | DOMNodeList | The list of DOMNodes. |
public removeNodes ( DOMNode $parent_node, string $name ) : null | ||
$parent_node | DOMNode | The parent node. |
$name | string | The name of the children to be removed. |
return | null |
public replaceFirstNodeTextValue ( DOMNode $node, string $value ) : null | ||
$node | DOMNode | Replace the text value of this node. |
$value | string | Text value of the new child node. |
return | null |
public storeNewNodeValue ( DOMNode $parent_node, string $name, string $value ) : DOMNode | ||
$parent_node | DOMNode | Attach the new node to this parent. |
$name | string | Name of the new child node. |
$value | string | Text value of the new child node. |
return | DOMNode | The new child node. |