Inherited Variables
Inherited Constants
Inherited Methods
Class Details
XML utilities for WebDAV
Tags:
- author - Evert Pot (http://www.rooftopsolutions.nl/)
- copyright - Copyright (C) 2007-2010 Rooftop Solutions. All rights reserved.
- license - Modified BSD License
[ Top ]
Class Variables
Class Methods
static convertDAVNamespace
static void convertDAVNamespace(
$xmlDocument)
[line 51]
This method takes an XML document (as string) and converts all instances of the DAV: namespace to urn:DAV
This is unfortunately needed, because the DAV: namespace violates the xml namespaces spec, and causes the DOM to throw errors
Parameters:
- $xmlDocument -
[ Top ]
static loadDOMDocument
static DOMDocument loadDOMDocument(
string
$xml)
[line 69]
This method provides a generic way to load a DOMDocument for WebDAV use.
This method throws a Sabre_DAV_Exception_BadRequest exception for any xml errors. It does not preserve whitespace, and it converts the DAV: namespace to urn:DAV.
Tags:
- throws - Sabre_DAV_Exception_BadRequest
Parameters:
- string $xml -
[ Top ]
static parseProperties
static array parseProperties(
$parentNode, [
$propertyMap = array()])
[line 120]
Parses all WebDAV properties out of a DOM Element
Generally WebDAV properties are encloded in {DAV:}prop elements. This method helps by going through all these and pulling out the actual propertynames, making them array keys and making the property values, well.. the array values.
If no value was given (self-closing element) null will be used as the value. This is used in for example PROPFIND requests.
Complex values are supported through the propertyMap argument. The propertyMap should have the clark-notation properties as it's keys, and classnames as values.
When any of these properties are found, the unserialize() method will be (statically) called. The result of this method is used as the value.
Parameters:
- DOMElement $parentNode -
- array $propertyMap -
[ Top ]
static toClarkNotation
static string toClarkNotation(
$dom)
[line 32]
Returns the 'clark notation' for an element.
For example, and element encoded as: <b:myelem xmlns:b="http://www.example.org/" /> will be returned as: {http://www.example.org}myelem
This format is used throughout the SabreDAV sourcecode. Elements encoded with the urn:DAV namespace will be returned as if they were in the DAV: namespace. This is to avoid compatibility problems.
This function will return null if a nodetype other than an Element is passed.
Parameters:
- DOMElement $dom -
[ Top ]