XmlNode Object

Object of a XML Tree Node

see \XmlTree

 Methods

Class Constructor

XmlNode(string $strNodeName, string $strNodeContent, array $arrNodeAttribs, $cdata) : void

Parameters

$strNodeName

string

XML Node Name

$strNodeContent

string

XML Node Content

$arrNodeAttribs

array

Attributes array('name'=>'value')

$cdata

Get indent string

_getIndent(int $level) : string

Parameters

$level

int

level

Returns

stringindent string

Builds a string from the attributes array

_parseAttributes(array $arrAttributes) : string

access private

Parameters

$arrAttributes

array

Attributes array('name'=>'value')

Returns

stringAttribute string

Short for appendChild method

add($strNodeName, $strNodeContent, $arrNodeAttribs, $cdata) 

see \appendChild

Parameters

$strNodeName

$strNodeContent

$arrNodeAttribs

$cdata

Add content to the node

addNodeContent(string $strNodeContent) : void

Parameters

$strNodeContent

string

Content

Add a child child node

appendChild(string $strNodeName, string $strNodeContent, array $arrNodeAttribs, bool $cdata) : object

Parameters

$strNodeName

string

XML Node Name

$strNodeContent

string

XML Node Content

$arrNodeAttribs

array

Attributes array('name'=>'value')

$cdata

bool

CDATA Section

Returns

objectReference to the new node object

Check if the node has childs

hasChilds() : boolean

Returns

boolean

Set the indent string

setIndent(int $string) : void

Parameters

$string

int

level

Set the node attributes

setNodeAttribs(array $arrNodeAttribs) : void

Parameters

$arrNodeAttribs

array

Node attributes array('name'=>'value')

Set node content

setNodeContent(string $strNodeContent) : void

Parameters

$strNodeContent

string

Node content

Set a node name

setNodeName(string $strNodeName) : void

Parameters

$strNodeName

string

Node name

Set the node parent

setNodeParent(object $objParent) : void

Parameters

$objParent

object

Reference to the parent object

Builds the XML string for the node using the node properties

toXml($indent) : string

access private

Parameters

$indent

Returns

stringXML String

 Properties

 

Node attributes

$_arrNodeAttribs : array

access private
 

Enclose node content in a cdata section

$_cdata : boolean

access private
 

Indenting character

$_indentChar : string

 

Child count

$_intChildCount : int

access private
 

Node content

$_strNodeContent : string

access private
 

Added content

$_strNodeContentAdded : string

access private
 

Node name

$_strNodeName : string

access private
 

XML for this node

$_strXml : string

access private
 

Childnodes

$childNodes : array

access private
 

Parent Node

$parentNode : object