Overview

Packages

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

Classes

  • XMLElement

Functions

  • BuildXMLTree
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class XMLElement

A class for XML elements which may have attributes, or contain other XML sub-elements

Package: awl\XMLElement
Copyright: Catalyst .Net Ltd, Morphoss Ltd <http://www.morphoss.com/>
License: GNU LGPL version 3 or later
Author: Andrew McMillan <andrew@mcmillan.net.nz>
Located at XMLElement.php
Methods summary
public
# __construct( string $tagname, mixed $content = false, array $attributes = false, string $xmlns = null )

Constructor - nothing fancy as yet.

Constructor - nothing fancy as yet.

Parameters

$tagname
string
$tagname The tag name of the new element
$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
string
$xmlns An XML namespace specifier
public integer
# CountElements( )

Count the number of elements

Count the number of elements

Returns

integer
The number of elements
public
# SetAttribute( string $k, string $v )

Set an element attribute to a value

Set an element attribute to a value

Parameters

$k
string
The attribute name
$v
string
The attribute value
public
# SetContent( mixed $v )

Set the whole content to a value

Set the whole content to a value

Parameters

$v
mixed
The element content, which may be text, or an array of sub-elements
public string
# GetTag( )

Accessor for the tag name

Accessor for the tag name

Returns

string
The tag name of the element
public string
# GetNSTag( )

Accessor for the full-namespaced tag name

Accessor for the full-namespaced tag name

Returns

string
The tag name of the element, prefixed by the namespace
public string
# GetAttribute( string $attr )

Accessor for a single attribute

Accessor for a single attribute

Parameters

$attr
string
$attr The name of the attribute.

Returns

string
The value of that attribute of the element
public array
# GetAttributes( )

Accessor for the attributes

Accessor for the attributes

Returns

array
The attributes of this element
public array
# GetContent( )

Accessor for the content

Accessor for the content

Returns

array
The content of this element
public array
# GetElements( mixed $tag = null, mixed $recursive = false )

Return an array of elements matching the specified tag, or all elements if no tag is supplied. Unlike GetContent() this will always return an array.

Return an array of elements matching the specified tag, or all elements if no tag is supplied. Unlike GetContent() this will always return an array.

Returns

array
The XMLElements within the tree which match this tag
public array
# GetPath( mixed $path )

Return an array of elements matching the specified path

Return an array of elements matching the specified path

Returns

array
The XMLElements within the tree which match this tag
public
# AddSubTag( object & $v )

Add a sub-element

Add a sub-element

Parameters

$v
object
An XMLElement to be appended to the array of sub-elements
public objectref &
# NewElement( string $tagname, mixed $content = false, array $attributes = false, mixed $xmlns = null )

Add a new sub-element

Add a new sub-element

Parameters

$tagname
string
The tag name of the new element
$content
mixed
Either a string of content, or an array of sub-elements
$attributes
array
An array of attribute name/value pairs
$xmlns

Returns

objectref
A reference to the new XMLElement
public string
# RenderContent( mixed $indent = 0, mixed $nslist = null, mixed $force_xmlns = false )

Render just the internal content

Render just the internal content

Returns

string
The content of this element, as a string without this element wrapping it.
public
# Render( integer $indent = 0, mixed $xmldef = "", mixed $nslist = null, mixed $force_xmlns = false )

Render the document tree into (nicely formatted) XML

Render the document tree into (nicely formatted) XML

Parameters

$indent
integer
The indenting level for the pretty formatting of the element
$xmldef
$nslist
$force_xmlns
public
# __tostring( )
Properties summary
protected mixed $tagname
#
protected mixed $xmlns
#
protected mixed $attributes
#
protected mixed $content
#
protected mixed $_parent
#
AWL API documentation generated by ApiGen 2.8.0