Open Journal Systems  3.3.0
XMLNode Class Reference

Public Member Functions

 __construct ($name=null)
 
 addChild (&$node)
 
 destroy ()
 
 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)
 

Static Public Member Functions

static xmlentities ($string, $quote_style=ENT_QUOTES)
 

Data Fields

 $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.

Constructor & Destructor Documentation

◆ __construct()

XMLNode::__construct (   $name = null)

Constructor.

Parameters
$nameelement/tag name

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

References $name.

Member Function Documentation

◆ addChild()

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

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

◆ destroy()

XMLNode::destroy ( )

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

◆ getAttribute()

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

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

References $name.

Referenced by toXml().

◆ getAttributes()

XMLNode::getAttributes ( )
Returns
array all attributes

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

References $attributes.

◆ getChildByName()

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

References $name.

Referenced by getChildValue().

◆ getChildren()

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

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

References $children.

◆ getChildValue()

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

References getChildByName().

◆ getName()

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

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

References $name.

◆ getParent()

& XMLNode::getParent ( )
Returns
XMLNode

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

References $parent.

◆ getValue()

& XMLNode::getValue ( )
Returns
string

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

References $value.

◆ setAttribute()

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

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

References $name, and $value.

◆ setAttributes()

XMLNode::setAttributes (   $attributes)
Parameters
$attributesarray

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

References $attributes.

◆ setName()

XMLNode::setName (   $name)
Parameters
$namestring

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

References $name.

◆ setParent()

XMLNode::setParent ( $parent)
Parameters
$parentXMLNode

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

References $parent.

◆ setValue()

XMLNode::setValue (   $value)
Parameters
$valuestring

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

References $value.

◆ toXml()

& 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, $value, getAttribute(), and xmlentities().

◆ xmlentities()

static XMLNode::xmlentities (   $string,
  $quote_style = ENT_QUOTES 
)
static

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

Referenced by MedraWebservice\_escapeXmlEntities(), and toXml().

Field Documentation

◆ $attributes

array XMLNode::$attributes

the element's attributes

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

Referenced by getAttributes(), and setAttributes().

◆ $children

array XMLNode::$children

references to the XMLNode children of this node

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

Referenced by getChildren().

◆ $name

string XMLNode::$name

the element (tag) name

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

Referenced by __construct(), getAttribute(), getChildByName(), getName(), setAttribute(), setName(), and toXml().

◆ $parent

XMLNode XMLNode::$parent

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

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

Referenced by getParent(), and setParent().

◆ $value

string XMLNode::$value

the element's value

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

Referenced by getValue(), setAttribute(), setValue(), and toXml().


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