PHP Класс Horde_Kolab_Format_Xml_Helper, horde

Copyright 2011-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Gunnar Wrobel ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_xmldoc DOMDocument The XML document this object works with.

Открытые методы

Метод Описание
__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.

Приватные методы

Метод Описание
_fetchFirstTextNode ( DOMNode $node ) : DOMNode | null Fetch the the first text node.

Описание методов

__construct() публичный Метод

Constructor
public __construct ( DOMDocument $xmldoc )
$xmldoc DOMDocument The XML document this object works with.

__toString() публичный Метод

Output the document as XML string.
public __toString ( ) : string
Результат string The XML output.

appendXml() публичный Метод

Append an XML snippet.
public appendXml ( DOMNode $parent_node, string $xml ) : DOMNode
$parent_node DOMNode Attach the XML below this parent.
$xml string The XML to append.
Результат DOMNode The new child node.

createNewNode() публичный Метод

Create a new node.
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.
Результат DOMNode The new child node.

createNodeValue() публичный Метод

Store a value as a new text 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.
Результат DOMNode The new child node.

fetchNodeValue() публичный Метод

Fetch the value of a node.
public fetchNodeValue ( DOMNode $node ) : string | null
$node DOMNode Retrieve the text value for this node.
Результат string | null The text value or null if no value was identified.

findNode() публичный Метод

Return a single named node matching the given XPath query.
public findNode ( string $query ) : DOMNode | false
$query string The query.
Результат DOMNode | false The named DOMNode or empty if no node was found.

findNodeRelativeTo() публичный Метод

Return a single named node below the given context matching the given XPath query.
public findNodeRelativeTo ( string $query, DOMNode $context ) : DOMNode | false
$query string The query.
$context DOMNode Search below this node.
Результат DOMNode | false The named DOMNode or empty if no node was found.

findNodes() публичный Метод

Return all nodes matching the given XPath query.
public findNodes ( string $query ) : DOMNodeList
$query string The query.
Результат DOMNodeList The list of DOMNodes.

findNodesRelativeTo() публичный Метод

Return all nodes matching the given XPath query.
public findNodesRelativeTo ( string $query, DOMNode $context ) : DOMNodeList
$query string The query.
$context DOMNode Search below this node.
Результат DOMNodeList The list of DOMNodes.

removeNodes() публичный Метод

Remove named nodes from a parent node.
public removeNodes ( DOMNode $parent_node, string $name ) : null
$parent_node DOMNode The parent node.
$name string The name of the children to be removed.
Результат null

replaceFirstNodeTextValue() публичный Метод

Store a value as a new text node.
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.
Результат null

storeNewNodeValue() публичный Метод

Store a value as a new text node.
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.
Результат DOMNode The new child node.

Описание свойств

$_xmldoc защищенное свойство

The XML document this object works with.
protected DOMDocument $_xmldoc
Результат DOMDocument