1.1

Table Of Contents
are used, SQLFire preserves whitespace as dictated by the SQL/XML rules
for preserving whitespace.
For more information on what constitutes a well-formed XML document, see the following specication:
http://www.w3.org/TR/REC-xml/#sec-well-formed .
Restriction: The SQL/XML standard dictates that the argument to the XMLPARSE operator can also
be a binary string. However, SQLFire only supports character string input for the XMLPARSE operator.
Examples
To insert a simple XML document into the xcol XML column in the x_table table, use the following
statement:
INSERT INTO x_table VALUES
(1,
XMLPARSE(DOCUMENT '
<roster>
<student age="18">AB</student>
<student age="23">BC</student>
<student>NOAGE</student>
</roster>'
PRESERVE WHITESPACE)
)
To insert a large XML document into the xcol XML column in the x_table table, from JDBC use the
following statement:
INSERT INTO x_table VALUES
(2,
XMLPARSE (DOCUMENT CAST (? AS CLOB) PRESERVE WHITESPACE)
)
You should bind into the statement using the setCharacterStream() method, or any other JDBC setXXX method
that works for the CAST target type.
Usage note
SQLFire requires that a JAXP parser (such as Apache Xerces) and Apache Xalan are listed in the Java classpath
for the XML functions to work. If either the JAXP parser or Xalan is missing from the classpath, attempts to
use the XMLPARSE operator will result in an error. In some situations, you may need to take steps to place the
parser and Xalan in your classpath. See XML on page 614 for details.
XMLQUERY operator
XMLQUERY is a SQL/XML operator that you can use to query XML values in SQL.
The XMLQUERY operator has two arguments, an XML query expression and a SQLFire XML value.
Syntax
XMLQUERY ( xquery-string-literal
PASSING BY REF xml-value-expression
[ RETURNING SEQUENCE [ BY REF ] ]
EMPTY ON EMPTY
)
Must be specied as a string literal. If this argument is specied as a parameter,
an expression that is not a literal, or a literal that is not a string (for example an
xquery-string-literal
vFabric SQLFire User's Guide576
vFabric SQLFire Reference