*
*/
final public ValueNode xmlQueryValue(boolean existsOnly) throws ParseException, StandardException {
// The query expression (currently must be an expression
// supported by Xalan--i.e. XPath only).
ValueNode xqueryExpr = null;
// Context item for the query; not required by SQL/XML spec,
// but required by Derby for now.
ValueNode xmlValue = null;
// User-specified default passing mechanism. Since Derby only
// supports one type of passing mechanism--BY REF--this value
// isn't currently used.
short defaultPassingMech = -1;
xqueryExpr = additiveExpression(null, 0, false);
jj_consume_token(PASSING);
defaultPassingMech = xmlPassingMechanism();
xmlValue = xqVarList();
if (!existsOnly) {
if (jj_2_32(1)) {
xqReturningClause();
if (jj_2_31(1)) {
xmlPassingMechanism();
} else {
;
}
} else {
;
}
xqEmptyHandlingClause();
} else if (existsOnly) {
} else {
jj_consume_token(-1);
throw new ParseException();
}
ValueNode vNode = (ValueNode) nodeFactory.getNode(
(existsOnly
? C_NodeTypes.XML_EXISTS_OPERATOR_NODE
: C_NodeTypes.XML_QUERY_OPERATOR_NODE),
xqueryExpr,
xmlValue,