|
| __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) |
|
Definition at line 20 of file XMLDocument.php.
◆ __construct()
XMLDocument::__construct |
( |
|
$namespaces = null | ) |
|
Simple XMLDocument constructor
- Parameters
-
array | $namespaces | An array of 'namespace' => 'prefix' pairs, where the prefix is used as a short form for the namespace. |
Definition at line 55 of file XMLDocument.php.
◆ AddNamespace()
XMLDocument::AddNamespace |
( |
|
$namespace, |
|
|
|
$prefix = null |
|
) |
| |
Add a new namespace to the document, optionally specifying it's short prefix
- Parameters
-
string | $namespace | The full namespace name to be added |
string | $prefix | An optional short form for the namespace. |
Definition at line 73 of file XMLDocument.php.
◆ CalDAVElement()
XMLDocument::CalDAVElement |
( |
& |
$element, |
|
|
|
$tag, |
|
|
|
$content = false , |
|
|
|
$attributes = false |
|
) |
| |
Special helper for tags in the urn:ietf:params:xml:ns:caldav namespace.
- Parameters
-
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 232 of file XMLDocument.php.
◆ CalendarserverElement()
XMLDocument::CalendarserverElement |
( |
& |
$element, |
|
|
|
$tag, |
|
|
|
$content = false , |
|
|
|
$attributes = false |
|
) |
| |
Special helper for tags in the http://calendarserver.org/ns/ namespace.
- Parameters
-
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 260 of file XMLDocument.php.
◆ CardDAVElement()
XMLDocument::CardDAVElement |
( |
& |
$element, |
|
|
|
$tag, |
|
|
|
$content = false , |
|
|
|
$attributes = false |
|
) |
| |
Special helper for tags in the urn:ietf:params:xml:ns:carddav namespace.
- Parameters
-
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 246 of file XMLDocument.php.
◆ DAVElement()
XMLDocument::DAVElement |
( |
& |
$element, |
|
|
|
$tag, |
|
|
|
$content = false , |
|
|
|
$attributes = false |
|
) |
| |
Special helper for tags in the DAV: namespace.
- Parameters
-
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 219 of file XMLDocument.php.
◆ DefaultNamespace()
XMLDocument::DefaultNamespace |
( |
| ) |
|
Return the default namespace for this document
Definition at line 118 of file XMLDocument.php.
◆ GetXmlNsArray()
XMLDocument::GetXmlNsArray |
( |
| ) |
|
Return a tag with namespace stripped and replaced with a short form, and the ns added to the document.
Definition at line 131 of file XMLDocument.php.
◆ href()
XMLDocument::href |
( |
|
$url | ) |
|
Return a DAV::href XML element, or an array of them
- Parameters
-
mixed | $url | The URL (or array of URLs) to be wrapped in DAV::href tags |
- Returns
- XMLElement The newly created XMLElement object.
Definition at line 322 of file XMLDocument.php.
◆ NewXMLElement()
XMLDocument::NewXMLElement |
( |
|
$in_tag, |
|
|
|
$content = false , |
|
|
|
$attributes = false , |
|
|
|
$xmlns = null |
|
) |
| |
- Parameters
-
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 272 of file XMLDocument.php.
◆ NSElement()
XMLDocument::NSElement |
( |
& |
$element, |
|
|
|
$in_tag, |
|
|
|
$content = false , |
|
|
|
$attributes = false , |
|
|
|
$namespace = null |
|
) |
| |
Special helper for namespaced tags.
- Parameters
-
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 191 of file XMLDocument.php.
◆ Render()
XMLDocument::Render |
( |
|
$root, |
|
|
|
$content = false , |
|
|
|
$attributes = false , |
|
|
|
$xmlns = null |
|
) |
| |
Render the document tree into (nicely formatted) XML
- Parameters
-
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 |
- Returns
- A rendered namespaced XML document.
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 295 of file XMLDocument.php.
◆ Tag()
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.
- Parameters
-
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. |
- Returns
- string The tag with a namespace prefix consistent with previous tags in this namespace.
Definition at line 151 of file XMLDocument.php.
◆ $namespaces
◆ $next_prefix
XMLDocument::$next_prefix |
◆ $ns_caldav
XMLDocument::$ns_caldav = 'urn:ietf:params:xml:ns:caldav' |
|
static |
◆ $ns_calendarserver
XMLDocument::$ns_calendarserver = 'http://calendarserver.org/ns/' |
|
static |
◆ $ns_carddav
XMLDocument::$ns_carddav = 'urn:ietf:params:xml:ns:carddav' |
|
static |
◆ $ns_dav
XMLDocument::$ns_dav = 'DAV:' |
|
static |
◆ $prefixes
◆ $root
The documentation for this class was generated from the following file: