Main Page | Packages | Class Tree | Index | Help

xp.data

class XPNode

XMLNode
  |
  +--xp.data.XPNode


class XPNode
extends XMLNode

XMLNode mixin


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Field Summary

public static
nodeFactory: XML


public
parent: Object
A parent or host object to route events to

Method Summary


__resolve ( id )
internal resolver

public
addTreeNode ( node: XMLNode ): XMLNode
Appends a child node at tp the parentNode.

public
addTreeNodeAt ( index: Number, node: XMLNode ): XMLNode
Adds a child node at a specified location on the parent node

public static
filterNodes ( nodes: Array, filter: String ): Array
Select a set of nodes based on an attributes value

public
getDepth ( node: XMLNode )
Returns the number of levels between the specifed child node and this node

public
getDocumentElement ( )
Returns the document element of the current document


getFieldValue ( field: String ): Object
Get the value of the specified child node or attribute

public
getNodeIndex ( ): Number
Returns the index a node in its parentNodes childNodes array.

public
getRootNode ( ): XMLNode
Returns the root of document

public
getTreeNodeAt ( index: Number ): XMLNode
Returns the specified child of a node.


getValue ( )
Get the value of a node

public static
Initialize ( ): Boolean
mixin the properties to the obj

public
removeAll ( ): Void
Removes all the node’s descendants.

public
removeTreeNode ( ): XMLNode
Removes a node and all the node’s descendants from the node’s parent.

public
removeTreeNodeAt ( index: Number ): XMLNode
Removes a node and all the node’s descendants from the index position of the child node in its parentNode

public
routeEvent ( e: Event ): Void
Routes an event to the parent if the routeEvents property is true.

public
selectNodes ( xpath: String ): Array
Select nodes using an xpath statement

public
selectSingleNode ( xpath: String ): Array
Select a node using an xpath statement

public static
selectXMLNodes ( xmlnode, path: Array ): Array
Select nodes based on the given path


setFieldValue ( field: String, v: Object ): Void
Set the value of the specified child node or attribute


setValue ( v )
Set the value of a node



Field Documentation

nodeFactory

public static var nodeFactory: XML

parent

public var parent: Object
A parent or host object to route events to


Method Documentation

__resolve

function __resolve(id)
internal resolver

addTreeNode

public function addTreeNode(node: XMLNode): XMLNode
Appends a child node at tp the parentNode.

Appends a child node to the parent node

Parameters:
node
Any XMLNode object
Returns:
The newly added node

addTreeNodeAt

public function addTreeNodeAt(index: Number,
 node: XMLNode): XMLNode
Adds a child node at a specified location on the parent node

Adds a child node at the specified location in the parent node

Parameters:
index
An integer that indicates the index position (among the child nodes) at which the node should be added.
node
Any XMLNode object
Returns:
The newly added node

filterNodes

public static function filterNodes(nodes: Array,
 filter: String): Array
Select a set of nodes based on an attributes value

Parameters:
nodes
An array of nodes
filter
The filter string ie @name=Fred

getDepth

public function getDepth(node: XMLNode)
Returns the number of levels between the specifed child node and this node

If the specified node is not a child of this than -1 is return

Returns:
The depth of the child node

getDocumentElement

public function getDocumentElement()
Returns the document element of the current document

The document may be an XML or XMLNode object. If the document is an XML object the doc element is the first child otherwise if it is an XMLNode it is document itself.

getFieldValue

function getFieldValue(field: String): Object
Get the value of the specified child node or attribute

getNodeIndex

public function getNodeIndex(): Number
Returns the index a node in its parentNodes childNodes array.

Returns the index a node in its parentNodes childNodes array.

Returns:
An integer representing the position of the node in the parent node.

getRootNode

public function getRootNode(): XMLNode
Returns the root of document

Returns the root of a document. The root of a document has one child element, the document element. RootNode is also used to define the root of a tree when binding to a node in an XML document. In that case RootNode and DocumentElement are the same. Note the root element is the firstChild of root.

Returns:
The root node

getTreeNodeAt

public function getTreeNodeAt(index: Number): XMLNode
Returns the specified child of a node.

Returns the specified child node of the node.

Parameters:
index
An integer representing the position of the child node in the current node.
Returns:
The specified node.

getValue

function getValue()
Get the value of a node

Initialize

public static function Initialize(): Boolean
mixin the properties to the obj

removeAll

public function removeAll(): Void
Removes all the node’s descendants.

Removes all child nodes

removeTreeNode

public function removeTreeNode(): XMLNode
Removes a node and all the node’s descendants from the node’s parent.

Removes a child node from its parent node

Returns:
The removed node

removeTreeNodeAt

public function removeTreeNodeAt(index: Number): XMLNode
Removes a node and all the node’s descendants from the index position of the child node in its parentNode

Appends a child node to the parent node

Parameters:
index
An integer indicating the position of the node to be removed.
Returns:
The removed node

routeEvent

public function routeEvent(e: Event): Void
Routes an event to the parent if the routeEvents property is true.

Parameters:
e
A reference to an event object. The event object must have a type property that is a string indicating the name of the event. Generally, the event object also has a target property that is the name of the instance broadcasting the event. You can define other properties on the event object that will help a user capture information about the event when it is dispatched.

selectNodes

public function selectNodes(xpath: String): Array
Select nodes using an xpath statement

Parameters:
xpath
An xpath statement

selectSingleNode

public function selectSingleNode(xpath: String): Array
Select a node using an xpath statement

Parameters:
xpath
An xpath statement

selectXMLNodes

public static function selectXMLNodes(xmlnode,
 path: Array): Array
Select nodes based on the given path

Parameters:
xmlnode
an XMLNode
path
A path

setFieldValue

function setFieldValue(field: String,
 v: Object): Void
Set the value of the specified child node or attribute

setValue

function setValue(v)
Set the value of a node


The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc