Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • cXmlBase
  • cXmlReader
  • cXmlWriter
  • Overview
  • Package
  • Class
  • Todo
  • Download

Class cXmlBase

Base XML class

Direct known subclasses

cXmlReader, cXmlWriter
Abstract
Package: Core\XML
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Dominik Ziegler
Located at classes/xml/class.xml.base.php
Methods summary
protected
# _createDocument( string $version = '', string $encoding = '' )

Creates a new XML document using DOMDocument.

Creates a new XML document using DOMDocument.

Parameters

$version
version of DOMDocument (optional, default: 1.0)
$encoding
encoding of DOMDocumen (optional, default: UTF-8)
public DOMDocument
# getDomDocument( )

Returns the DOMDocument object.

Returns the DOMDocument object.

Returns

DOMDocument
public
# setDomDocument( DOMDocument $domDocument )

Sets a current DOMDocument object to class.

Sets a current DOMDocument object to class.

Parameters

$domDocument
DOMDocument object
public string
# getEncoding( )

Returns the encoding of the XML document.

Returns the encoding of the XML document.

Returns

string
encoding

Throws

cException
if there is no DOM document
public
# registerXpathNamespace( string $name, string $value )

Parameters

$name
$value
protected
# _initXpathInstance( )

Initializes a new DOMXPath instance for DOMDocument.

Initializes a new DOMXPath instance for DOMDocument.

Throws

cException
if there is no valid DOM document
public static string
# resolvePath( string $path )

Resolves a given path which contains ".." statement for moving up one level in path.

Resolves a given path which contains ".." statement for moving up one level in path.

Parameters

$path
path to resolve

Returns

string
resolved path
public static string
# getLevelXpath( string $path, integer $level )

Returns given XPath with integrad level definition.

Returns given XPath with integrad level definition.

Parameters

$path
XPath to extend
$level
level

Returns

string
extended XPath
public static SimpleXMLElement
# arrayToXml( array $array, SimpleXMLElement $xml = NULL, string $rootTagName = 'root' )

Converts an array to a SimpleXMLElement. Example: array( 'key1' => 'value1', 'key2' => array('value21', 'value22'), 'key3' => array('key31' => 'value31', 'key32' => 'value32') );

Converts an array to a SimpleXMLElement. 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

Parameters

$array
the array which should be converted to XML
$xml

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

$rootTagName

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

Returns

SimpleXMLElement
the array as a SimpleXMLElement
public static
# xmlStringToArray( string $xmlString )

Converts the given XML string to an array. Example: value1 value21 value22 value31 value32

Converts the given XML string to an array. Example: value1 value21 value22 value31 value32

becomes

array( 'key1' => 'value1', 'key2' => array('value21', 'value22'), 'key3' => array('key31' => 'value31', 'key32' => 'value32') );

Parameters

$xmlString
contains a valid XML structure
public static boolean
# isValidXML( string $xmlString )

Checks if a string is valid XML

Checks if a string is valid XML

Parameters

$xmlString

Returns

boolean
True if the XML is valid
public static
# xmlToArray( SimpleXMLElement $xml )

Converts the given SimpleXMLElement object to an array. Example: value1 value21 value22 value31 value32

Converts the given SimpleXMLElement object to an array. Example: value1 value21 value22 value31 value32

becomes

array( 'key1' => 'value1', 'key2' => array('value21', 'value22'), 'key3' => array('key31' => 'value31', 'key32' => 'value32') );

Parameters

$xml
private static array
# _cleanArray( array $array )

Cleans an array by replacing all empty arrays with empty strings. Additionally, the function replaces all associative arrays which have only empty values with the array keys of the array.

Cleans an array by replacing all empty arrays with empty strings. Additionally, the function replaces all associative arrays which have only empty values with the array keys of the array.

Parameters

$array
the array to clean

Returns

array
the cleaned array
Properties summary
protected $_dom
# NULL
protected $_xpath
# NULL
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen