|
Andrew's Web Libraries (AWL)
|
Public Member Functions | |
| __construct ( $namespaces=null) | |
| AddNamespace ( $namespace, $prefix=null) | |
| DefaultNamespace () | |
| GetXmlNsArray () | |
| Tag ( $in_tag, $namespace=null, $prefix=null) | |
| NSElement (&$element, $in_tag, $content=false, $attributes=false, $namespace=null) | |
| DAVElement (&$element, $tag, $content=false, $attributes=false) | |
| CalDAVElement (&$element, $tag, $content=false, $attributes=false) | |
| CardDAVElement (&$element, $tag, $content=false, $attributes=false) | |
| CalendarserverElement (&$element, $tag, $content=false, $attributes=false) | |
| NewXMLElement ( $in_tag, $content=false, $attributes=false, $xmlns=null) | |
| Render ( $root, $content=false, $attributes=false, $xmlns=null) | |
| href ($url) | |
Private Attributes | |
| $namespaces | |
| $prefixes | |
| $root | |
Definition at line 20 of file XMLDocument.php.
| XMLDocument::__construct | ( | $namespaces = null | ) |
Simple XMLDocument constructor
| array | $namespaces | An array of 'namespace' => 'prefix' pairs, where the prefix is used as a short form for the namespace. |
Definition at line 48 of file XMLDocument.php.
| XMLDocument::AddNamespace | ( | $namespace, | |
$prefix = null |
|||
| ) |
Add a new namespace to the document, optionally specifying it's short prefix
| string | $namespace | The full namespace name to be added |
| string | $prefix | An optional short form for the namespace. |
Definition at line 66 of file XMLDocument.php.
| XMLDocument::CalDAVElement | ( | & | $element, |
| $tag, | |||
$content = false, |
|||
$attributes = false |
|||
| ) |
Special helper for tags in the urn:ietf:params:xml:ns:caldav namespace.
| object | $element | The tag we are adding a new namespaced element to |
| string | $tag | The tag name |
| mixed | $content | The content of the tag |
| array | $attributes | An array of key/value pairs of attributes. |
Definition at line 225 of file XMLDocument.php.
| XMLDocument::CalendarserverElement | ( | & | $element, |
| $tag, | |||
$content = false, |
|||
$attributes = false |
|||
| ) |
Special helper for tags in the http://calendarserver.org/ns/ namespace.
| object | $element | The tag we are adding a new namespaced element to |
| string | $tag | The tag name |
| mixed | $content | The content of the tag |
| array | $attributes | An array of key/value pairs of attributes. |
Definition at line 253 of file XMLDocument.php.
| XMLDocument::CardDAVElement | ( | & | $element, |
| $tag, | |||
$content = false, |
|||
$attributes = false |
|||
| ) |
Special helper for tags in the urn:ietf:params:xml:ns:carddav namespace.
| object | $element | The tag we are adding a new namespaced element to |
| string | $tag | The tag name |
| mixed | $content | The content of the tag |
| array | $attributes | An array of key/value pairs of attributes. |
Definition at line 239 of file XMLDocument.php.
| XMLDocument::DAVElement | ( | & | $element, |
| $tag, | |||
$content = false, |
|||
$attributes = false |
|||
| ) |
Special helper for tags in the DAV: namespace.
| object | $element | The tag we are adding a new namespaced element to |
| string | $tag | The tag name |
| mixed | $content | The content of the tag |
| array | $attributes | An array of key/value pairs of attributes. |
Definition at line 212 of file XMLDocument.php.
| XMLDocument::DefaultNamespace | ( | ) |
Return the default namespace for this document
Definition at line 111 of file XMLDocument.php.
| XMLDocument::GetXmlNsArray | ( | ) |
Return a tag with namespace stripped and replaced with a short form, and the ns added to the document.
Definition at line 124 of file XMLDocument.php.
| XMLDocument::href | ( | $url | ) |
Return a DAV::href XML element, or an array of them
| mixed | $url | The URL (or array of URLs) to be wrapped in DAV::href tags |
Definition at line 315 of file XMLDocument.php.
| XMLDocument::NewXMLElement | ( | $in_tag, | |
$content = false, |
|||
$attributes = false, |
|||
$xmlns = null |
|||
| ) |
| string | $in_tag | The tag name of the new element, possibly namespaced |
| mixed | $content | Either a string of content, or an array of sub-elements |
| array | $attributes | An array of attribute name/value pairs |
| array | $xmlns | An XML namespace specifier |
Definition at line 265 of file XMLDocument.php.
| XMLDocument::NSElement | ( | & | $element, |
| $in_tag, | |||
$content = false, |
|||
$attributes = false, |
|||
$namespace = null |
|||
| ) |
Special helper for namespaced tags.
| object | $element | The tag we are adding a new namespaced element to |
| string | $tag | The tag name, possibly prefixed with the namespace |
| mixed | $content | The content of the tag |
| array | $attributes | An array of key/value pairs of attributes. |
| string | $namespace | The namespace for the tag |
Definition at line 184 of file XMLDocument.php.
| XMLDocument::Render | ( | $root, | |
$content = false, |
|||
$attributes = false, |
|||
$xmlns = null |
|||
| ) |
Render the document tree into (nicely formatted) XML
| mixed | $root | A root XMLElement or a tagname to create one with the remaining parameters. |
| mixed | $content | Either a string of content, or an array of sub-elements |
| array | $attributes | An array of attribute name/value pairs |
| array | $xmlns | An XML namespace specifier |
They handed us a pre-existing object. We'll just use it...
We got a tag name, so we need to create the root element
Add our namespace attributes here.
And render...
Definition at line 288 of file XMLDocument.php.
| XMLDocument::Tag | ( | $in_tag, | |
$namespace = null, |
|||
$prefix = null |
|||
| ) |
Return a tag with namespace stripped and replaced with a short form, and the ns added to the document.
| string | $in_tag | The tag we want a namespace prefix on. |
| string | $namespace | The namespace we want it in (which will be parsed from $in_tag if not present |
| string | $prefix | The prefix we would like to use. Leave it out and one will be assigned. |
Definition at line 144 of file XMLDocument.php.