Apache Zeta Components - high quality PHP components

Apache Zeta Components Manual :: Docs For Class ezcWebdavXmlTool

Webdav::ezcWebdavXmlTool

Class ezcWebdavXmlTool

Tool class to work with XML.

An instance of this tool class is used to perform XML operations while parsing incoming requests and serializing outgoing responses.

If a client expects different behavior regarding fundamental XML handling, this class can be extended. To make it being used for a certain client, the new class name needs to be specified in an instance of ezcWebdacServerConfiguration, which then needs to be registered in the ezcWebdacServerConfigurationManager instance, located in the ezcWebdacServer singleton instance.

Source for this file: /Webdav/src/tools/xml.php

Version:   //autogen//

Constants

XML_DEFAULT_NAMESPACE = 'DAV:' The default namespace, where WebDAV XML elements reside in.
XML_ENCODING = 'utf-8' Encoding to use to create DOM documents.
XML_VERSION = '1.0' The XML version to create DOM documents in.

Properties

ezcWebdavNamespaceRegistry read/write $namespaceRegistry
Registry class that keeps track of used namespace URIs and their abbreviations.

Member Variables

protected array(string=>mixed) $properties = array()
Properties.

Method Summary

public void __construct( [ $namespaceRegistry = null] )
Creates a new XML tool.
public DOMDocument createDom( [ $content = null] )
Returns a DOMDocument from the given XML.
public DOMDocument|false createDomDocument( [ $content = null] )
Returns a DOMDocument from the given XML.
public DOMElement createDomElement( $dom , $localName , [ $namespace = self::XML_DEFAULT_NAMESPACE] )
Returns a new DOMElement in the given namespace.

Methods

__construct

void __construct( [ezcWebdavNamespaceRegistry $namespaceRegistry = null] )

Creates a new XML tool.

Creates an new XML tool instance. If not $namespaceRegistry is provided, the default ezcWebdavNamespaceRegistry will be instantiated and used. The registry can be accessed through the $namespaceRegistry property.

Parameters:
Name Type Description
$namespaceRegistry ezcWebdavNamespaceRegistry

createDom

DOMDocument createDom( [sting $content = null] )

Returns a DOMDocument from the given XML.

Creates a new DOMDocument with the options set in the class constants and loads the optionally given $xml string with settings appropriate to work with it. Throws an exception if the loading fails.

Parameters:
Name Type Description
$content sting
Exceptions:
Type Description
ezcWebdavInvalidRequestBodyException in case libxml produces an error with code other than 100 while loading $content.

createDomDocument

DOMDocument|false createDomDocument( [sting $content = null] )

Returns a DOMDocument from the given XML.

Creates a new DOMDocument with the options set in the class constants and loads the optionally given $xml string with settings appropriate to work with it. Returns false if the loading fails.

Parameters:
Name Type Description
$content sting

createDomElement

DOMElement createDomElement( $dom , string $localName , [string $namespace = self::XML_DEFAULT_NAMESPACE] )

Returns a new DOMElement in the given namespace.

Retrieves the shortcut for the $namespace and creates a new DOMElement object with the correct global name for the given $localName.

Parameters:
Name Type Description
$dom DOMDocument
$localName string
$namespace string
Documentation generated by phpDocumentor 1.4.3