Project: CONTENIDO Content Management System Description: The XML reader class of CONTENIDO.

Description: The base XML class of CONTENIDO.

deprecated 2011-03-03 Use cXmlReader instead
package CONTENIDO Backend Classes
version 1.0.0
author Dominik Ziegler
copyright four for business AG

 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

'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

$xml

\SimpleXMLElement

[optional] the element to which the array should be added

$rootTagName

string

[optional] the root tag name which should be used - is only used when $xml is null!

Returns

\SimpleXMLElementthe array as a SimpleXMLElement

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

$path

string

XPath string

Returns

integeramount 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

\cException if there is no DOM document

Returns

stringencoding

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

$level

integer

level

Returns

stringextended 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

$path

string

xpath string

$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

$path

string

xpath string

Exceptions

\cException if there is no xpath

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

$path

string

xpath string

$nodeKey

integer

node key (optional, default: 0)

Returns

stringvalue 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

\cException if file could not be loaded

Returns

booleanload 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

\cException if XML could not be loaded

Returns

booleanload 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

stringresolved path

Sets a current DOMDocument object to class.

setDomDocument(\DOMDocument $domDocument) : void
Inherited
inherited_from \cXmlBase::setDomDocument()
inherited_from \cXmlReader::setDomDocument()

Parameters

$domDocument

\DOMDocument

DOMDocument object

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

stringdecoded value

Initializes a new DOMXPath instance for DOMDocument.

_initXpathInstance() : void
Inherited
inherited_from \cXmlBase::_initXpathInstance()
inherited_from \cXmlReader::_initXpathInstance()

Exceptions

\cException if there is no valid DOM document

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

arraythe cleaned array

 Properties

 

$_dom 
Inherited
inherited_from \cXmlBase::$$_dom
inherited_from \cXmlReader::$$_dom
 

$_xpath 
Inherited
inherited_from \cXmlBase::$$_xpath
inherited_from \cXmlReader::$$_xpath