Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC

Class TElement

An element in a DOM XML document. An element is characterized by its tag name and by a set of attributes. Each attribute has a name and a value.

Method Summary
addAttribute
         Specifies the value of an attribute for the element.
addNode
         Adds a node to the list of children of this element.
constructor
constructor tagName
constructor tagName attrs
         Initializes the object internal state and specifies its tag name.
getAttribute attrName
         Fetches the value of one of the elements' attributes.
getAttributeNames
         Fetches the names of all current attributes.
getAttributes
         Fetches the set of all current attributes.
getChildren
         Fetches the list of children of the element.
getNodeType
         Retrieves the type of this node object.
getTagName
         Fetches the tag name for this element.
setAttributes
         Specifies the set of attributes for this element.

Method Detail

addAttribute

TElement addAttribute

Specifies the value of an attribute for the element.

Parameters:
attrName - A string representing the name of the attribute to add.
attrValue - A string representing the value of the attribute being added.
Returns:
A reference to the object for which this method was called.


addNode

TElement addNode

Adds a node to the list of children of this element.

Parameters:
node - The new child node to add.
Returns:
A reference to the object for which this method was called.


constructor

TElement constructor
TElement constructor tagName
TElement constructor tagName attrs

Initializes the object internal state and specifies its tag name.

Parameters:
tagName - A string representing the tag name for this element.
attrs - A THashtable containing the attributes for this element.


getAttribute

TElement getAttribute attrName

Fetches the value of one of the elements' attributes.

Parameters:
attrName - A string representing the name of the attribute to retrieved.
Returns:
The value of the attribute named attrName

If this element has no attribute named attrName then a null is returned.

getAttributeNames

TElement getAttributeNames

Fetches the names of all current attributes.

Returns:
A list of strings representing the names of the current attributes.

The strings in the list are not guaranteed to be in the same order the attributes were added with calls to addAttribute.

getAttributes

TElement getAttributes

Fetches the set of all current attributes.

Returns:
A THashtable containing the attributes.


getChildren

TElement getChildren

Fetches the list of children of the element.

Returns:
A list containing the children of this element.

The order of child nodes in the returned list is the same they were added by calls to the addNode method.

getNodeType

TElement getNodeType

Retrieves the type of this node object.

Returns:
A symbol representing the type of this node object.

For the case of a TElement the symbol Element is returned.

getTagName

TElement getTagName

Fetches the tag name for this element.

Returns:
The tag name for this element specified at constructor time.


setAttributes

TElement setAttributes

Specifies the set of attributes for this element.

Parameters:
attrs - A THashtable containing the attributes for this element.
Returns:
A reference to the object for which this method was called.



Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC
Report a bug or request new features
© 2002