From: Gaurav sharma [mailto:email@example.com]
Sent: 19 November 2009 10:10
Subject: [saxon] issue while compile and execute an XQuery expression withSaxon.
I am SAXON user. And trying to compile and execute an XQuery expression with Saxon.
objective : execute the Xquey on document object and get the Domelement list.
I am using below code for that.Configuration c = new Configuration();StaticQueryContext qp = new StaticQueryContext(c);XQueryExpression xe = qp.compileQuery(query);DynamicQueryContext dqc = new DynamicQueryContext(c);dqc.setContextNode(new DocumentWrapper(dom, url, c));List result = xe.evaluate(dqc);
Here query= "for $x in //input \n" + "return $x \n";
And dom is a object of org.w3c.dom.Document.
Document object is having input element. But when I evaluate xquery expression, list size is coming zero. Also I am not getting any exception.
I tried same code with some other URL where I am able to see the result. So what is the problem with other one.
Can anyone please answer following question?
- Why the list size is coming zero if Document object is having input element.
- How can I find the baseURI (variable name - url).
- Is there any way to trace the log/warning/errors.