Class XML_doc

Simple class for extracting values from a XML document. Uses a simplified XPath syntax to access the elements. For example: 'root/person/name' would return the value of the 'name' node in 'root/person' node. You have to specify the root node name. Can't access node attributes yet.

 Methods

Class Construcor

XML_doc() 

_translateLiteral2NumericEntities()

_translateLiteral2NumericEntities($xmlSource, $reverse) 

Parameters

$xmlSource

$reverse

characterData()

characterData($parser, $data) 

Parameters

$parser

$data

endElement()

endElement($parser, $name) 

Parameters

$parser

$name

findLoosePath: Finds a path in the XML array which ends with the given keys

findLoosePath(\aCombination $aCombination, $aScope) : false

Parameters

$aCombination

\aCombination

array of keys to test for

$aScope

Returns

falseif nothing was found, or the array with the found keys

load()

load(string $filename) : boolean

Load the XML file

Parameters

$filename

string

XML document filename

Returns

booleantrue if the load was successful

parse()

parse($send) : array

Parse the xml file in an array

Parameters

$send

Returns

arrayparsearray

startElement()

startElement($parser, $name, $attrs) 

Parameters

$parser

$name

$attrs

valueOf()

valueOf($xpath) : String

Extract one node value from the XML document. Use simplified XPath syntax to specify the node. F.e. 'root/test/firstnode'

Parameters

$xpath

Returns

StringValue of XML node

 Properties

 

$encoding 
 

$errors : array
 

array

$itemname : \help
 

array

$parsearray : \parsed
 

$parser 
 

xml

$xml : string