com.icl.saxon.axis
Class Axis

java.lang.Object
  |
  +--com.icl.saxon.axis.Axis
Direct Known Subclasses:
AttributeAxis, ChildAxis, DescendantAxis, DescendantOrSelfAxis, ParentAxis, SelfAxis

public abstract class Axis
extends java.lang.Object

An axis, that is a direction of navigation in the document structure.


Field Summary
protected  NodeTest nodeTest
           
 
Constructor Summary
Axis()
           
 
Method Summary
abstract  NodeEnumeration getEnumeration(NodeInfo node)
          Return an enumeration over the nodes reached by the given axis from a specified node
 short getPrincipalNodeType()
          Get the principal node type for the axis.
abstract  boolean isPeer()
          An axis has the peer property if no node in the result is an ancestor of another (redundant: if this is true the sibling property will also be true)
 boolean isReverseSorted()
          If an axis is not in document order, then it is in reverse document order
abstract  boolean isSibling()
          An Axis has the sibling property if all the nodes it returns have the same parent
abstract  boolean isSorted()
          An Axis has the sorted property if it returns nodes in document order
abstract  boolean isWithinSubtree()
          An axis has the withinSubtree property if all the nodes it returns are in the subtree rooted at the start node, that is if it is a subset of the descendants-of-self axis
static Axis make(java.lang.String name)
          resolve an axis name into a symbolic constant representing the axis
 void setNodeTest(NodeTest test)
          Set the name and node type test required by the axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeTest

protected NodeTest nodeTest
Constructor Detail

Axis

public Axis()
Method Detail

make

public static Axis make(java.lang.String name)
                 throws org.xml.sax.SAXException
resolve an axis name into a symbolic constant representing the axis

getPrincipalNodeType

public short getPrincipalNodeType()
Get the principal node type for the axis. This is the default node type, and is Node.ELEMENT for all axes except the Attribute and Namespace axes

setNodeTest

public void setNodeTest(NodeTest test)
Set the name and node type test required by the axis.
Parameters:
test - A NodeTest object

getEnumeration

public abstract NodeEnumeration getEnumeration(NodeInfo node)
                                        throws org.xml.sax.SAXException
Return an enumeration over the nodes reached by the given axis from a specified node
Parameters:
node - NodeInfo representing the node from which the enumeration starts
nodeType - the type(s) of node to be included, e.g. NodeInfo.ELEMENT, NodeInfo.TEXT. The value NodeInfo.NODE means include any type of node.
nodeNameTest - include only nodes with this name (e.g. an element name). Set this to null to include nodes of any name.
Returns:
a NodeEnumeration that scans the nodes reached by the axis in turn.
Throws:
org.xml.sax.SAXException - if an invalid axis is specified

isSorted

public abstract boolean isSorted()
An Axis has the sorted property if it returns nodes in document order

isReverseSorted

public boolean isReverseSorted()
If an axis is not in document order, then it is in reverse document order

isSibling

public abstract boolean isSibling()
An Axis has the sibling property if all the nodes it returns have the same parent

isPeer

public abstract boolean isPeer()
An axis has the peer property if no node in the result is an ancestor of another (redundant: if this is true the sibling property will also be true)

isWithinSubtree

public abstract boolean isWithinSubtree()
An axis has the withinSubtree property if all the nodes it returns are in the subtree rooted at the start node, that is if it is a subset of the descendants-of-self axis