Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • 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

Classes

  • cXmlBase
  • cXmlReader
  • cXmlWriter
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cXmlWriter

XML writer class

cXmlBase
Extended by cXmlWriter
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.writer.php
Methods summary
public
# __construct( string $version = '', string $encoding = '' )

Class constructor of cXmlWriter. Creates the XML document.

Class constructor of cXmlWriter. Creates the XML document.

Parameters

$version
string
$version version of XML document (optional, default: 1.0)
$encoding
string
$encoding encoding of XML document (optional, default: UTF-8)
public DOMElement
# addElement( string $name, string $value = '', DOMElement $rootElement = NULL, array $attributes = array(), boolean $cdata = false )

Adds a new element to the XML document. If no root element is given the element will be appended to the root node.

Adds a new element to the XML document. If no root element is given the element will be appended to the root node.

Parameters

$name
string
$name name of the element
$value
string
$value value of the element (optional)
$rootElement
DOMElement
$rootElement root element (optional)
$attributes
array
$attributes array of attributes added to this element (optional)
$cdata
boolean
$cdata whether the value is surround by CDATA blocks (optional)

Returns

DOMElement
created DOM element
protected DOMElement
# _addElementAttributes( DOMElement $element, array $attributes = array() )

Adds an array of attributes to a specific DOM element.

Adds an array of attributes to a specific DOM element.

Parameters

$element
DOMElement
$element DOM element to add attributes
$attributes
array
$attributes array of attributes

Returns

DOMElement
DOM element with assigned attributes
public string
# saveToString( )

Returns the complete XML tree as string.

Returns the complete XML tree as string.

Returns

string
XML tree
public boolean
# saveToFile( string $directory, string $fileName )

Saves the XML tree into a file.

Saves the XML tree into a file.

Parameters

$directory
string
$directory path to destination directory
$fileName
string
$fileName name of the written file

Returns

boolean
state of saving process (true if file was created, false otherwise)

Throws

cException
if the directory is not writable
Methods inherited from cXmlBase
_createDocument(), _initXpathInstance(), arrayToXml(), getDomDocument(), getEncoding(), getLevelXpath(), registerXpathNamespace(), resolvePath(), setDomDocument(), xmlStringToArray(), xmlToArray()
Properties inherited from cXmlBase
$_dom, $_xpath
CMS CONTENIDO 4.9.1 API documentation generated by ApiGen 2.8.0