XmlNode Class Reference

Inheritance diagram for XmlNode:

Object Xml XmlElement XmlTextNode

List of all members.


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 (  ) 

Returns a copy of self.

Returns:
object Cloned instance public

Definition at line 350 of file xml.php.

XmlNode::compare ( node  ) 

Compares $node to this XmlNode object

Parameters:
object An XmlNode or subclass instance
Returns:
boolean True if the nodes match, false otherwise public

Definition at line 360 of file xml.php.

Referenced by append(), and setParent().

& 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 
)

Creates an XmlNode object that can be appended to this document or a node in it

Parameters:
string $name Node name
string $value Node value
string $namespace Node namespace
Returns:
object XmlNode

Definition at line 141 of file xml.php.

References $name, $namespace, and $value.

& 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 (  ) 

Gets a reference to the next child node in the list of this node's parent.

Returns:
object A reference to the XmlNode object public

Definition at line 490 of file xml.php.

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 (  ) 

Gets a reference to the previous child node in the list of this node's parent.

Returns:
object A reference to the XmlNode object public

Definition at line 507 of file xml.php.

XmlNode::setParent ( &$  parent  ) 

Sets the parent node of this XmlNode.

public

Definition at line 322 of file xml.php.

References compare().

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()

Definition at line 76 of file xml.php.

Referenced by append(), createElement(), and normalize().

XmlNode::$children = array()

Definition at line 83 of file xml.php.

Referenced by normalize().

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::$namespaces = array()

Definition at line 62 of file xml.php.

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: