XMLElement

public class
system.xml.XMLElement

Description

The element is a container class. It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes.

API overview

Constructor

XMLElement ()

Functions

Public functions

deleteAttribute ( name: String ): Void native

Removes an attribute from the XMLElement%s list of attributes

findAttribute ( name: String ): XMLAttribute native

Looks up an XMLAttribute by name

firstAttribute (): XMLAttribute native

Gets the first attribute in the list of attibutes

getAttribute ( name: String , value: String = null ): String native

Looks up a String attribute matched by name and (optional) value

getBoolAttribute ( name: String ): Boolean native

Looks up a Boolean attribute matched by name

getNumberAttribute ( name: String ): Number native

Looks up a Number attribute matched by name

getText (): String native

Convenience function for easy access to the text inside an element

setAttribute ( name: String , value: String ): Void native

Sets a String Attribute on the XMLElement

setBoolAttribute ( name: String , value: Boolean ): Void native

Sets a Boolean Attribute on the XMLElement

setNumberAttribute ( name: String , value: Number ): Void native

Sets a Number Attribute on the XMLElement

value (): String native

Constructor

XMLElement ()

Functions

deleteAttribute ( name: String ): Void

native

Removes an attribute from the XMLElement%s list of attributes.

Parameters

name: String


deleteChild ( node: XMLNode ): Void
Inherited from XMLNode

native

Delete a child belonging to the XMLNode.

Parameters

node: XMLNode The XMLNode to delete.


deleteChildren (): Void
Inherited from XMLNode

native

Delete all the children of the XMLNode.



findAttribute ( name: String ): XMLAttribute

native

Looks up an XMLAttribute by name.

Parameters

name: String

Returns

XMLAttribute Matched XMlAttribute or null if none exist.

firstAttribute (): XMLAttribute

native

Gets the first attribute in the list of attibutes.


Returns

XMLAttribute First XMLAttribute or null of none exist.

firstChild (): XMLNode
Inherited from XMLNode

native

Gets the first child XMLNode.


Returns

XMLNode The first child XMLNode or null if none exist.

firstChildElement ( name: String = null ): XMLElement
Inherited from XMLNode

native

Get the first child XMLElement, or optionally the first child element with the specified name.

Parameters

name: String = null Optional name for finding the first child element by name.

Returns

XMLElement First child XMLElement or null if none exist or if name does not match any child XMLElements.

getAttribute ( name: String , value: String = null ): String

native

Looks up a String attribute matched by name and (optional) value.

Parameters

name: String The name of the attribute to look up.
value: String = null Optional value to match the name against.

Returns

String The String value of the attribute.

getBoolAttribute ( name: String ): Boolean

native

Looks up a Boolean attribute matched by name.

Parameters

name: String The name of the attribute to look up.

Returns

Boolean The Boolean value of the attribute.

getDocument (): XMLDocument
Inherited from XMLNode

native

Gets the XMLDocument that owns the XMLNode.


Returns

XMLDocument The owning XMLDocument.

getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getNumberAttribute ( name: String ): Number

native

Looks up a Number attribute matched by name.

Parameters

name: String The name of the attribute to look up.

Returns

Number The Number value of the attribute.

getParent (): XMLNode
Inherited from XMLNode

native

Gets the parent of this node in the DOM.


Returns

XMLNode The parent of this XMLNode or null if the XMLNode has no parent.

getText (): String

native

Convenience function for easy access to the text inside an element. Although easy and concise, getText() is limited compared to getting the XMLText child and accessing it directly.


Returns

String String if first child is XMLText, null otherwise.

getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

getValue (): String
Inherited from XMLNode

native

Gets the value of the XMLNode. The meaning of 'value' changes based on the type.

Document:   empty
Element:    name of the element
Comment:    the comment text
Unknown:    the tag contents
Text:       the text string


Returns

String The value of the XMLNode.

insertAfterChild ( afterThis: XMLNode , addThis: XMLNode ): XMLNode
Inherited from XMLNode

native

Add an XMLNode after the specified child node.

Parameters

afterThis: XMLNode The relative XMLNode.
addThis: XMLNode The XMLNode to add.

Returns

XMLNode The added XMLNode.

insertEndChild ( addThis: XMLNode ): XMLNode
Inherited from XMLNode

native

Add a child XMLNode as the last (right) child.

Parameters

addThis: XMLNode The XMLNode to add.

Returns

XMLNode The added XMLNode.

insertFirstChild ( addThis: XMLNode ): XMLNode
Inherited from XMLNode

native

Add a child node as the first (left) child.

Parameters

addThis: XMLNode The XMLNode to add.

Returns

XMLNode The added XMLNode.

lastChild (): XMLNode
Inherited from XMLNode

native

Gets the last child XMLNode.


Returns

XMLNode The last child XMLNode or null if none exist.

lastChildElement ( name: String = null ): XMLElement
Inherited from XMLNode

native

Gets the last child XMLElement, or optionally the last child element with the specified name.

Parameters

name: String = null Optional name for finding the last child element by name.

Returns

XMLElement First child XMLElement or null if none exist or if name does not match any child XMLElements.

linkEndChild ( addThis: XMLNode ): XMLNode
Inherited from XMLNode

native

Parameters

addThis: XMLNode


nextSibling (): XMLNode
Inherited from XMLNode

native

Gets the next (right) sibling XMLNode of this node.


Returns

XMLNode Next sibling XMLNode or null if none exist.

nextSiblingElement ( name: String = null ): XMLElement
Inherited from XMLNode

native

Gets the next (right) sibling XMLElement of this node.

Parameters

name: String = null Optional name for finding the next sibling element by name.

Returns

XMLElement Next sibling XMLNode or null if none exist.

noChildren (): Boolean
Inherited from XMLNode

native

Returns true if this node has no children.



previousSibling (): XMLNode
Inherited from XMLNode

native

Gets the previous (left) sibling XMLNode of this node.


Returns

XMLNode Previous sibling XMLNode or null if none exist.

previousSiblingElement ( name: String = null ): XMLElement
Inherited from XMLNode

native

Get the previous (left) sibling XMLElement of this node.

Parameters

name: String = null Optional name for finding the previous sibling element by name.

Returns

XMLElement Previous sibling XMLNode or null if none exist.

setAttribute ( name: String , value: String ): Void

native

Sets a String Attribute on the XMLElement.

Parameters

name: String The name of the attribute to be set.
value: String The value to set for the attribute.


setBoolAttribute ( name: String , value: Boolean ): Void

native

Sets a Boolean Attribute on the XMLElement.

Parameters

name: String The name of the attribute to be set.
value: Boolean The value to set for the attribute.


setNumberAttribute ( name: String , value: Number ): Void

native

Sets a Number Attribute on the XMLElement.

Parameters

name: String The name of the attribute to be set.
value: Number The value to set for the attribute.


setValue ( v: String , staticMem: Boolean = false ): Void
Inherited from XMLNode

native

Sets the value of the XMLNode.

See also:
getValue

Parameters

v: String The value to set.
staticMem: Boolean = false


shallowClone ( doc: XMLDocument ): XMLNode
Inherited from XMLNode

native

Make a copy of this XMLNode, but not its children. You may pass in a Document pointer that will be the owner of the new Node. If the 'document' is null, then the node returned will be allocated from the current Document. (this.getDocument())

@note If called on an XMLDocument, this will return null.

Parameters

doc: XMLDocument The owner of the new XMLNode.

Returns

XMLNode Shallow copy of the XMLNode or null if called on a XMLDocument.

shallowEqual ( compare: XMLNode ): Boolean
Inherited from XMLNode

native

Test if 2 XMLNode%s are the same, but don't test children. The 2 nodes do not need to be in the same XMLDocument.

@note If called on an XMLDocument, this will return false.

Parameters

compare: XMLNode The XMLNode to compare to.

Returns

Boolean Whether or not the XMLNode%s are shallow equals.

toComment (): XMLComment
Inherited from XMLNode

native

Safely cast to an XMLComment.


Returns

XMLComment The casted XMLComment or null if the cast was unsuccessful.

toDeclaration (): XMLDeclaration
Inherited from XMLNode

native

Safely cast to an XMLDeclaration.


Returns

XMLDeclaration The casted XMLDeclaration or null if the cast was unsuccessful.

toDocument (): XMLDocument
Inherited from XMLNode

native

Safely cast to an XMLDocument.


Returns

XMLDocument The casted XMLDocument or null if the cast was unsuccessful.

toElement (): XMLElement
Inherited from XMLNode

native

Safely cast to an XMLElement.


Returns

XMLElement The casted XMLElement or null if the cast was unsuccessful.

toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.

toText (): XMLText
Inherited from XMLNode

native

Safely cast to an XMLText.


Returns

XMLText The casted XMLText or null if the cast was unsuccessful.

value (): String

native



: