Enum Class Axis

java.lang.Object
java.lang.Enum<Axis>
net.sf.saxon.s9api.Axis
All Implemented Interfaces:
Serializable, Comparable<Axis>, Constable

public enum Axis extends Enum<Axis>
This is an enumeration class containing constants representing the thirteen axes available in XPath versions from 1.0 to 3.1, together with four new axes defined experimentally in XPath 4.0.
  • Enum Constant Details

    • ANCESTOR

      public static final Axis ANCESTOR
      The ancestor axis: contains a node's parent, the parent's parent, and so on, up to the root of the tree.
    • ANCESTOR_OR_SELF

      public static final Axis ANCESTOR_OR_SELF
      The ancestor-or-self axis: contains the ancestors of a node together with the node itself
    • ATTRIBUTE

      public static final Axis ATTRIBUTE
      The attribute axis. For an element this contains the attributes of the element (these do not include namespace declarations); for other node kinds the axis is empty.
    • CHILD

      public static final Axis CHILD
      The child axis. For a document or element node this contains the children of the node, which will all be elements, text nodes, comments, or processing instructions. For other node kinds the axis is empty.
    • DESCENDANT

      public static final Axis DESCENDANT
      The descendant axis. Contains the children of the node, and their children, expanded recursively.
    • DESCENDANT_OR_SELF

      public static final Axis DESCENDANT_OR_SELF
      The descendant-or-self axis. Contains the descendants of a node together with the node itself.
    • FOLLOWING

      public static final Axis FOLLOWING
      The following axis. Contains all nodes that follow the origin node in document order, other than its descendants.
    • FOLLOWING_OR_SELF

      public static final Axis FOLLOWING_OR_SELF
      The following-or-self axis. Contains all nodes on the following axis, together with the origin node itself. This is newly defined in the draft XPath 4.0 specification which is subject to change.
    • FOLLOWING_SIBLING

      public static final Axis FOLLOWING_SIBLING
      The following-sibling axis. Contains all children of the origin node's parent that follow the origin node in document order. The axis is empty in the case of a node that has no parent, or that is the last child of its parent.
    • FOLLOWING_SIBLING_OR_SELF

      public static final Axis FOLLOWING_SIBLING_OR_SELF
      The following-sibling-or-self axis. Contains all nodes on the following-sibling axis, together with the origin node itself. This is newly defined in the draft XPath 4.0 specification which is subject to change.
    • PARENT

      public static final Axis PARENT
      The parent axis. Contains the origin node's parent; the axis is empty in the case of a node that has no parent.
    • PRECEDING

      public static final Axis PRECEDING
      The preceding axis. Contains all nodes that precede the origin node in document order, other than its ancestors.
    • PRECEDING_OR_SELF

      public static final Axis PRECEDING_OR_SELF
      The preceding-or-self axis. Contains all nodes on the preceding axis, together with the origin node itself. This is newly defined in the draft XPath 4.0 specification which is subject to change.
    • PRECEDING_SIBLING

      public static final Axis PRECEDING_SIBLING
      The following-sibling axis. Contains all children of the origin node's parent that precede the origin node in document order. The axis is empty in the case of a node that has no parent, or that is the first child of its parent.
    • PRECEDING_SIBLING_OR_SELF

      public static final Axis PRECEDING_SIBLING_OR_SELF
      The preceding-sibling-or-self axis. Contains all nodes on the preceding-sibling axis, together with the origin node itself. This is newly defined in the draft XPath 4.0 specification which is subject to change.
    • SELF

      public static final Axis SELF
      The self axis. Contains the origin node only.
    • NAMESPACE

      public static final Axis NAMESPACE
      The namespace axis. For an element node, this contains one namespace node for each in-scope namespace declaration, that is, a namespace declared either on the element itself, or on an ancestor element (if not overridden); also contains a namespace node for the implicitly-declared XML namespace. For other node kinds the axis is empty.
  • Method Details

    • values

      public static Axis[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Axis valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getAxisNumber

      public int getAxisNumber()
      Get the axis number, as defined in class AxisInfo
      Returns:
      the axis number