Methods summary
public
|
#
__construct( array $namespaces = null )
Simple XMLDocument constructor
Simple XMLDocument constructor
Parameters
- $namespaces
array $namespaces An array of 'namespace' => 'prefix' pairs, where the prefix is
used as a short form for the namespace.
|
public
|
#
AddNamespace( string $namespace, string $prefix = null )
Add a new namespace to the document, optionally specifying it's short
prefix
Add a new namespace to the document, optionally specifying it's short
prefix
Parameters
- $namespace
string $namespace The full namespace name to be added
- $prefix
string $prefix An optional short form for the namespace.
|
public
|
#
DefaultNamespace( )
Return the default namespace for this document
Return the default namespace for this document
|
public
|
#
GetXmlNsArray( )
Return a tag with namespace stripped and replaced with a short form, and the
ns added to the document.
Return a tag with namespace stripped and replaced with a short form, and the
ns added to the document.
|
public
string
|
#
Tag( string $in_tag, string $namespace = null, string $prefix = null )
Return a tag with namespace stripped and replaced with a short form, and the
ns added to the document.
Return a tag with namespace stripped and replaced with a short form, and the
ns added to the document.
Parameters
- $in_tag
string $in_tag The tag we want a namespace prefix on.
- $namespace
string $namespace The namespace we want it in (which will be parsed from $in_tag if not
present
- $prefix
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.
|
public
|
#
NSElement( object & $element, string $in_tag, mixed $content = false, array $attributes = false, string $namespace = null )
Special helper for namespaced tags.
Special helper for namespaced tags.
Parameters
- $element
object $element The tag we are adding a new namespaced element to
- $in_tag
string $tag The tag name, possibly prefixed with the namespace
- $content
mixed $content The content of the tag
- $attributes
array $attributes An array of key/value pairs of attributes.
- $namespace
string $namespace The namespace for the tag
|
public
|
#
DAVElement( object & $element, string $tag, mixed $content = false, array $attributes = false )
Special helper for tags in the DAV: namespace.
Special helper for tags in the DAV: namespace.
Parameters
- $element
object $element The tag we are adding a new namespaced element to
- $tag
string $tag The tag name
- $content
mixed $content The content of the tag
- $attributes
array $attributes An array of key/value pairs of attributes.
|
public
|
#
CalDAVElement( object & $element, string $tag, mixed $content = false, array $attributes = false )
Special helper for tags in the urn:ietf:params:xml:ns:caldav namespace.
Special helper for tags in the urn:ietf:params:xml:ns:caldav namespace.
Parameters
- $element
object $element The tag we are adding a new namespaced element to
- $tag
string $tag The tag name
- $content
mixed $content The content of the tag
- $attributes
array $attributes An array of key/value pairs of attributes.
|
public
|
#
CardDAVElement( object & $element, string $tag, mixed $content = false, array $attributes = false )
Special helper for tags in the urn:ietf:params:xml:ns:carddav namespace.
Special helper for tags in the urn:ietf:params:xml:ns:carddav namespace.
Parameters
- $element
object $element The tag we are adding a new namespaced element to
- $tag
string $tag The tag name
- $content
mixed $content The content of the tag
- $attributes
array $attributes An array of key/value pairs of attributes.
|
public
|
#
CalendarserverElement( object & $element, string $tag, mixed $content = false, array $attributes = false )
Special helper for tags in the http://calendarserver.org/ns/
namespace.
Parameters
- $element
object $element The tag we are adding a new namespaced element to
- $tag
string $tag The tag name
- $content
mixed $content The content of the tag
- $attributes
array $attributes An array of key/value pairs of attributes.
|
public
|
#
NewXMLElement( string $in_tag, mixed $content = false, array $attributes = false, array $xmlns = null )
Parameters
- $in_tag
string $in_tag The tag name of the new element, possibly namespaced
- $content
mixed $content Either a string of content, or an array of sub-elements
- $attributes
array $attributes An array of attribute name/value pairs
- $xmlns
array $xmlns An XML namespace specifier
|
public
A
|
#
Render( mixed $root, mixed $content = false, array $attributes = false, array $xmlns = null )
Render the document tree into (nicely formatted) XML
Render the document tree into (nicely formatted) XML
Parameters
- $root
mixed $root A root XMLElement or a tagname to create one with the remaining
parameters.
- $content
mixed $content Either a string of content, or an array of sub-elements
- $attributes
array $attributes An array of attribute name/value pairs
- $xmlns
array $xmlns An XML namespace specifier
Returns
A rendered namespaced XML document.
|
public
XMLElement
|
#
href( mixed $url )
Return a DAV::href XML element, or an array of them
Return a DAV::href XML element, or an array of them
Parameters
- $url
mixed $url The URL (or array of URLs) to be wrapped in DAV::href tags
Returns
|