Hi Richard,
You have to escape the $ sign, otherwise the shell will interpret it. You can solve this problem by using $ (i.e. execute basex -b$word=celoso consulta.xq) or you can also simply completely drop the $ sign - It is not required for passing an external variable.
Cheers, Dirk
On 08/09/2013 03:01 AM, Richard Alexander Castro Mamani wrote:
Hello, I have the following query in a XQ file named "consulta.xq"declare namespace xs = "http://www.w3.org/2001/XMLSchema"; declare variable $word as xs:string+ external;
for $entry in doc("cni_es_cushimariano2008")//e where $entry//l[matches(., $word)] return <e>{$entry//r//text()} --> {$entry//l//text()}</e> My database "cni_es_cushimariano2008" has the following structure/data:<?xml version="1.0" encoding="UTF-8"?>
<dictionary> <alphabet>aeiobchjmnñprsty</alphabet> <section id="main" type="standard"> <!-- cuidarse (de alguien). aamaantsi. --> <e> <p> <l>cuidarse (de alguien)</l> <r>aamaantsi<s n="verbo intransitivo"/> <s n="infinitivo"/> </r> </p> </e> <!-- celoso. aamaantsi. --> <e> <p> <l>celoso</l> <r>aamaantsi<s n="adjetivo"/> </r> </p> </e> <!-- traer. aamaantsi. --> <e> <p> <l>traer</l> <r>aamaantsi<s n="verbo transitivo"/> <s n="infinitivo"/> </r> </p> </e> </section> </dictionary> I am trying to execute the following command line instruction$ basex -b$word=celoso consulta.xq but I don't receive the expected result and receive the following message:[XPDY0002] No value assigned to $word as xs:string+. I am not an expert using Basex and XQuery so I will be grateful for any answer that might help me. Thanks in advance. Best regards, Richard.
-- Richard Alexander Castro Mamani http://unsaac.academia.edu/RichardAlexanderCastroMamaniGrupo de Investigación Hinantin - UNSAAC Docente de Educación Primaria - ISPP "Uriel Garcia" de Cusco skype: richardtk_1 E-mail: rcastro@hinantin.com http://hinantin.unsaac.edu.pe
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk