class Element

This class hold an xml element and its sub tree.

class contents [NB. Highlighted attributes are static members]
Functions
function addCDATASection(string) - Add an xml cdata section as a child to the current element.
function addChild(string,string) - Add a child element to the tree as a child to the current element.
function addComment(string) - Add an xml comment as a child to the current element.
function addNextSibling(string,string) - Add an element as the next sibling of the to the current element.
function addPI(string,string) - Add an xml proccessing intructionas a child to the current element.
function addPreviousSibling(string,string) - Add an element as the previous sibling of the to the current element.
function addSibling(string,string) - Add a sibling element to the current element.
function getAttributeByName(string) - Fetch the value of the attribute with name attr.
function getAttributes() - Get all the elements attributes as an array
function getChildren() - Get all the elements children.
function getElementData() - Retrieve the data of an element node.
function getElementName() - Retrieve the name of an element node.
function getElementsByTagName(string) - Retrieve all elements matching name, name could be an xpath expression.
function getFirstChild() - Get the first child of an element node.
function getLastChild() - Get the last child of an element node.
function getNamespace() - Get the namespace of an element node.
function getNextSibling() - Get the next sibling of an element node.
function getParent() - Get the parent element of an element node.
function getPreviousSibling() - Get the previous sibling of an element node.
function hasAttribute(string) - Check if the current element an attributes with name.
function hasAttributes() - Check if the current element has any attributes.
function hasChildren() - Check if an element has children.
function mergeAsChild(object) - Merge one xml tree into another as a child tree.
function mergeAsNextSibling(object) - Merge one xml tree into another as a child tree. As the next sibling.
function mergeAsPreviousSibling(object) - Merge one xml tree into another tree as the next sibling.
function mergeAsSibling(object) - Merge one xml tree into another as a child tree. As a sibling.
function removeAttribute(string) - Remove an attribute
function removeChildren() - Remove all children element to the current node.
function removeChildWithName(string) - Remove all children elements with a specific name.
function removeElementsByTagName(string) - Remove all elements with identified by an xpath string.
function removeSelf() - Remove the current element.
function setAttribute(string,string) - Set the value of an attribute on the current element. If the attribute does not exist it will be created.
function setElementData(string) - Change the content of the current element.
function setElementName(string) - Change the name of the current element.
function toString() - return the content of an element and its children as a string.

Functions

function addCDATASection Click to go up to the list
Add an xml cdata section as a child to the current element.
Declaration:
     native function addCDATASection( string cdata )
Parameters:
    Parameter #1: string cdata - The value of the cdata section.
Returns:
    true on success, false otherwise.

function addChild Click to go up to the list
Add a child element to the tree as a child to the current element.
Declaration:
    function addChild( string name, string data )
Parameters:
    Parameter #1: string name - The element name.
    Parameter #2: string data - The element value.
Returns:
    an object of type XML.Element on success, null otherwise.

function addComment Click to go up to the list
Add an xml comment as a child to the current element.
Declaration:
     native function addComment( string comment )
Parameters:
    Parameter #1: string comment - The comment.
Returns:
    true on success, false otherwise.

function addNextSibling Click to go up to the list
Add an element as the next sibling of the to the current element.
Warning!
You can't add a sibling to the root node within a document.
Declaration:
    function addNextSibling( string name, string data )
Parameters:
    Parameter #1: string name - The element name.
    Parameter #2: string data - The element value.
Returns:
    an object of type XML.Element on success, null otherwise.

function addPI Click to go up to the list
Add an xml proccessing intructionas a child to the current element.
Declaration:
    function addPI( string name, string value )
Parameters:
    Parameter #1: string name - The name of the pi.
    Parameter #2: string value - the value of the pi.
Returns:
    true on success, false otherwise.

function addPreviousSibling Click to go up to the list
Add an element as the previous sibling of the to the current element.
Warning!
You can't add a sibling to the root node within a document.
Declaration:
    function addPreviousSibling( string name, string data )
Parameters:
    Parameter #1: string name - The element name.
    Parameter #2: string data - The element value.
Returns:
    an object of type XML.Element on success, null otherwise.

function addSibling Click to go up to the list
Add a sibling element to the current element.
Warning!
You can't add a sibling to the root node within a document
Declaration:
    function addSibling( string name, string data )
Parameters:
    Parameter #1: string name - The element name.
    Parameter #2: string data - The element value.
Returns:
    an object of type XML.Element on success, null otherwise.

function getAttributeByName Click to go up to the list
Fetch the value of the attribute with name attr.
Declaration:
    function hasAttributes( )
Parameters:
    Parameter #1: string attr - The attribute name.
Returns:
    a string with the value of the atttribute.

function getAttributes Click to go up to the list
Get all the elements attributes as an array
Declaration:
    function getAttributes( )
Returns:
    an array of strings with the attributes.

function getChildren Click to go up to the list
Get all the elements children.
Declaration:
    function getChildren( )
Returns:
    an array of objects of type XML.Element.

function getElementData Click to go up to the list
Retrieve the data of an element node.
Declaration:
    function getElementData()
Returns:
    a string with the data of the element node.

function getElementName Click to go up to the list
Retrieve the name of an element node.
Declaration:
    function getElementName( )
Returns:
    a string containing the name of the element.

function getElementsByTagName Click to go up to the list
Retrieve all elements matching name, name could be an xpath expression.
Declaration:
    function getElementsByTagName( string name )
Parameters:
    Parameter #1: string name - The name of the element to retrieve.
Returns:
    an array of object of type XML.Element.

function getFirstChild Click to go up to the list
Get the first child of an element node.
Declaration:
    function getFirstChild( )
Returns:
    an object of type XML.Element.

function getLastChild Click to go up to the list
Get the last child of an element node.
Declaration:
    function getLastChild( )
Returns:
    an object of type XML.Element.

function getNamespace Click to go up to the list
Get the namespace of an element node.
Declaration:
    function getNamespace( )
Returns:
    an array with the name of the namespace.

function getNextSibling Click to go up to the list
Get the next sibling of an element node.
Declaration:
    function getNextSibling( )
Returns:
    an object of type XML.Element.

function getParent Click to go up to the list
Get the parent element of an element node.
Declaration:
    function getParent( )
Returns:
    an object of type XML.Element.

function getPreviousSibling Click to go up to the list
Get the previous sibling of an element node.
Declaration:
    function getPreviousSibling( )
Returns:
    an object of type XML.Element.

function hasAttribute Click to go up to the list
Check if the current element an attributes with name.
Declaration:
    function hasAttribute( string name )
Parameters:
    Parameter #1: string the - attribute name.
Returns:
    true if the attribute exists, false if otherwise.

function hasAttributes Click to go up to the list
Check if the current element has any attributes.
Declaration:
    function hasAttributes( )
Returns:
    true if there the element has attributes, false otherwise.

function hasChildren Click to go up to the list
Check if an element has children.
Declaration:
    function hasChildren( )
Returns:
    true if the element has children, false otherwise.

function mergeAsChild Click to go up to the list
Merge one xml tree into another as a child tree.
Declaration:
    function mergeAsChild( object chk )
Parameters:
    Parameter #1: object xml - the XML.TreeParser object to merge
Returns:
    an object of type XML.Element on success, null otherwise.

function mergeAsNextSibling Click to go up to the list
Merge one xml tree into another as a child tree. As the next sibling.
Warning!
You can't add a sibling to the root node within a document.
Declaration:
    function mergeAsNextSibling( object chk )
Parameters:
    Parameter #1: object xml - The XML.TreeParser object to merge
Returns:
    an object of type XML.Element on success, null otherwise.

function mergeAsPreviousSibling Click to go up to the list
Merge one xml tree into another tree as the next sibling.
Warning!
You can't add a sibling to the root node within a document.
Declaration:
    function mergeAsPreviousSibling( object chk )
Parameters:
    Parameter #1: object xml - The XML.TreeParser object to merge
Returns:
    an object of type XML.Element on success, null otherwise.

function mergeAsSibling Click to go up to the list
Merge one xml tree into another as a child tree. As a sibling.
Warning!
You can't add a sibling to the root node within a document.
Declaration:
    function mergeAsSibling( object chk )
Parameters:
    Parameter #1: object xml - The XML.TreeParser object to merge.
Returns:
    an object of type XML.Element on success, null otherwise.

function removeAttribute Click to go up to the list
Remove an attribute
Declaration:
    function removeAttribute( string name )
Parameters:
    Parameter #1: string name - The name of the attribute to remove.

function removeChildren Click to go up to the list
Remove all children element to the current node.
Declaration:
    function removeChildren( )
Returns:
    the number of element that has been removed.

function removeChildWithName Click to go up to the list
Remove all children elements with a specific name.
Declaration:
    function removeChildWithName( string name )
Parameters:
    Parameter #1: string name - The name of the element to remove.
Returns:
    the number of element that has been removed.

function removeElementsByTagName Click to go up to the list
Remove all elements with identified by an xpath string.
Declaration:
    function removeElementsByTagName( string name )
Parameters:
    Parameter #1: string name - The string which identifies the lement to be removed.
Returns:
    the number of element that has been removed.

function removeSelf Click to go up to the list
Remove the current element.
Declaration:
    function removeSelf( )

function setAttribute Click to go up to the list
Set the value of an attribute on the current element. If the attribute does not exist it will be created.
Declaration:
    function setAttribute( string name, string value )
Parameters:
    Parameter #1: string name - The name of the attribute to change or add.
    Parameter #2: string value - The value to give to attribute.

function setElementData Click to go up to the list
Change the content of the current element.
Declaration:
    function setElementData( string value )
Parameters:
    Parameter #1: string value - The data to set as element content.

function setElementName Click to go up to the list
Change the name of the current element.
Declaration:
    function setElementName( string name )
Parameters:
    Parameter #1: string name - The new elements name.

function toString Click to go up to the list
return the content of an element and its children as a string.
Declaration:
    function toString( )
Returns:
    a string with the xml data.

Automatically generated at 12:08PM, Wednesday 25 May 2005 by feritedoc.