This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
interfacing qexo/xquery with kawa?
- From: "Hoehle, Joerg-Cyril" <Joerg-Cyril dot Hoehle at t-systems dot com>
- To: kawa at sources dot redhat dot com
- Date: Thu, 23 Oct 2003 17:41:36 +0200
- Subject: interfacing qexo/xquery with kawa?
Hi,
my idea was to use xquery for what it's good at, and do the rest in Scheme, thus using Kawa as a multi-language platform. I thought I could compile *.scm, *.xql etc. files indivually and use them.
For example, xquery is good for extracting fields out of XML, or possibly for validating a document, before calling other functions.
The qexo pages mention calling Java from qexo (does it work with calling Scheme?), but I wanted to do it the other way round.
http://www.gnu.org/software/qexo/Extensions.html#Calling-Java-Methods
I wished to program more in Scheme, rathern than learn another instance of a functional language.
---- v2.xql
define function getit ($f) { fn:document($f) }
----
XML> java -jar /home/hoehle/archive/kawa-1.7.jar --xquery -C v2.xql
(compiling v2.xql)
XML> java -cp /home/hoehle/archive/kawa-1.7.jar:. kawa.repl
#|kawa:1|# (require <v2>)
#|kawa:2|# getit
#<procedure getit>
#|kawa:3|# (getit "signature.xml")
gnu.mapping.UnboundSymbol: Unbound symbol document
So getit indeed appears as a Scheme function, but the functions document (and fn:document) are gone. Using fn:document or just document in v2.xql makes no difference.
I thought I'd receive XML values as result (similarly to make-element)
#|kawa:11|# make-element
#<procedure gnu.xquery.util.MakeElement>
What is wrong?
Thanks for your help,
Jorg Hohle.