Hello,

I have a problem when I want to query an instance of qizx server from the command line, with a parameter.

My
library "sandbox" contains this file :

$ cat test.xml
<?xml version='1.0' encoding='UTF-8'?>
<test id="1234">
this is a test
</test>

When I run:
qizx -login xxx:yyy -group http://localhost:18080/qizx/api -library sandbox -q  test.xq

I get:
<?xml version='1.0' encoding='UTF-8'?>
<test id="1234">
this is a test
</test>

where:
$ cat test.xq
declare boundary-space preserve;

(: request parameters :)
declare variable $p-id as xs:string external := "1234";

if ($p-id)
    then
        collection("/test")//test[@id = $p-id]
    else
        "variable $p-id
undefined
"

That's OK.

Now, if I remove the default value for $p-id, and try to pass it as a parameter:
qizx -login xxx:yyy -group http://localhost:18080/qizx/api -library sandbox -q  test.xq  -Dp-id='1234'

I get:
variable $p-id undefined

$ cat test.xq
declare boundary-space preserve;

(: request parameters :)
declare variable $p-id as xs:string external := "";

if ($p-id)
    then
        collection("/test")//test[@id = $p-id]
    else
        "variable $p-id
undefined
"

If I remove the default value of $p-id, I have this error:
*** RESTException: Evaluation: XPDY0002 variable $p-id has no specified value
 at line 4 column 8


If I stop the qizx server, and use the library path (-group /.../.../...), the command returns the XML.

So, what's wrong
when the group is a URL?
--


Olivier JEULIN
Chef de projet
[email protected]
Tél: +33 (0)1 41 05 22 00



42, rue de Villiers
92532 Levallois cedex
www.efl.fr
 
--
Qizx Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/qizx-support

Reply via email to