qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qexo-general] Qexo and text()


From: David Mundie
Subject: [Qexo-general] Qexo and text()
Date: Wed, 4 Dec 2002 08:17:55 -0500

I can't get text() to work as I expect. Here is my query:

let $birds := document("test.xml")/checklist//bird/sci
return $birds/text()

What I want is to return just the text nodes of the scientific names ("sci" elements). If I delete the "text()", I get the scientific names as expected, with the tags. But with "text()" in the path, I get an error message:

java -jar kawa-1.6.98.jar --xquery -f test1.xq
gnu.mapping.UnboundSymbol: Unbound symbol text
        at gnu.mapping.Constraint.get(Constraint.java:15)
        at gnu.mapping.Binding.get(Binding.java:25)
        at atInteractiveLevel.apply(Unknown Source)
        at gnu.mapping.CallContext.runUntilDone(CallContext.java:239)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:189)
        at kawa.Shell.run(Shell.java:231)
        at kawa.standard.load.loadSource(load.java:134)
        at kawa.standard.load.apply(load.java:238)
        at kawa.Shell.runFile(Shell.java:280)
        at kawa.repl.processArgs(repl.java:191)
        at kawa.repl.main(repl.java:545)

What am I missing? I know using string() would work, but text() should also, shouldn't it?

Here is test.xml:

<?xml version="1.0"?>

<checklist>
<title>Sibley</title>
<family><name>Struthionidae</name>
<bird><sci>Struthio camelus</sci> <com lang="EN">Ostrich</com> <range>Afr</range></bird>
</family>

<family><name>Rheidae</name>
<bird><sci>Rhea americana</sci> <com lang="EN">Greater Rhea</com> <range>sc SA</range></bird> <bird><sci>Rhea pennata</sci> <com lang="EN">Lesser Rhea</com> <range>w,s SA</range></bird>
</family>

<family><name>Casuariidae</name>
<bird><sci>Casuarius casuarius</sci> <com lang="EN">Southern Cassowary</com> <range>Aust, NG</range\
></bird>
<bird><sci>Casuarius bennetti</sci> <com lang="EN">Dwarf Cassowary</com> <range>NG</range></bird> <bird><sci>Casuarius unappendiculatus</sci> <com lang="EN">Northern Cassowary</com> <range>NG</rang\
e></bird>
<bird><sci>Dromaius novaehollandiae</sci> <com lang="EN">Emu</com> <range>Aust</range></bird>
</family>

</checklist>







reply via email to

[Prev in Thread] Current Thread [Next in Thread]