
Gestinanna::XSM::Expression - utilities for XSM expressions

$root = axis_self($root); @children = axis_child($root, $selector); @child_or_self = axis_child_or_self($root, $selector); @descendents = axis_descendent($root, $selector);

These utility functions are used in compiled XSM expressions to handle the various axes as well as miscellanous things such as comparisons.

$root = axis_self($root, $selector);
Regardless of the selector, this will return to current position in the data structure pointed to by $root.
@children = axis_child($root, $selector);
Returns any immediate children of $root which match the selector. If the root is an array, then the selector is expected to be numeric. If the root is a hash, then it is expected to be a string corresponding to a key within the hash. If the root is an object, then the selector is expected to be the name of a method. If the selector is *, then all children are returned if the root is not an object.
@children_or_self = axis_child_or_self($root, $selector);
This returns the same results as axis_child except that the first element in the returned list is the root.