Class ForEachFn

All Implemented Interfaces:
Callable, Function, GroundedValue, Item, Sequence

public class ForEachFn extends SystemFunction
This class implements the function fn:for-each() (formerly fn:map), which is a standard function in XQuery 3.0
  • Constructor Details

    • ForEachFn

      public ForEachFn()
  • Method Details

    • getResultItemType

      public ItemType getResultItemType(Expression[] args)
      Get the return type, given knowledge of the actual arguments
      Overrides:
      getResultItemType in class SystemFunction
      Parameters:
      args - the actual arguments supplied
      Returns:
      the best available item type that the function will return
    • call

      public Sequence call(XPathContext context, Sequence[] arguments) throws XPathException
      Description copied from interface: Function
      Invoke the function
      Parameters:
      context - the XPath dynamic evaluation context
      arguments - the actual arguments to be supplied
      Returns:
      the result of invoking the function
      Throws:
      XPathException - if a dynamic error occurs within the function