Project: CONTENIDO Content Management System
Description: The XML reader class of CONTENIDO.
Description:
The base XML class of CONTENIDO.
Methods
XML_doc()
XML_doc()
deprecated |
2011-03-03 Use cXmlReader instead. |
_translateLiteral2NumericEntities()
_translateLiteral2NumericEntities($xmlSource, $reverse)
deprecated |
2011-03-03 This function is not longer supported. |
Parameters
$xmlSource
$reverse
Converts an array to a SimpleXMLElement.
arrayToXml(array $array, \SimpleXMLElement $xml, string $rootTagName) : \SimpleXMLElement
InheritedStatic
Example:
array(
'key1' => 'value1',
'key2' => array('value21', 'value22'),
'key3' => array('key31' => 'value31', 'key32' => 'value32')
);
becomes
/**
Converts an array to a SimpleXMLElement.
Example:
array(
'key1' => 'value1',
'key2' => array('value21', 'value22'),
'key3' => array('key31' => 'value31', 'key32' => 'value32')
);
becomes
value1
value21
value22
value31
value32
inherited_from |
\cXmlBase::arrayToXml() |
inherited_from |
\cXmlReader::arrayToXml() |
Parameters
$array
array
the array which should be converted to XML
$rootTagName
string
[optional] the root tag name which should be
used - is only used when $xml is null!
Returns
characterData()
characterData($parser, $data)
deprecated |
2011-03-03 This function is not longer supported. |
Parameters
$parser
$data
Returns the amount of nodes in a given XPath string.
countXpathNodes(string $path) : integer
Inherited
inherited_from |
\cXmlReader::countXpathNodes() |
Parameters
Returns
integer
amount of nodes in node list
Returns the DOMDocument object.
getDomDocument() : \DOMDocument
Inherited
inherited_from |
\cXmlBase::getDomDocument() |
inherited_from |
\cXmlReader::getDomDocument() |
Returns
Returns the encoding of the XML document.
getEncoding() : string
Inherited
inherited_from |
\cXmlBase::getEncoding() |
inherited_from |
\cXmlReader::getEncoding() |
Exceptions
Returns
string
encoding
Returns given XPath with integrad level definition.
getLevelXpath(string $path, integer $level) : string
InheritedStatic
static |
|
inherited_from |
\cXmlBase::getLevelXpath() |
inherited_from |
\cXmlReader::getLevelXpath() |
Parameters
$path
string
XPath to extend
Returns
string
extended XPath
Returns the element of an DOMNodeList read out by a xpath string.
getXpathNode(string $path, integer $nodeKey) : \DOMNode
Inherited
inherited_from |
\cXmlReader::getXpathNode() |
Parameters
$nodeKey
integer
node key (optional, default: 0)
Returns
Returns a DOMNodeList for a given XPath expression.
getXpathNodeList(string $path) : \DOMNodeList
Inherited
inherited_from |
\cXmlReader::getXpathNodeList() |
Parameters
Exceptions
Returns
Returns the value of an DOMNode read out by a xpath string.
getXpathValue(string $path, integer $nodeKey) : string
Inherited
inherited_from |
\cXmlReader::getXpathValue() |
Parameters
$nodeKey
integer
node key (optional, default: 0)
Returns
string
value of DOMNode
Loads a XML document from file and initializes a corresponding DOMXPath
instance.
load($sFile) : boolean
deprecated |
2011-03-03 Use cXmlReader instead. |
Parameters
$sFile
Exceptions
Returns
boolean
load state (true = successfully loaded, false = not found
or loaded)
Loads a XML document from file and initializes a corresponding DOMXPath
instance.
loadXML($sXml) : boolean
Inherited
inherited_from |
\cXmlReader::loadXML() |
Parameters
$sXml
Exceptions
Returns
boolean
load state (true = successfully loaded, false = not found
or loaded)
registerXpathNamespace()
registerXpathNamespace(string $name, string $value)
Inherited
inherited_from |
\cXmlBase::registerXpathNamespace() |
inherited_from |
\cXmlReader::registerXpathNamespace() |
Parameters
$name
string
$value
string
Resolves a given path which contains ".
resolvePath(string $path) : string
InheritedStatic
." statement for moving up one
level in path.
static |
|
inherited_from |
\cXmlBase::resolvePath() |
inherited_from |
\cXmlReader::resolvePath() |
Parameters
$path
string
path to resolve
Returns
string
resolved path
Sets a current DOMDocument object to class.
setDomDocument(\DOMDocument $domDocument) : void
Inherited
inherited_from |
\cXmlBase::setDomDocument() |
inherited_from |
\cXmlReader::setDomDocument() |
Parameters
valueOf()
valueOf($xpath)
deprecated |
2011-03-03 Use cXmlReader instead. |
Parameters
$xpath
Converts the given XML string to an array.
xmlStringToArray(string $xmlString)
InheritedStatic
Example:
value1
value21
value22
value31
value32
becomes
array(
'key1' => 'value1',
'key2' => array('value21', 'value22'),
'key3' => array('key31' => 'value31', 'key32' => 'value32')
);
inherited_from |
\cXmlBase::xmlStringToArray() |
inherited_from |
\cXmlReader::xmlStringToArray() |
Parameters
$xmlString
string
contains a valid XML structure
Converts the given SimpleXMLElement object to an array.
xmlToArray(\SimpleXMLElement $xml)
InheritedStatic
Example:
value1
value21
value22
value31
value32
becomes
array(
'key1' => 'value1',
'key2' => array('value21', 'value22'),
'key3' => array('key31' => 'value31', 'key32' => 'value32')
);
inherited_from |
\cXmlBase::xmlToArray() |
inherited_from |
\cXmlReader::xmlToArray() |
Parameters
Creates a new XML document using DOMDocument.
_createDocument(string $version, string $encoding) : void
Inherited
access |
protected |
inherited_from |
\cXmlBase::_createDocument() |
inherited_from |
\cXmlReader::_createDocument() |
Parameters
$version
string
version of DOMDocument (optional, default: 1.0)
$encoding
string
encoding of DOMDocumen (optional, default: UTF-8)
Decodes the value if XML document has not UTF-8 encoding.
_decode(string $value) : string
Inherited
inherited_from |
\cXmlReader::_decode() |
Parameters
$value
string
value to decode
Returns
string
decoded value
Initializes a new DOMXPath instance for DOMDocument.
_initXpathInstance() : void
Inherited
inherited_from |
\cXmlBase::_initXpathInstance() |
inherited_from |
\cXmlReader::_initXpathInstance() |
Exceptions
Cleans an array by replacing all empty arrays with empty strings.
_cleanArray(array $array) : array
InheritedStatic
Additionally, the function replaces all associative arrays which have
only empty values with the array keys of the array.
inherited_from |
\cXmlBase::_cleanArray() |
inherited_from |
\cXmlReader::_cleanArray() |
Parameters
$array
array
the array to clean
Returns
array
the cleaned array
Properties
$_dom
Inherited
inherited_from |
\cXmlBase::$$_dom |
inherited_from |
\cXmlReader::$$_dom |
$_xpath
Inherited
inherited_from |
\cXmlBase::$$_xpath |
inherited_from |
\cXmlReader::$$_xpath |