![]() ![]() ![]() ![]() ![]() ![]() |
This chapter provides descriptions of the XQuery numeric functions available in the mapper functionality of WebLogic Workshop. You use the mapper functionality to generate queries and to edit these queries to add invocations to these provided XQuery functions. To learn more, see Invoking Functions or Operators in a Query.
In addition to the XQuery functions and operators available in the mapper functionality, a larger set functions and operators is provided. You can manually add invocations to these functions and operators to queries in the Source View of the mapper functionality. For a list of these additional functions and operators, see the XQuery 1.0 and XPath 2.0 Functions and Operators - W3C Working Draft 16 August 2002 available from the W3C Web site at the following URL:
http://www.w3.org/TR/2002/WD-xquery-operators-20020816
This section lists the numeric functions available from the Mapper tool:
Converts $double-var
to a string using the format pattern specified by $string-var.
If the value of $double-var
is the empty sequence, the following error is displayed in the mapper:
Error occurred while executing XQuery: Error loading the XQuery or XSLT for this method: Type error in function format-number invocation: expected type [double@http://www.w3.org/2001/XMLSchema], given type empty
The empty sequence is a sequence containing zero items (),
which is similar to null in SQL.
bea-xf:
format-number(
xs:
double $double-var
,
xs:
string $string-var) —> xs:
string
Represents the pattern string. The format of this pattern is specified by the JDK 1.4.1
DecimalFormat class.
|
Returns $double-var
as a string based on the pattern specified by $string-var.
Invoking format-number(xs:double(10002.45), "#,###0.000#") returns the string 1,0002.450 as shown in the following example query:
<result>{bea-xf:format-number(xs:double(10002.45), "#,###0.000#")}</result>
The preceding query generates the following result:
Not a standard W3C XQuery function. This is a standard XSLT function.
Note: | Only the two argument version of the standard XSLT function is supported. |
W3C XSLT format-number function description.
JDK 1.4.1 DecimalFormat class description.
Rounds $double-var
down to the next whole number.
If the value of $string-var
is the empty sequence, the empty sequence is returned. The empty sequence is a sequence containing zero items ()
, which is similar to null in SQL.
xf:
floor(xs:
double?$double-var) —> xs:double?
Returns a double equal to $double-var
rounded down to the next whole number.
W3C floor function description.
Rounds $double-var
up to the next whole number.
If the value of $string-var
is the empty sequence, the empty sequence is returned.The empty sequence is a sequence containing zero items ()
, which is similar to null in SQL.
xf:
ceiling(
xs:
double?$double-var) —> xs:double?
Returns a double equal to $double-var rounded up to the next whole number.
W3C ceiling function description.
Rounds $double-var
to the nearest whole number.
If the value of $string-var
is the empty sequence, the empty sequence is returned. The empty sequence is a sequence containing zero items ()
, which is similar to null in SQL.
xf:
round(
xs:
double?$double-var) —> xs:double?
Returns a double equal to $double-var
rounded to the nearest whole number.
W3C round function description.
![]() ![]() ![]() |