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
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SIWECOS
    • 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 = '' )

Constructor to create an instance of this class.

Constructor to create an instance of this class.

Creates the XML document.

Parameters

$version
string
$version [optional, default: 1.0] version of XML document
$encoding
string
$encoding [optional, default: UTF-8] encoding of XML document
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 [optional] value of the element
$rootElement
DOMElement
$rootElement [optional] root element
$attributes
array
$attributes [optional] array of attributes added to this element
$cdata
boolean
$cdata [optional] whether the value is surround by CDATA blocks

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 [optional] 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(), isValidXML(), registerXpathNamespace(), resolvePath(), setDomDocument(), xmlStringToArray(), xmlToArray()
Properties inherited from cXmlBase
$_dom, $_xpath
CMS CONTENIDO 4.10.1 API documentation generated by ApiGen 2.8.0