Class Tokenize

All Implemented Interfaces:
Serializable, SourceLocator, Container, Expression, InstructionInfoProvider

public class Tokenize extends SystemFunction
This class implements the tokenize() function for regular expression matching. This returns a sequence of strings representing the unmatched substrings: the separators which match the regular expression are not returned.
See Also:
  • Constructor Details

    • Tokenize

      public Tokenize()
  • Method Details

    • simplify

      public Expression simplify(StaticContext env) throws XPathException
      Simplify and validate. This is a pure function so it can be simplified in advance if the arguments are known
      Specified by:
      simplify in interface Expression
      Overrides:
      simplify in class FunctionCall
      Parameters:
      env - the static context
      Returns:
      the simplified expression
      Throws:
      XPathException - if an error is discovered during expression rewriting
    • iterate

      public SequenceIterator iterate(XPathContext c) throws XPathException
      Iterate over the results of the function
      Specified by:
      iterate in interface Expression
      Overrides:
      iterate in class ComputedExpression
      Parameters:
      c - supplies the context for evaluation
      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
    • main

      public static void main(String[] args) throws Exception
      Simple command-line interface for testing.
      Parameters:
      args - (1) the string to be tokenized (2) the regular expression
      Throws:
      Exception