Class AtomicMappingExpression

All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, ContextMappingFunction, EvaluableItem, SequenceIterable, InstructionInfo, Locator

public final class AtomicMappingExpression extends SlashExpression implements ContextMappingFunction
An atomic mapping expression is a slash expression A/B where B has a static type that is an atomic type. For example, * / name().
See Also:
  • Constructor Details

    • AtomicMappingExpression

      public AtomicMappingExpression(Expression start, Expression step)
      Constructor
      Parameters:
      start - A node-set expression denoting the absolute or relative set of nodes from which the navigation path should start.
      step - The step to be followed from each node in the start expression to yield a new node-set
  • Method Details

    • isHybrid

      public boolean isHybrid()
      Determine whether this expression is capable (as far as static analysis is concerned) of returning a mixture of nodes and atomic values. If so, this needs to be prevented at run time
      Overrides:
      isHybrid in class SlashExpression
      Returns:
      true if the static type allows both nodes and atomic values
    • typeCheck

      public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
      Type-check the expression
      Overrides:
      typeCheck in class SlashExpression
      Parameters:
      visitor - an expression visitor
      contextItemType - the static type of "." at the point where this expression is invoked. The parameter is set to null if it is known statically that the context item will be undefined. If the type of the context item is not known statically, the argument is set to Type.ITEM_TYPE
      Returns:
      the original expression, rewritten to perform necessary run-time type checks, and to perform other type-related optimizations
    • copy

      public Expression copy()
      Copy an expression. This makes a deep copy.
      Overrides:
      copy in class SlashExpression
      Returns:
      the copy of the original expression
    • iterate

      public SequenceIterator iterate(XPathContext context) throws XPathException
      Iterate the path-expression in a given context
      Specified by:
      iterate in interface SequenceIterable
      Overrides:
      iterate in class SlashExpression
      Parameters:
      context - the evaluation context
      Returns:
      a SequenceIterator that can be used to iterate over the result of the expression
      Throws:
      XPathException - if any dynamic error occurs evaluating the expression
    • explain

      public void explain(ExpressionPresenter destination)
      Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.
      Overrides:
      explain in class SlashExpression
      Parameters:
      destination - the expression presenter used to display the structure