Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
XMLNode Class Reference

Public Member Functions

 addChild (&$node)
 
 getAttribute ($name)
 
 getAttributes ()
 
getChildByName ($name, $index=0)
 
getChildren ()
 
getChildValue ($name, $index=0)
 
 getName ($includeNamespace=true)
 
getParent ()
 
getValue ()
 
 setAttribute ($name, $value)
 
 setAttributes ($attributes)
 
 setName ($name)
 
 setParent (&$parent)
 
 setValue ($value)
 
toXml ($output=null)
 
 XMLNode ($name=null)
 

Public Attributes

 $attributes
 
 $children
 
 $name
 
 $parent
 
 $value
 

Detailed Description

Default handler for XMLParser returning a simple DOM-style object. This handler parses an XML document into a tree structure of XMLNode objects.

Definition at line 18 of file XMLNode.inc.php.

Member Function Documentation

XMLNode::addChild ( $node)
Parameters
$nodeXMLNode the child node to add

Definition at line 186 of file XMLNode.inc.php.

References getAttribute().

XMLNode::getAttribute (   $name)
Parameters
$namestring attribute name
Returns
string attribute value

Definition at line 106 of file XMLNode.inc.php.

References $attributes.

Referenced by addChild().

XMLNode::getAttributes ( )
Returns
array all attributes

Definition at line 98 of file XMLNode.inc.php.

& XMLNode::getChildByName (   $name,
  $index = 0 
)
Parameters
$name
$index
Returns
XMLNode the ($index+1)th child matching the specified name

Definition at line 151 of file XMLNode.inc.php.

& XMLNode::getChildren ( )
Returns
array this node's children (XMLNode objects)

Definition at line 142 of file XMLNode.inc.php.

& XMLNode::getChildValue (   $name,
  $index = 0 
)

Get the value of a child node.

Parameters
$nameString name of node
$indexOptional integer index of child node to find

Definition at line 173 of file XMLNode.inc.php.

XMLNode::getName (   $includeNamespace = true)
Parameters
$includeNamespaceboolean
Returns
string

Definition at line 66 of file XMLNode.inc.php.

& XMLNode::getParent ( )
Returns
XMLNode

Definition at line 84 of file XMLNode.inc.php.

& XMLNode::getValue ( )
Returns
string

Definition at line 128 of file XMLNode.inc.php.

XMLNode::setAttribute (   $name,
  $value 
)
Parameters
$namestring attribute name
valuestring attribute value

Definition at line 114 of file XMLNode.inc.php.

XMLNode::setAttributes (   $attributes)
Parameters
$attributesarray

Definition at line 121 of file XMLNode.inc.php.

XMLNode::setName (   $name)
Parameters
$namestring

Definition at line 77 of file XMLNode.inc.php.

XMLNode::setParent ( $parent)
Parameters
$parentXMLNode

Definition at line 91 of file XMLNode.inc.php.

References $name.

XMLNode::setValue (   $value)
Parameters
$valuestring

Definition at line 135 of file XMLNode.inc.php.

& XMLNode::toXml (   $output = null)
Parameters
$outputfile handle to write to, or true for stdout, or null if XML to be returned as string
Returns
string

Definition at line 194 of file XMLNode.inc.php.

References $name, and $value.

XMLNode::XMLNode (   $name = null)

Constructor.

Parameters
$nameelement/tag name

Definition at line 54 of file XMLNode.inc.php.

Member Data Documentation

array XMLNode::$attributes

the element's attributes

Definition at line 36 of file XMLNode.inc.php.

Referenced by getAttribute().

array XMLNode::$children

references to the XMLNode children of this node

Definition at line 48 of file XMLNode.inc.php.

string XMLNode::$name

the element (tag) name

Definition at line 24 of file XMLNode.inc.php.

Referenced by setParent(), and toXml().

XMLNode XMLNode::$parent

reference to the parent node (null if this is the root node)

Definition at line 30 of file XMLNode.inc.php.

string XMLNode::$value

the element's value

Definition at line 42 of file XMLNode.inc.php.

Referenced by toXml().


The documentation for this class was generated from the following file: