This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
a few xquery/qexo problems
- 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:32:12 +0200
- Subject: a few xquery/qexo problems
Hi,
I hadn't used xquery for a year, and was glad to see that it includes a schema validator! Great, maybe I can get rid of Xerces et al.
Here are a few questions of mine, after playing with it for a while:
1. the interactive output does not show namespaces, although they are there. How to make them appear?
(: 63 :) declare namespace ds = "http://www.w3.org/2000/09/xmldsig#"
(: 66 :) (document("5.xml")/*[1]/ds:Signature)
<Signature> -- note: no xmlns=...
<SignedInfo>...
(: nn :) (document("5.xml")/*[1]/Signature) -> no output since document's Signature is in another namespace
http://sources.redhat.com/ml/kawa/2002-q3/msg00104.html
might be relevant to that?
2. fn:node-kind is mentioned as a replacement for dm:node-kind
http://www.gnu.org/software/qexo/XQuery-Intro.html
"For example there is a fn:node-kind function which you can use, and which is defined to return the same result as dm:node-kind."
(: 57 :) fn:node-kind(document("5.xml")/*[1]/*[3])
gnu.mapping.UnboundSymbol: Unbound symbol node-kind
3. I can't seem to get schema import to work
(: 70 :) import schema "http://www.w3.org/2000/09/xmldsig#" at "http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"
<stdin>:70:8: missing ')' - saw schema @:13
http://www.gnu.org/software/qexo/XQ-Data-Model.html
mentions:
"A schema import declaration appears in the Query Prolog of an XQuery program. For example:
import schema "http://www.w3.org/1999/xhtml" at "xhtml.xsd"
The error looks like a syntax error.
(: 90 :) validate(<data/>)
gnu.mapping.UnboundSymbol: Unbound symbol validate
Believing that this might not be possible in interactive mode, I wrote a trivial .xql program. No difference:
XML> java -jar kawa-1.7.jar --xquery --main -C v1.xql
(compiling v1.xql)
v1.xql:1:8: missing ')' - saw schema @:13
v1.xql:1:52: missing ')' - saw at @:53
v1.xql:3:1: missing ')' - saw validate @:8
---- v1.xql
import schema "http://www.w3.org/2000/09/xmldsig#" at "/home/hoehle/Code/XML/xmldsig-code-schema.xsd"
validate(document("signature-example-rsa.xml"))
----
4. a few bizarre errors about "dot" being unbound:
(: 1 :) exit
gnu.mapping.UnboundSymbol: Unbound symbol dot
(: 86 :) import
gnu.mapping.UnboundSymbol: Unbound symbol dot
at gnu.expr.Interpreter.getDefaultSymbolValue(Interpreter.java:638)
(: 26 :) return $book
java.lang.Error: invalid syntax - variable following name
at gnu.xquery.lang.XQParser.parseMaybePrimaryExpr(XQParser.java:1997)
[...]
gnu.mapping.UnboundSymbol: Unbound symbol dot
at gnu.expr.Interpreter.getDefaultSymbolValue(Interpreter.java:638)
5. http://www.gnu.org/software/qexo/XQ-Data-Model.html
says "xs:integer - Matches any integer type or any type derived from it, such a xs:nonNegativeInteger, assuming this is in scope of a namespace
declaration that binds xsd to http://www.w3.org/2001/XMLSchema."
^^^ probably xs?
Thanks for your great work on Scheme/Java/XML!
Jorg Hohle.
Running kawa-1.7 on MS-Windows 2k JRE1.4.2 or Suze Linux 8.1 JRE 1.3.1