# Standard xne reference

Xne

The `Xne` is a nameset that binds constants used by the xne system.

ID

The `ID` constant defines a node access by id.

NAME

The `NAME` constant defines a node access by name.

INDEX

The `INDEX` constant defines a node access by child index. The child index is node index seen from the parent.

XneTree

The `XneTree` is the xne node tree manipulation class. The class operates with a node and provides numerous methods to manipulate the tree as well as changing it. Before a tree is manipulated, it is recommended to make a copy of such tree with the help of the node `copy` method.

xne-tree-p
Object
XmlTree
none

The `XmlTree` constructor creates a default tree without a node.

XmlTree
XmlNode

The `XmlTree` constructor creates a tree with a xml node. The node stored in the object is the root of the tree subject to the operations.

depth
Integer
none

The `depth` method returns the depth of the tree.

generate-id
Integer
none

The `generate-id` method generate a unique id for all node in the tree. The id attribute is set by this method.

set-node
none
XmlNode

The `set-node` method sets the root tree node.

get-node
XmlNode
none

The `get-node` method returns the root tree node.

set-attribute
none
none|String

The `set-attribute` method sets an attribute to the whole tree. In the first form, the attribute is set to the whole tree. In the second form with a string argument, the attribute is set only on the tag node those name matches the name argument.

clear-attribute
none
none|String

The `clear-attribute` method clear all attributes of the nodes in the tree. In the first form, the node attributes are cleared for all nodes in the tree. In the second form with a string argument, the attributes are cleared only with the tag node those name matches the name argument.

set-prefix
none
String

The `set-prefix` method sets a prefix on all nodes in the tree.

clear-prefix
none
none

The `clear-prefix` method clear the prefix for all nodes in the tree.

select
Vector
XneCond {Boolean]

The `select` method selects the node in the tree taht matches the condition argument. In the first form, with one argument, the whole tree is searched. In the seaond form, with a boolean argument, the whole tree is searched if the second argument is false. If the boolean argument is true, the method call behaves like a call with the condition only.

XneChild

The `XneCond` is the xne condition class. The sole purpose of this class is to define one or several condition that a node must satisfy in order to be selected. The condition are accumulated in a list and later checked for a particular node. Note that an empty condition always succeds.

xne-cond-p
Object
XneCond
none

The `XneCond` constructor creates a default condition. The default condition is empty. The empty condition always succeds.

add
none
Xne [String|Integer]

The `add` adds a condition by type. The first argument is the conditiontype. The second argument is a condition information such like a string or an integer.

valid-p
Boolean
XmlNode

The `valid-p` predicate checks that a node matches a condition. If the condition succeeds, the predicate returns true.