org.apache.xalan.lib
Class ExsltMath
java.lang.Object
|
+--org.apache.xalan.lib.ExsltMath
- public class ExsltMath
- extends java.lang.Object
This class contains EXSLT math extension functions.
It is accessed by specifying a namespace URI as follows:
xmlns:math="http://exslt.org/math"
The documentation for each function has been copied from the relevant
EXSLT Implementer page.
- See Also:
- EXSLT
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ExsltMath
public ExsltMath()
max
public static java.lang.String max(ExpressionContext expCon,
NodeIterator ni)
- The math:max function returns the maximum value of the nodes passed as the argument.
The maximum value is defined as follows. The node set passed as an argument is sorted
in descending order as it would be by xsl:sort with a data type of number. The maximum
is the result of converting the string value of the first node in this sorted list to
a number using the number function.
If the node set is empty, or if the result of converting the string values of any of the
nodes to a number is NaN, then NaN is returned.
- Parameters:
expCon
- is passed in by the Xalan extension processorni
- The NodeIterator for the node-set to be evaluated.- Returns:
- String representation of the maximum value found, NaN if any node cannot be
converted to a number.
- See Also:
- EXSLT
min
public static java.lang.String min(ExpressionContext expCon,
NodeIterator ni)
- The math:min function returns the minimum value of the nodes passed as the argument.
The minimum value is defined as follows. The node set passed as an argument is sorted
in ascending order as it would be by xsl:sort with a data type of number. The minimum
is the result of converting the string value of the first node in this sorted list to
a number using the number function.
If the node set is empty, or if the result of converting the string values of any of
the nodes to a number is NaN, then NaN is returned.
- Parameters:
expCon
- is passed in by the Xalan extension processorni
- The NodeIterator for the node-set to be evaluated.- Returns:
- String representation of the minimum value found, NaN if any node cannot be
converted to a number.
- See Also:
- EXSLT
highest
public static NodeSet highest(ExpressionContext expCon,
NodeIterator ni)
throws java.lang.CloneNotSupportedException
- The math:highest function returns the nodes in the node set whose value is the maximum
value for the node set. The maximum value for the node set is the same as the value as
calculated by math:max. A node has this maximum value if the result of converting its
string value to a number as if by the number function is equal to the maximum value,
where the equality comparison is defined as a numerical comparison using the = operator.
If any of the nodes in the node set has a non-numeric value, the math:max function will
return NaN. The definition numeric comparisons entails that NaN != NaN. Therefore if any
of the nodes in the node set has a non-numeric value, math:highest will return an empty
node set.
- Parameters:
expCon
- is passed in by the Xalan extension processorni
- The NodeIterator for the node-set to be evaluated.- Returns:
- node-set with nodes containing the minimum value found, an empty node-set
if any node cannot be converted to a number.
lowest
public static NodeSet lowest(ExpressionContext expCon,
NodeIterator ni)
throws java.lang.CloneNotSupportedException
- The math:lowest function returns the nodes in the node set whose value is the minimum value
for the node set. The minimum value for the node set is the same as the value as calculated
by math:min. A node has this minimum value if the result of converting its string value to
a number as if by the number function is equal to the minimum value, where the equality
comparison is defined as a numerical comparison using the = operator.
If any of the nodes in the node set has a non-numeric value, the math:min function will return
NaN. The definition numeric comparisons entails that NaN != NaN. Therefore if any of the nodes
in the node set has a non-numeric value, math:lowest will return an empty node set.
- Parameters:
expCon
- is passed in by the Xalan extension processorni
- The NodeIterator for the node-set to be evaluated.- Returns:
- node-set with nodes containing the maximum value found, an empty node-set
if any node cannot be converted to a number.
Copyright © 2001 Apache XML Project. All Rights Reserved.