uk.apl.jxc
Enum XSLTFunction

java.lang.Object
  extended by java.lang.Enum<XSLTFunction>
      extended by uk.apl.jxc.XSLTFunction
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<XSLTFunction>

public enum XSLTFunction
extends java.lang.Enum<XSLTFunction>

Enumeration of XSLT functions available in XMLFilter and XMLMapper.

Author:
Andrew Leigh

Nested Class Summary
static class XSLTFunction.XSLTSpecification
          Enumeration of the XSLT specifications used
 
Enum Constant Summary
ABS
          number abs(number) (XSLT 2.0)
ADJUSTDATETIMETOTIMEZONE
          dateTime adjust-dateTime-to-timezone(dateTime, timezone) (XSLT 2.0)
ADJUSTDATETOTIMEZONE
          date adjust-date-to-timezone(date, timezone) (XSLT 2.0)
ADJUSTTIMETOTIMEZONE
          time adjust-time-to-timezone(time, timezone) (XSLT 2.0)
AVG
          number avg(node-set) (XSLT 2.0)
CEILING
          number ceiling(node-set) (XSLT 1.0)
COMPARE
          number compare(comp1, comp2) (XSLT 2.0)
CONCAT
          string concat(string, string, string*) (XSLT 1.0)
CONTAINS
          boolean contains(string, string) (XSLT 1.0)
COUNT
          number count(node-set) (XSLT 1.0)
DATETIME
          dateTime date-time(date, time) (XSLT 2.0)
DAYFROMDATE
          number day-from-date(date) (XSLT 2.0)
DAYFROMDATETIME
          number day-from-dateTime(datetime) (XSLT 2.0)
DAYSFROMDURATION
          number days-from-duration(datetimedur) (XSLT 2.0)
ENDSWITH
          boolean ends-with(string1, string2) (XSLT 2.0)
FLOOR
          number floor(node-set) (XSLT 1.0)
HOURSFROMDATETIME
          number hours-from-dateTime(datetime) (XSLT 2.0)
HOURSFROMDURATION
          number hours-from-duration(datetimedur) (XSLT 2.0)
HOURSFROMTIME
          number hours-from-time(time) (XSLT 2.0)
LOWERCASE
          string lower-case(string) (XSLT 2.0)
MATCHES
          boolean matches(string1, string2) (XSLT 2.0)
MAX
          number max(node-set) (XSLT 2.0)
MEAN
          number (sum(node-set) div count(node-set)) (Custom)
MIN
          number min(node-set) (XSLT 2.0)
MINUTESFROMDATETIME
          number minutes-from-dateTime(datetime) (XSLT 2.0)
MINUTESFROMDURATION
          number minutes-from-duration(datetimedur) (XSLT 2.0)
MINUTESFROMTIME
          number minutes-from-time(time) (XSLT 2.0)
MONTHFROMDATE
          number month-from-date(date) (XSLT 2.0)
MONTHFROMDATETIME
          number month-from-dateTime(datetime) (XSLT 2.0)
MONTHSFROMDURATION
          number months-from-duration(datetimedur) (XSLT 2.0)
NORMALIZESPACE
          string normalize-space(string) (XSLT 2.0)
NUMBER
          number number(object?) (XSLT 1.0)
REPLACE
          string replace(string, pattern, replace) (XSLT 2.0)
ROUND
          number round(number) (XSLT 1.0)
ROUNDHALFTOEVEN
          number round-half-to-even(number) (XSLT 2.0)
SECONDSFROMDATETIME
          number seconds-from-dateTime(datetime) (XSLT 2.0)
SECONDSFROMDURATION
          number seconds-from-duration(datetimedur) (XSLT 2.0)
SECONDSFROMTIME
          number seconds-from-time(time) (XSLT 2.0)
STARTSWITH
          boolean starts-with(string, string) (XSLT 1.0)
STRING
          string string(object?) (XSLT 1.0)
STRINGJOIN
          string string-join((string, string), sep) (XSLT 2.0)
STRINGLENGTH
          number string-length(string) (XSLT 2.0)
SUBSTRING
          string substring(string, number, number?) (XSLT 1.0)
SUBSTRINGAFTER
          string substring-after(string, number) (XSLT 1.0)
SUBSTRINGBEFORE
          string substring-before(string, number) (XSLT 1.0)
SUM
          number sum(node-set) (XSLT 1.0)
TIMEZONEFROMDATE
          string timezone-from-date(date) (XSLT 2.0)
TIMEZONEFROMDATETIME
          string timezone-from-dateTime(datetime) (XSLT 2.0)
TIMEZONEFROMTIME
          string timezone-from-time(time) (XSLT 2.0)
TRANSLATE
          string translate(string1, string2, string3) (XSLT 2.0)
UPPERCASE
          string upper-case(string) (XSLT 2.0)
YEARFROMDATE
          number year-from-date(date) (XSLT 2.0)
YEARFROMDATETIME
          number year-from-dateTime(datetime) (XSLT 2.0)
YEARSFROMDURATION
          number years-from-duration(datetimedur) (XSLT 2.0)
 
Field Summary
static XSLTFunction[] XSLT1_FUNCS
          Array of all XSLT 1.0 functions.
static XSLTFunction[] XSLT2_FUNCS
          Array of all XSLT 2.0 functions.
 
Method Summary
 java.lang.String getArgPrompt(int arg)
          Returns a prompt for the function argument at a given position.
static XSLTFunction[] getFunctionsForWorkingSpec()
          Returns functions allowed for the current working specification.
 int getMinimumArgsCount()
          Returns the minimum number of arguments required by the function.
 XSLTFunction.XSLTSpecification getSpecification()
          Returns the XSLT specification from which the function is derived.
static XSLTFunction.XSLTSpecification getWorkingSpec()
          Returns the current working XSLT specification.
 boolean isStringArg(int arg)
          Determines if the argument at a given position is a string.
static void setWorkingSpec(XSLTFunction.XSLTSpecification spec)
          Sets the working XSLT Specification.
 java.lang.String toString()
          Overridden to use actual XSLT function names.
 java.lang.String toXSL(java.lang.String argsStr)
          Returns a String formatted for inclusion in an XSL stylesheet of the function applied to argsStr.
static XSLTFunction valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static XSLTFunction[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ABS

public static final XSLTFunction ABS
number abs(number) (XSLT 2.0)


AVG

public static final XSLTFunction AVG
number avg(node-set) (XSLT 2.0)


CEILING

public static final XSLTFunction CEILING
number ceiling(node-set) (XSLT 1.0)


COUNT

public static final XSLTFunction COUNT
number count(node-set) (XSLT 1.0)


FLOOR

public static final XSLTFunction FLOOR
number floor(node-set) (XSLT 1.0)


MIN

public static final XSLTFunction MIN
number min(node-set) (XSLT 2.0)


MAX

public static final XSLTFunction MAX
number max(node-set) (XSLT 2.0)


MEAN

public static final XSLTFunction MEAN
number (sum(node-set) div count(node-set)) (Custom)


NUMBER

public static final XSLTFunction NUMBER
number number(object?) (XSLT 1.0)


ROUND

public static final XSLTFunction ROUND
number round(number) (XSLT 1.0)


ROUNDHALFTOEVEN

public static final XSLTFunction ROUNDHALFTOEVEN
number round-half-to-even(number) (XSLT 2.0)


SUM

public static final XSLTFunction SUM
number sum(node-set) (XSLT 1.0)


CONCAT

public static final XSLTFunction CONCAT
string concat(string, string, string*) (XSLT 1.0)


CONTAINS

public static final XSLTFunction CONTAINS
boolean contains(string, string) (XSLT 1.0)


MATCHES

public static final XSLTFunction MATCHES
boolean matches(string1, string2) (XSLT 2.0)


NORMALIZESPACE

public static final XSLTFunction NORMALIZESPACE
string normalize-space(string) (XSLT 2.0)


REPLACE

public static final XSLTFunction REPLACE
string replace(string, pattern, replace) (XSLT 2.0)


STARTSWITH

public static final XSLTFunction STARTSWITH
boolean starts-with(string, string) (XSLT 1.0)


ENDSWITH

public static final XSLTFunction ENDSWITH
boolean ends-with(string1, string2) (XSLT 2.0)


STRING

public static final XSLTFunction STRING
string string(object?) (XSLT 1.0)


STRINGJOIN

public static final XSLTFunction STRINGJOIN
string string-join((string, string), sep) (XSLT 2.0)


STRINGLENGTH

public static final XSLTFunction STRINGLENGTH
number string-length(string) (XSLT 2.0)


SUBSTRING

public static final XSLTFunction SUBSTRING
string substring(string, number, number?) (XSLT 1.0)


SUBSTRINGBEFORE

public static final XSLTFunction SUBSTRINGBEFORE
string substring-before(string, number) (XSLT 1.0)


SUBSTRINGAFTER

public static final XSLTFunction SUBSTRINGAFTER
string substring-after(string, number) (XSLT 1.0)


TRANSLATE

public static final XSLTFunction TRANSLATE
string translate(string1, string2, string3) (XSLT 2.0)


UPPERCASE

public static final XSLTFunction UPPERCASE
string upper-case(string) (XSLT 2.0)


LOWERCASE

public static final XSLTFunction LOWERCASE
string lower-case(string) (XSLT 2.0)


DATETIME

public static final XSLTFunction DATETIME
dateTime date-time(date, time) (XSLT 2.0)


YEARSFROMDURATION

public static final XSLTFunction YEARSFROMDURATION
number years-from-duration(datetimedur) (XSLT 2.0)


MONTHSFROMDURATION

public static final XSLTFunction MONTHSFROMDURATION
number months-from-duration(datetimedur) (XSLT 2.0)


DAYSFROMDURATION

public static final XSLTFunction DAYSFROMDURATION
number days-from-duration(datetimedur) (XSLT 2.0)


HOURSFROMDURATION

public static final XSLTFunction HOURSFROMDURATION
number hours-from-duration(datetimedur) (XSLT 2.0)


MINUTESFROMDURATION

public static final XSLTFunction MINUTESFROMDURATION
number minutes-from-duration(datetimedur) (XSLT 2.0)


SECONDSFROMDURATION

public static final XSLTFunction SECONDSFROMDURATION
number seconds-from-duration(datetimedur) (XSLT 2.0)


YEARFROMDATETIME

public static final XSLTFunction YEARFROMDATETIME
number year-from-dateTime(datetime) (XSLT 2.0)


MONTHFROMDATETIME

public static final XSLTFunction MONTHFROMDATETIME
number month-from-dateTime(datetime) (XSLT 2.0)


DAYFROMDATETIME

public static final XSLTFunction DAYFROMDATETIME
number day-from-dateTime(datetime) (XSLT 2.0)


HOURSFROMDATETIME

public static final XSLTFunction HOURSFROMDATETIME
number hours-from-dateTime(datetime) (XSLT 2.0)


MINUTESFROMDATETIME

public static final XSLTFunction MINUTESFROMDATETIME
number minutes-from-dateTime(datetime) (XSLT 2.0)


SECONDSFROMDATETIME

public static final XSLTFunction SECONDSFROMDATETIME
number seconds-from-dateTime(datetime) (XSLT 2.0)


TIMEZONEFROMDATETIME

public static final XSLTFunction TIMEZONEFROMDATETIME
string timezone-from-dateTime(datetime) (XSLT 2.0)


YEARFROMDATE

public static final XSLTFunction YEARFROMDATE
number year-from-date(date) (XSLT 2.0)


MONTHFROMDATE

public static final XSLTFunction MONTHFROMDATE
number month-from-date(date) (XSLT 2.0)


DAYFROMDATE

public static final XSLTFunction DAYFROMDATE
number day-from-date(date) (XSLT 2.0)


TIMEZONEFROMDATE

public static final XSLTFunction TIMEZONEFROMDATE
string timezone-from-date(date) (XSLT 2.0)


HOURSFROMTIME

public static final XSLTFunction HOURSFROMTIME
number hours-from-time(time) (XSLT 2.0)


MINUTESFROMTIME

public static final XSLTFunction MINUTESFROMTIME
number minutes-from-time(time) (XSLT 2.0)


SECONDSFROMTIME

public static final XSLTFunction SECONDSFROMTIME
number seconds-from-time(time) (XSLT 2.0)


TIMEZONEFROMTIME

public static final XSLTFunction TIMEZONEFROMTIME
string timezone-from-time(time) (XSLT 2.0)


ADJUSTDATETIMETOTIMEZONE

public static final XSLTFunction ADJUSTDATETIMETOTIMEZONE
dateTime adjust-dateTime-to-timezone(dateTime, timezone) (XSLT 2.0)


ADJUSTDATETOTIMEZONE

public static final XSLTFunction ADJUSTDATETOTIMEZONE
date adjust-date-to-timezone(date, timezone) (XSLT 2.0)


ADJUSTTIMETOTIMEZONE

public static final XSLTFunction ADJUSTTIMETOTIMEZONE
time adjust-time-to-timezone(time, timezone) (XSLT 2.0)


COMPARE

public static final XSLTFunction COMPARE
number compare(comp1, comp2) (XSLT 2.0)

Field Detail

XSLT1_FUNCS

public static final XSLTFunction[] XSLT1_FUNCS
Array of all XSLT 1.0 functions.


XSLT2_FUNCS

public static final XSLTFunction[] XSLT2_FUNCS
Array of all XSLT 2.0 functions.

Method Detail

values

public static XSLTFunction[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (XSLTFunction c : XSLTFunction.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static XSLTFunction valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

toXSL

public java.lang.String toXSL(java.lang.String argsStr)
Returns a String formatted for inclusion in an XSL stylesheet of the function applied to argsStr. Please note where a function requires more than one argument they should be included in argsStr in comma separated format.

Parameters:
argsStr - the arguments for the function
Returns:
String formatted for inclusion in an XSL stylesheet

toString

public java.lang.String toString()
Overridden to use actual XSLT function names.

Overrides:
toString in class java.lang.Enum<XSLTFunction>
Returns:
returns the actual XSLT function name

getSpecification

public XSLTFunction.XSLTSpecification getSpecification()
Returns the XSLT specification from which the function is derived.

Returns:
XSLT specification from which the function is derived

getMinimumArgsCount

public int getMinimumArgsCount()
Returns the minimum number of arguments required by the function.

Returns:
minimum number of arguments required

getArgPrompt

public java.lang.String getArgPrompt(int arg)
Returns a prompt for the function argument at a given position.

Parameters:
arg - the position of the argument
Returns:
a prompt for the argument at position arg

isStringArg

public boolean isStringArg(int arg)
Determines if the argument at a given position is a string.

Parameters:
arg - the position of the argument
Returns:
true if the argument at position is a string, false otherwise

setWorkingSpec

public static void setWorkingSpec(XSLTFunction.XSLTSpecification spec)
Sets the working XSLT Specification. This determines which functions are allowed.

Parameters:
spec - the XSLT specification to use

getWorkingSpec

public static XSLTFunction.XSLTSpecification getWorkingSpec()
Returns the current working XSLT specification.

Returns:
the current working XSLT specification

getFunctionsForWorkingSpec

public static XSLTFunction[] getFunctionsForWorkingSpec()
Returns functions allowed for the current working specification.

Returns:
array of functions allowed for the current working sepcification


Copyright 2010 Andrew Leigh. All Rights Reserved.