4

I'm writing library in Java, which executes XQuery using oracle's libraries provided in OSB

One of XQuery contains:

<cfgEndDate>{ fn-bea:date-from-dateTime($endDate) }</cfgEndDate>

The XQuery works properly in OSB environment and even in Eclipse OEPE

Despite this, attempts to execute the XQuery with Java (I took xquery.jar from OSB distributive) caused an exception:

oracle.xquery.XQException: XPST0081: It is a static error if a QName used in an 
expression contains a namespace prefix that cannot be expanded into a namespace URI by 
using the statically known namespaces.

Detail: Undeclared namespace prefix 'fn-bea' 

at oracle.xquery.PreparedXQuery.<init>(PreparedXQuery.java:202)
at oracle.xquery.PreparedXQuery.<init>(PreparedXQuery.java:128)
at oracle.xquery.XQueryContext.prepareXQuery(XQueryContext.java:424)

Update 1:

I've just tried do the same using net.sf.saxon.query library. And it couldn't manage this function either:

XPST0081 XQuery static error near #...>{ fn-bea:date-from-dateTime($#:
Prefix fn-bea has not been declared
net.sf.saxon.trans.XPathException: One or more static errors were reported during
query analysis

    at net.sf.saxon.query.QueryParser.parseQuery(QueryParser.java:344)
    at net.sf.saxon.query.QueryParser.makeXQueryExpression(QueryParser.java:140)
    at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:536)

Update 2

I've found that fn-bea:date-from-dateTime() function is located in weblogic's:

com.bea.core.xquery_1.3.0.0.jar
package weblogic.xml.query.runtime.datetime.ext
class DateFromDateTime

But I don't find any possibility to use it with known XQuery engines, moreover, it is desired to use all the fn-bea functions, not only this one.

Does anyone know how to solve this or suggest a Java XQ engine which supports fn-bea.

Sicco
  • 6,167
  • 5
  • 45
  • 61
Denis
  • 759
  • 1
  • 9
  • 22

1 Answers1

0

Try using Oracle XQuery Processor for Java (XQJ API). It supports XQuery 3.0 features

http://orafmwsoa.blogspot.com/2014/06/running-xquery-from-java-applications.html

http://docs.oracle.com/cd/E16655_01/appdev.121/e17604/adx_j_xqj.htm