You may need to add the namespace declaration in your query. I have slightly revised our documentation to make this more explicit: http://docs.basex.org/wiki/XQuery_3.0#Serialization ___________________________ On Fri, Feb 1, 2013 at 6:15 PM, marco fregonese <marcofregonese@gmail.com> wrote:
Hi there,
In my application I have this method:
public static String getAllPartsAsTree(String a) throws XQException, XQQueryException { XQConnection con = Connection.getConnection(); XQExpression xqe = con.createExpression();
xqe.bindString(new QName("b"), a, null);
String xqueryString = "import module namespace lib=\"http://www.example.com/library_module\";" + "declare option output:method \"xhtml\";" + "declare variable $b external; " + "lib:gethtml($b)";
XQResultSequence rs = xqe.executeQuery(xqueryString) ;
String b = rs.getSequenceAsString(null);
con.close();
return b; }
When I run the app I get the following error message:
Exception in thread "main" javax.xml.xquery.XQException: The prefix "output" is unknown in this static context.
I can't understand how to interpret the error message. The same query in BaseXGUI works perfectly. I hope someone can help me. Thanks!
_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk