org.ucl.xpath.function
Class FnSubstring

java.lang.Object
  extended byorg.ucl.xpath.function.Function
      extended byorg.ucl.xpath.function.FnSubstring

public class FnSubstring
extends Function

Function to obtain a substring from a string.

Usage: fn:substring($sourceString as xs:string?, $startingLoc as xs:double) as xs:string

This class returns the portion of the value of $sourceString beginning at the position indicated by the value of $startingLoc. The characters returned do not extend beyond $sourceString. If $startingLoc is zero or negative, only those characters in positions greater than zero are returned.

If the value of $sourceString is the empty sequence, the zero-length string is returned.

The first character of a string is located at position 1, not position 0.


Field Summary
 
Fields inherited from class org.ucl.xpath.function.Function
_arity, _fl, _name
 
Constructor Summary
FnSubstring()
          Constructor for FnSubstring
 
Method Summary
 ResultSequence evaluate(java.util.Collection args)
          Evaluate the arguments.
static java.util.Collection expected_args()
          Calculate the expected arguments.
static ResultSequence substring(java.util.Collection args)
          Obtain a substring from the arguments.
 
Methods inherited from class org.ucl.xpath.function.Function
arity, convert_argument, convert_arguments, dynamic_context, name, set_function_library, signature, signature, signature, static_context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FnSubstring

public FnSubstring()
Constructor for FnSubstring

Method Detail

evaluate

public ResultSequence evaluate(java.util.Collection args)
                        throws DynamicError
Evaluate the arguments.

Specified by:
evaluate in class Function
Parameters:
args - are evaluated.
Returns:
The evaluation of the substring obtained from the arguments.
Throws:
DynamicError - Dynamic error.

substring

public static ResultSequence substring(java.util.Collection args)
                                throws DynamicError
Obtain a substring from the arguments.

Parameters:
args - are used to obtain a substring.
Returns:
The result of obtaining a substring from the arguments.
Throws:
DynamicError - Dynamic error.

expected_args

public static java.util.Collection expected_args()
Calculate the expected arguments.

Returns:
The expected arguments.