Overview

Packages

  • awl
    • AuthPlugin
    • AwlDatabase
    • Browser
    • classEditor
    • DataEntry
    • DataUpdate
    • EMail
    • iCalendar
    • MenuSet
    • PgQuery
    • Session
    • Translation
    • User
    • Utilities
    • Validation
    • vCalendar
    • vComponent
    • XMLDocument
    • XMLElement
  • None

Classes

  • XMLDocument
  • Overview
  • Package
  • Class

Class XMLDocument

A class for XML Documents which will contain namespaced XML elements

Package: awl\XMLDocument
Copyright: Morphoss Ltd - http://www.morphoss.com/
License: GNU LGPL version 3 or later
Author: Andrew McMillan andrew@morphoss.com
Located at XMLDocument.php
Methods summary
public
# __construct( array $namespaces = null )

Simple XMLDocument constructor

Simple XMLDocument constructor

Parameters

$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
The full namespace name to be added
$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
The tag we want a namespace prefix on.
$namespace
The namespace we want it in (which will be parsed from $in_tag if not present
$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
The tag are adding a new namespaced element to
$in_tag
$tag the tag name, possibly prefixed with the namespace
$content
The content of the tag
$attributes
An array of key/value pairs of attributes.
$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
The tag are adding a new namespaced element to
$tag
the tag name
$content
The content of the tag
$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
The tag are adding a new namespaced element to
$tag
the tag name
$content
The content of the tag
$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
The tag are adding a new namespaced element to
$tag
the tag name
$content
The content of the tag
$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 urn:ietf:params:xml:ns:caldav namespace.

Special helper for tags in the urn:ietf:params:xml:ns:caldav namespace.

Parameters

$element
The tag are adding a new namespaced element to
$tag
the tag name
$content
The content of the tag
$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
The tag name of the new element, possibly namespaced
$content
Either a string of content, or an array of sub-elements
$attributes
An array of attribute name/value pairs
$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
A root XMLElement or a tagname to create one with the remaining parameters.
$content
Either a string of content, or an array of sub-elements
$attributes
An array of attribute name/value pairs
$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
The URL (or array of URLs) to be wrapped in DAV::href tags

Returns

XMLElement
The newly created XMLElement object.
Properties summary
public static string $ns_dav
# 'DAV:'
public static string $ns_caldav
# 'urn:ietf:params:xml:ns:caldav'
public static string $ns_carddav
# 'urn:ietf:params:xml:ns:carddav'
public static string $ns_calendarserver
# 'http://calendarserver.org/ns/'
API documentation generated by ApiGen