XmlNode Class Reference

Inheritance diagram for XmlNode:

Object Xml XmlElement XmlTextNode List of all members.

Public Member Functions

 __construct ($name=null, $value=null, $namespace=null)
 __killParent ($recursive=true)
 __tagOptions ($name, $option=null)
 __toString ()
 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 ()
 removeNamespace ($prefix)
 setParent (&$parent)
 toArray ($camelize=true)
 toString ($options=array(), $depth=0)

Public Attributes

 $__parent = null
 $attributes = array()
 $children = array()
 $name = null
 $namespace = null
 $namespaces = array()
 $value

Detailed Description

Definition at line 37 of file xml.php.


Constructor & Destructor Documentation

XmlNode::__construct ( name = null,
value = null,
namespace = null 
)

Constructor.

Parameters:
string $name Node name
array $attributes Node attributes
mixed $value Node contents (text)
array $children Node children

Definition at line 95 of file xml.php.

References $name, $namespace, $value, createTextNode(), name(), and normalize().


Member Function Documentation

XmlNode::__killParent ( recursive = true  ) 

Debug method. Deletes the parent. Also deletes this node's children, if given the $recursive parameter.

Parameters:
boolean $recursive Recursively delete elements. private

Definition at line 738 of file xml.php.

XmlNode::__tagOptions ( name,
option = null 
)

Gets the tag-specific options for the given node name

Parameters:
string $name XML tag name
string $option The specific option to query. Omit for all options
Returns:
mixed A specific option value if $option is specified, otherwise an array of all options private

Definition at line 295 of file xml.php.

References $name.

Referenced by normalize().

XmlNode::__toString (  ) 

Returns data from toString when this object is converted to a string.

Returns:
string String representation of this structure. private

Definition at line 728 of file xml.php.

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 121 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 383 of file xml.php.

References $attributes, a(), compare(), createNode(), 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 464 of file xml.php.

References $id, 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 489 of file xml.php.

References $name, and name().

Referenced by child(), first(), last(), and normalize().

XmlNode::cloneNode (  ) 

Returns a copy of self.

Returns:
object Cloned instance public

Definition at line 361 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 371 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 163 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 149 of file xml.php.

References $name, $namespace, and $value.

Referenced by Xml::__construct(), and append().

& 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 174 of file xml.php.

References $value.

Referenced by __construct().

& XmlNode::document (  ) 

Returns the XML document to which this node belongs

Returns:
object Parent XML object public

Definition at line 552 of file xml.php.

Referenced by Xml::__construct().

& XmlNode::first (  ) 

Returns first child node, or null if empty.

Returns:
object First XmlNode public

Definition at line 435 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 568 of file xml.php.

& XmlNode::last (  ) 

Returns last child node, or null if empty.

Returns:
object Last XmlNode public

Definition at line 449 of file xml.php.

References children().

XmlNode::name (  ) 

Returns the fully-qualified XML node name, with namespace

public

Definition at line 319 of file xml.php.

References XmlManager::getInstance(), and return.

Referenced by __construct(), child(), children(), and normalize().

& 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 505 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 186 of file xml.php.

References $attributes, $children, $name, $namespace, __tagOptions(), children(), createElement(), name(), slug(), and underscore().

Referenced by __construct(), and append().

& XmlNode::parent (  ) 

Returns parent node.

Returns:
object Parent XmlNode public

Reimplemented in Xml.

Definition at line 543 of file xml.php.

& 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 524 of file xml.php.

XmlNode::removeNamespace ( prefix  ) 

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 135 of file xml.php.

References Xml::removeGlobalNs().

XmlNode::setParent ( &$  parent  ) 

Sets the parent node of this XmlNode.

public

Definition at line 333 of file xml.php.

References compare().

XmlNode::toArray ( camelize = true  ) 

Return array representation of current object.

Parameters:
boolean $camelize true will camelize child nodes, false will not alter node names
Returns:
array Array representation public

Definition at line 663 of file xml.php.

References $out, camelize(), and name().

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 580 of file xml.php.

References name(), and Xml::options().


Member Data Documentation

XmlNode::$__parent = null

Definition at line 86 of file xml.php.

XmlNode::$attributes = array()

Definition at line 72 of file xml.php.

Referenced by XmlElement::__construct(), append(), createElement(), and normalize().

XmlNode::$children = array()

Definition at line 79 of file xml.php.

Referenced by normalize().

XmlNode::$name = null

Reimplemented in XmlTextNode.

Definition at line 44 of file xml.php.

Referenced by XmlElement::__construct(), __construct(), __tagOptions(), XmlElement::addAttribute(), children(), createElement(), createNode(), and normalize().

XmlNode::$namespace = null

Definition at line 51 of file xml.php.

Referenced by XmlElement::__construct(), __construct(), createElement(), createNode(), and normalize().

XmlNode::$namespaces = array()

Definition at line 58 of file xml.php.

XmlNode::$value

Reimplemented in XmlTextNode.

Definition at line 65 of file xml.php.

Referenced by XmlElement::__construct(), __construct(), createElement(), createNode(), and createTextNode().


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:57 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7