Java APIP: XQueryException:XQueryDocument


I wrote a very simple java application using QuiP. I have a xml document stored in my local filesystem called"bib.xml", and I’m trying to execute a query. I get an exception, but no info in the Exception telling me what the problem might be. I’m thinking that it’s possible that either the xml doc or the query that I’m trying to execute are not correct. Any help would be greatly appreciated.

Thank you,

The sample code is:
// create a QuiP connection
Properties obj = new Properties();
obj.put(“quipcmd”,“C:\quip161\QuiP\quip.exe” );

StringBuffer file = new StringBuffer();
QuiPConnection qc = new QuiPConnection(file.toString(), obj);
// execute query
QueryResult qr = qc.executeQuery(query);
Document result = qr.getDocument();

The example document is:

TCP/IP Illustrated



The example query is:
FOR $book IN document(“bib.xml”)//book WHERE $book/publisher = “Addison-Wesley” RETURN $book/title

And the Exception that I get is:
com.softwareag.xtools.quip.xqueryAPI.XQueryException: org/apache/crimson/tr

at com.softwareag.xtools.quip.xqueryAPI.QuiPConnection.executeQuery
at OpXquery.processTuple(
at OpXquery.on_in_rel(
at java.lang.reflect.Method.invoke(Native Method)
at theseus.executor.basic.BasicOperatorManager.invokeStreamingMetho
at theseus.executor.basic.BasicOperatorManager.processFiring(BasicO
at theseus.executor.basic.BasicOperatorManager.handleEvent(BasicOpe
at Source)

Probably for some reason your query result is not
a document and therefore

Document result = qr.getDocument();


For a test try to make

Document result = qr.getDocument();
}catch (Exception _){

and you will see, what quip actually results in its textual form.

Sven Eric

I tried printing the raw string, but it doesn’t even get to produce the QueryResult. The Exception is thrown while executing :

QueryResult qr = qc.executeQuery(query);

My feeling is that ir “doesn’t like” the XmlDocument (the one that’s executing the query on), but I can’t figure out why.

Any other ideeas would be greatly appreciated :slight_smile:

Thanks a lot,

the error occurs even before any execution is started, but during parsing and transforming the
query into xqueryx format. This is done with the help of crimson dom implementation. Are you using
the crimson.jar file distributed with Quip or
another one? Then this might have to do with
different versions of crimson, which support
diggerent methods?