Andrew's Web Libraries (AWL)
|
Public Member Functions | |
__construct ( $tagname, $content=false, $attributes=false, $xmlns=null) | |
CountElements () | |
SetAttribute ($k, $v) | |
SetContent ($v) | |
GetTag () | |
GetNSTag () | |
GetAttribute ( $attr) | |
GetAttributes () | |
GetContent () | |
GetElements ( $tag=null, $recursive=false) | |
GetPath ( $path) | |
AddSubTag (&$v) | |
& | NewElement ( $tagname, $content=false, $attributes=false, $xmlns=null) |
RenderContent ($indent=0, $nslist=null, $force_xmlns=false) | |
Render ($indent=0, $xmldef="", $nslist=null, $force_xmlns=false) | |
__tostring () | |
Protected Attributes | |
$tagname | |
$xmlns | |
$attributes | |
$content | |
$_parent | |
Definition at line 20 of file XMLElement.php.
XMLElement::__construct | ( | $tagname, | |
$content = false , |
|||
$attributes = false , |
|||
$xmlns = null |
|||
) |
Constructor - nothing fancy as yet.
string | $tagname | The tag name of the new element |
mixed | $content | Either a string of content, or an array of sub-elements |
array | $attributes | An array of attribute name/value pairs |
string | $xmlns | An XML namespace specifier |
Definition at line 35 of file XMLElement.php.
XMLElement::AddSubTag | ( | & | $v | ) |
Add a sub-element
object | An XMLElement to be appended to the array of sub-elements |
Definition at line 216 of file XMLElement.php.
XMLElement::CountElements | ( | ) |
Count the number of elements
Definition at line 69 of file XMLElement.php.
XMLElement::GetAttribute | ( | $attr | ) |
Accessor for a single attribute
string | $attr | The name of the attribute. |
Definition at line 122 of file XMLElement.php.
XMLElement::GetAttributes | ( | ) |
Accessor for the attributes
Definition at line 133 of file XMLElement.php.
XMLElement::GetContent | ( | ) |
Accessor for the content
Definition at line 142 of file XMLElement.php.
XMLElement::GetElements | ( | $tag = null , |
|
$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.
Definition at line 152 of file XMLElement.php.
XMLElement::GetNSTag | ( | ) |
Accessor for the full-namespaced tag name
Definition at line 113 of file XMLElement.php.
XMLElement::GetPath | ( | $path | ) |
Return an array of elements matching the specified path
That is the full path
There is more to the path, so we recurse into that sub-part
If our input $path was not rooted, we recurse further
Definition at line 176 of file XMLElement.php.
XMLElement::GetTag | ( | ) |
Accessor for the tag name
Definition at line 104 of file XMLElement.php.
& XMLElement::NewElement | ( | $tagname, | |
$content = false , |
|||
$attributes = false , |
|||
$xmlns = null |
|||
) |
Add a new sub-element
string | The tag name of the new element |
mixed | Either a string of content, or an array of sub-elements |
array | An array of attribute name/value pairs |
Definition at line 231 of file XMLElement.php.
XMLElement::Render | ( | $indent = 0 , |
|
$xmldef = "" , |
|||
$nslist = null , |
|||
$force_xmlns = false |
|||
) |
Render the document tree into (nicely formatted) XML
int | The indenting level for the pretty formatting of the element |
Render the element attribute values
Definition at line 284 of file XMLElement.php.
XMLElement::RenderContent | ( | $indent = 0 , |
|
$nslist = null , |
|||
$force_xmlns = false |
|||
) |
Render just the internal content
Render the sub-elements with a deeper indent level
Render the content, with special characters escaped
Definition at line 244 of file XMLElement.php.
XMLElement::SetAttribute | ( | $k, | |
$v | |||
) |
Set an element attribute to a value
string | The attribute name |
string | The attribute value |
Definition at line 82 of file XMLElement.php.
XMLElement::SetContent | ( | $v | ) |
Set the whole content to a value
mixed | The element content, which may be text, or an array of sub-elements |
Definition at line 95 of file XMLElement.php.