XML_doc()
_translateLiteral2NumericEntities()
characterData()
endElement()
findLoosePath()
load()
parse()
startElement()
valueOf()
$encoding
$errors
$itemname
$parsearray
$parser
$xml
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.
XML_doc()
_translateLiteral2NumericEntities(string $xmlSource, bool $reverse) : \The
PHP's XML parser (in V 4.1.0) has problems with entities! The only one's that are recognized are &, < > and ". ALL others (like © a.s.o.) cause an XML_ERROR_UNDEFINED_ENTITY error. I reported this as bug at http://bugs.php.net/bug.php?id=15092 The work around is to translate the entities found in the XML source to their numeric equivalent E.g. to / © to © a.s.o.
NOTE: Entities &, < > and " are left 'as is'
author | Sam Blum bs_php@users.sourceforge.net |
---|
string
The XML string
bool
(default=FALSE) Translate numeric entities to literal entities.
\The
XML string with translated entities.characterData($parser, $data)
endElement($parser, $name)
findLoosePath(\aCombination $aCombination, $aScope) : false
\aCombination
array of keys to test for
false
if nothing was found, or the array with the found keysload(string $filename) : boolean
Load the XML file
string
XML document filename
boolean
true if the load was successfulparse($send) : array
Parse the xml file in an array
array
parsearraystartElement($parser, $name, $attrs)
valueOf($xpath) : String
Extract one node value from the XML document. Use simplified XPath syntax to specify the node. F.e. 'root/test/firstnode'
String
Value of XML node$encoding
$errors : array
$itemname : \help
$parsearray : \parsed
$parser
$xml : string