 |
 |
 |
I'm a newbie with XQuery and I'm trying to execute a query with Saxon.
If I don't specify the XML source file name in the query, Saxon raises
the following error :
javax.xml.transform.Transforme=ADrException: Finding root of tree: the
context item is not set
Even if I specified the source file name in the command line.
Here is the command line I used :
java -cp saxon8.jar net.sf.saxon.Query -s books.xml books.xq
where books.xq =3D
xquery version "1.0";
for $b in //BOOKS/ITEM
order by string-length($b/TITLE) return
<book>
<author> { $b/AUTHOR } </author>
<title> { $b/TITLE } </title>
</book>
I can avoid the error by using this line in the query :
for $b in doc("books.xml")//BOOKS/ITEM
But, I don't want to repeat the file name in the query. I'd like to use
the same query whatever the file name is.
Is it possible ?
Actually, Saxon behaves the same in command line or called from a java
program.
I used a utility called bumblebee to test my query with different
XQuery processors, and i get the same result with Qizx.
Thank you and excuse my english.
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |