Project: CONTENIDO Content Management System

Description: The base XML class of CONTENIDO.

package CONTENIDO Backend Classes
version 1.0.0
author Dominik Ziegler
copyright four for business AG

 Methods

__construct()

__construct() 
deprecated [2012-07-24] class was renamed to cXmlBase

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()

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

Returns the DOMDocument object.

getDomDocument() : \DOMDocument
Inherited
inherited_from \cXmlBase::getDomDocument()

Returns

Returns the encoding of the XML document.

getEncoding() : string
Inherited
inherited_from \cXmlBase::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()

Parameters

$path

string

XPath to extend

$level

integer

level

Returns

stringextended XPath

registerXpathNamespace()

registerXpathNamespace(string $name, string $value) 
Inherited
inherited_from \cXmlBase::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()

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()

Parameters

$domDocument

\DOMDocument

DOMDocument object

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()

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()

Parameters

Creates a new XML document using DOMDocument.

_createDocument(string $version, string $encoding) : void
Inherited
access protected
inherited_from \cXmlBase::_createDocument()

Parameters

$version

string

version of DOMDocument (optional, default: 1.0)

$encoding

string

encoding of DOMDocumen (optional, default: UTF-8)

Initializes a new DOMXPath instance for DOMDocument.

_initXpathInstance() : void
Inherited
inherited_from \cXmlBase::_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()

Parameters

$array

array

the array to clean

Returns

arraythe cleaned array

 Properties

 

$_dom 
Inherited
inherited_from \cXmlBase::$$_dom
 

$_xpath 
Inherited
inherited_from \cXmlBase::$$_xpath