You haven't actually bound the document as the context item of the expression. You need to call one of the bind...() methods on XQExpression.
 
However, I'm not sure that quite explains the problem. FODC0002 looks as if you were calling the doc() or collection() function, but I didn't see such calls in your query in earlier emails.
 
It's saying a file wasn't found. Would you expect that file to be found?
 
Michael Kay
http://www.saxonica.com/


From: Erik Rens [mailto:mail2rens@gmail.com]
Sent: 01 April 2009 09:52
To: saxon-help@lists.sourceforge.net
Subject: Re: [saxon] Xpath 2.0 sequences and Saxon examples problems.

Thanks for the tips. I guess I am on the right way but i still cant get work. I parsed my string with a XMLInputFactory to a XQItem.
 
code:
 
XQDataSource ds = new SaxonXQDataSource();
XQConnection conn = ds.getConnection();
StringReader xs =
new StringReader(rt);
XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(xs);
XQItem doc = conn.createItemFromDocument(reader,
null);
XQExpression expression = conn.createExpression();
 
I used the same xml structure and expression from the previous post. Then I execute the expression:

XQSequence results = expression.executeQuery(queryString);
System.out

.println(results.getSequenceAsString(new Properties()));
//
results.writeSequence(System.out, null);

I try to print my result but I get an Error:

Error on line 2

FODC0002:

java.io.FileNotFoundException: C:\Stage\Projects\DA\MDF\Empire BurlesqueBobDylanUSAColumbia10.901985Hide your heartBonnie TylerUKCBS Records9.901988 (The systemcannot find the file specified)javax.xml.xquery.XQException: java.io.FileNotFoundException: C:\Stage\Projects\DA\MDF\Empire BurlesqueBob DylanUSAColumbia10.901985Hide your heartBonnie TylerUKCBS Records9.901988 (The system cannot find the file specified)at net.sf.saxon.xqj.SaxonXQPreparedExpression.executeQuery(SaxonXQPreparedExpression.java:95)

It doens't make sense to me. Can someone help me to get it work? When I debug my code it will stop on the executeQuery method.

regards