XmlNode Class Reference

Public Member Functions | |
| addNamespace ($prefix, $url) | |
| & | append (&$child, $options=array()) |
| & | child ($id) |
| children ($name) | |
| cloneNode () | |
| compare ($node) | |
| & | createElement ($name=null, $value=null, $attributes=array(), $namespace=false) |
| & | createNode ($name=null, $value=null, $namespace=false) |
| & | createTextNode ($value=null) |
| & | document () |
| & | first () |
| hasChildren () | |
| & | last () |
| name () | |
| & | nextSibling () |
| normalize ($object, $keyName=null, $options=array()) | |
| & | parent () |
| & | previousSibling () |
| setParent (&$parent) | |
| toString ($options=array(), $depth=0) | |
Public Attributes | |
| $attributes = array() | |
| $children = array() | |
| $name = null | |
| $namespace = null | |
| $namespaces = array() | |
| $value | |
Detailed Description
Definition at line 41 of file xml.php.
Member Function Documentation
| XmlNode::addNamespace | ( | $ | prefix, | |
| $ | url | |||
| ) |
Adds a namespace to the current node
- Parameters:
-
string $prefix The namespace prefix string $url The namespace DTD URL
- Returns:
- void
Reimplemented in Xml.
Definition at line 125 of file xml.php.
References $url, and Xml::addGlobalNs().
Referenced by XmlElement::addAttribute().
| & XmlNode::append | ( | &$ | child, | |
| $ | options = array() | |||
| ) |
Append given node as a child.
- Parameters:
-
object $child XmlNode with appended child array $options XML generator options for objects and arrays
- Returns:
- object A reference to the appended child node public
Definition at line 372 of file xml.php.
References $attributes, a(), compare(), document(), Set::map(), and normalize().
| & XmlNode::child | ( | $ | id | ) |
Returns child node with given ID.
- Parameters:
-
string $id Name of child node
- Returns:
- object Child XmlNode public
Definition at line 449 of file xml.php.
References children(), and name().
| XmlNode::children | ( | $ | name | ) |
Gets a list of childnodes with the given tag name.
- Parameters:
-
string $name Tag name of child nodes
- Returns:
- array An array of XmlNodes with the given tag name public
Definition at line 474 of file xml.php.
References name().
Referenced by Xml::addNamespace(), child(), first(), hasChildren(), last(), normalize(), and toString().
| XmlNode::cloneNode | ( | ) |
| XmlNode::compare | ( | $ | node | ) |
| & XmlNode::createElement | ( | $ | name = null, |
|
| $ | value = null, |
|||
| $ | attributes = array(), |
|||
| $ | namespace = false | |||
| ) |
Creates an XmlElement object that can be appended to this document or a node in it
- Parameters:
-
string $name Element name string $value Element value array $attributes Element attributes string $namespace Node namespace
- Returns:
- object XmlElement
Definition at line 155 of file xml.php.
References $attributes, $name, $namespace, and $value.
Referenced by normalize().
| & XmlNode::createNode | ( | $ | name = null, |
|
| $ | value = null, |
|||
| $ | namespace = false | |||
| ) |
| & XmlNode::createTextNode | ( | $ | value = null |
) |
Creates an XmlTextNode object that can be appended to this document or a node in it
- Parameters:
-
string $value Node value
- Returns:
- object XmlTextNode
Definition at line 166 of file xml.php.
References $value.
| & XmlNode::document | ( | ) |
Returns the XML document to which this node belongs
- Returns:
- object Parent XML object public
Definition at line 533 of file xml.php.
Referenced by append(), normalize(), and toString().
| & XmlNode::first | ( | ) |
Returns first child node, or null if empty.
- Returns:
- object First XmlNode public
Definition at line 422 of file xml.php.
References children().
| XmlNode::hasChildren | ( | ) |
Returns true if this structure has child nodes.
- Returns:
- bool public
Reimplemented in XmlTextNode.
Definition at line 549 of file xml.php.
References children().
Referenced by toString().
| & XmlNode::last | ( | ) |
Returns last child node, or null if empty.
- Returns:
- object Last XmlNode public
Definition at line 435 of file xml.php.
References children().
| XmlNode::name | ( | ) |
Returns the fully-qualified XML node name, with namespace
public
Definition at line 308 of file xml.php.
References XmlManager::getInstance().
Referenced by child(), children(), normalize(), and toString().
| & XmlNode::nextSibling | ( | ) |
| XmlNode::normalize | ( | $ | object, | |
| $ | keyName = null, |
|||
| $ | options = array() | |||
| ) |
Gets the XML element properties from an object.
- Parameters:
-
object $object Object to get properties from
- Returns:
- array Properties from object public
Definition at line 178 of file xml.php.
References $attributes, $children, $name, $namespace, children(), createElement(), document(), name(), Inflector::slug(), and Inflector::underscore().
Referenced by append().
| & XmlNode::parent | ( | ) |
Returns parent node.
- Returns:
- object Parent XmlNode public
Reimplemented in Xml.
Definition at line 524 of file xml.php.
Referenced by toString().
| & XmlNode::previousSibling | ( | ) |
| XmlNode::setParent | ( | &$ | parent | ) |
| XmlNode::toString | ( | $ | options = array(), |
|
| $ | depth = 0 | |||
| ) |
Returns this XML structure as a string.
- Returns:
- string String representation of the XML structure. public
Reimplemented in XmlTextNode.
Definition at line 561 of file xml.php.
References children(), document(), hasChildren(), name(), Xml::options(), and parent().
Member Data Documentation
| XmlNode::$attributes = array() |
| XmlNode::$children = array() |
| XmlNode::$name = null |
Reimplemented in XmlTextNode.
Definition at line 48 of file xml.php.
Referenced by createElement(), createNode(), and normalize().
| XmlNode::$namespace = null |
Definition at line 55 of file xml.php.
Referenced by createElement(), createNode(), and normalize().
| XmlNode::$value |
Reimplemented in XmlTextNode.
Definition at line 69 of file xml.php.
Referenced by createElement(), createNode(), and createTextNode().
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/libs/xml.php