Class Lang

All Implemented Interfaces:
Callable, IContextAccessorFunction, IFunctionWithRetainedParameterNames, FunctionItem, GroundedValue, Item, Sequence

public class Lang extends SystemFunction implements IContextAccessorFunction
  • Constructor Details

    • Lang

      public Lang()
  • Method Details

    • dependsOnContext

      public boolean dependsOnContext()
      Description copied from interface: IContextAccessorFunction
      Ask whether this function is actually dependent on the dynamic context
      Specified by:
      dependsOnContext in interface IContextAccessorFunction
      Returns:
      true if the function cannot be used unless the dynamic context is first bound
    • isLang

      public static boolean isLang(String arglang, NodeInfo target)
      Test whether the context node has the given language attribute
      Parameters:
      arglang - the language being tested
      target - the target node
      Returns:
      true if the node is tagged with this language code
    • call

      public BooleanValue call(XPathContext context, Sequence[] arguments) throws XPathException
      Evaluate the expression
      Specified by:
      call in interface Callable
      Parameters:
      context - the dynamic evaluation context
      arguments - the values of the arguments, supplied as SequenceIterators
      Returns:
      the result of the evaluation, in the form of a SequenceIterator
      Throws:
      XPathException - if a dynamic error occurs during the evaluation of the expression
    • bindContext

      public FunctionItem bindContext(XPathContext context) throws XPathException
      Bind context information to appear as part of the function's closure. If this method has been called, the supplied context will be used in preference to the context at the point where the function is actually called.
      Specified by:
      bindContext in interface IContextAccessorFunction
      Parameters:
      context - the context to which the function applies. Must not be null.
      Throws:
      XPathException