From MAILER-DAEMON Fri Jan 02 10:44:15 2004 Received: from list by monty-python.gnu.org with archive (Exim 4.24) id 1AcRRu-0006jj-Bx for mharc-qexo-general@gnu.org; Fri, 02 Jan 2004 10:42:54 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AcQhg-0000zM-9Z for qexo-general@gnu.org; Fri, 02 Jan 2004 09:55:08 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AcPzm-00059I-BW for qexo-general@gnu.org; Fri, 02 Jan 2004 09:10:17 -0500 Received: from [69.27.32.90] (helo=69273290.bestdsl.net) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AcPzl-00058a-SQ for qexo-general@gnu.org; Fri, 02 Jan 2004 09:09:45 -0500 Received: from [192.168.7.6] (124-162.bestdsl.net [216.162.124.162]) by 69273290.bestdsl.net (8.11.1/8.11.1) with ESMTP id i02G8vm15431; Fri, 2 Jan 2004 08:09:00 -0800 From: Weiqi Gao To: qexo-general@gnu.org, talk@xquery.com Content-Type: text/plain Message-Id: <1073048883.3629.13.camel@gao-2004.weiqigao.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Fri, 02 Jan 2004 07:08:03 -0600 Content-Transfer-Encoding: 7bit Cc: Subject: [Qexo-general] Introduction to XQuery article posted X-BeenThere: qexo-general@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Qexo, the GNU Kawa-based XQuery implementation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2004 15:42:51 -0000 Hi, My new Introduction to XQuery article has been posted to http://ociweb.com/jnb at http://ociweb.com/jnb/jnbJan2004.html. For some reason, I don't receive all the emails posted to the lists. I have to visit the mail archives to see the postings. I think I caught the latest exchange between Michael and Per last night, and incorporated all suggestions into the article. Thank you for the comments. Please feel free to send further comments to me. Please feel free to link to it, tell new XQuery users about it, and use it in any other way. I'll be happy if it helps one other person to get started with XQuery. -- Weiqi Gao, Principal Software Engineer Object Computing, Inc. (OCI) gao_w@ociweb.com, http://ociweb.com From MAILER-DAEMON Wed Jan 07 20:28:55 2004 Received: from list by monty-python.gnu.org with archive (Exim 4.24) id 1AeOyl-00028A-EG for mharc-qexo-general@gnu.org; Wed, 07 Jan 2004 20:28:55 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AeOye-00026l-Tf for qexo-general@gnu.org; Wed, 07 Jan 2004 20:28:48 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AeOv7-00010V-0B for qexo-general@gnu.org; Wed, 07 Jan 2004 20:25:40 -0500 Received: from [217.72.192.158] (helo=smtp.web.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AeOuj-0000mq-S3 for qexo-general@gnu.org; Wed, 07 Jan 2004 20:24:46 -0500 Received: from dsl-213-023-051-080.arcor-ip.net ([213.23.51.80] helo=web.de) by smtp.web.de with asmtp (WEB.DE 4.99 #566) id 1AeNxB-0005FT-00 for qexo-general@gnu.org; Thu, 08 Jan 2004 01:23:13 +0100 Message-ID: <3FFCA2CF.1080505@web.de> Date: Thu, 08 Jan 2004 01:22:39 +0100 From: Sascha Opletal User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 CC: qexo-general@gnu.org References: <3FD468FB.7070003@web.de> In-Reply-To: <3FD468FB.7070003@web.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: sascha_opletal@web.de Subject: [Qexo-general] XML Header and URIs X-BeenThere: qexo-general@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Qexo, the GNU Kawa-based XQuery implementation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2004 01:28:50 -0000 Hi! I have two problems here... 1) Is it possible to use some uri-resolver with qexo, to resolve and use custom uris? something like "message://some.xml" 2) The qexo parses file a with an XML-Header correctly, but i can't create a header in my output file. How can i insert an XML Header? A query would be like this: { Xquery stuff here } Kawa 1.7.90 gives me: query.xql:1:2: missing NameSpec query.xql:1:3: confused by syntax error query.xql:1:14: node test when focus is undefined query.xql:1:21: confused by syntax error query.xql:1:29: missing expression query.xql:1:41: confused by syntax error query.xql:1:42: missing expression query.xql:5:16: missing expression query.xql:5:16: confused by syntax error query.xql:6:1: confused by syntax error query.xql:11:1: confused by syntax error gnu.mapping.UnboundSymbol: Unbound symbol distinct-values at gnu.expr.Interpreter.getDefaultSymbolValue(Interpreter.java:651) at gnu.expr.Interpreter.getSymbolProcedure(Interpreter.java:668) at atInteractiveLevel.apply(query.xql:28) at gnu.mapping.CallContext.runUntilDone(CallContext.java:289) at gnu.expr.ModuleExp.evalModule(ModuleExp.java:188) at kawa.Shell.run(Shell.java:233) at kawa.standard.load.loadSource(load.java:162) at kawa.standard.load.apply(load.java:275) at kawa.Shell.runFile(Shell.java:298) at kawa.repl.processArgs(repl.java:231) at kawa.repl.main(repl.java:634) From MAILER-DAEMON Mon Jan 12 14:29:32 2004 Received: from list by monty-python.gnu.org with archive (Exim 4.24) id 1Ag6zL-0002bR-2v for mharc-qexo-general@gnu.org; Mon, 12 Jan 2004 13:40:35 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Ag6vh-0001JD-Qq for qexo-general@gnu.org; Mon, 12 Jan 2004 13:36:49 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Ag6vA-00017Y-8L for qexo-general@gnu.org; Mon, 12 Jan 2004 13:36:48 -0500 Received: from [64.4.9.50] (helo=hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ag6v9-00016x-It for qexo-general@gnu.org; Mon, 12 Jan 2004 13:36:15 -0500 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 12 Jan 2004 09:34:44 -0800 Received: from 147.160.136.10 by lw9fd.law9.hotmail.msn.com with HTTP; Mon, 12 Jan 2004 17:34:44 GMT X-Originating-IP: [147.160.136.10] X-Originating-Email: [aubberdobber@hotmail.com] X-Sender: aubberdobber@hotmail.com From: "Aubrie & Jesse Lambert" To: qexo-general@gnu.org Bcc: Date: Mon, 12 Jan 2004 12:34:44 -0500 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 12 Jan 2004 17:34:44.0537 (UTC) FILETIME=[5E034290:01C3D932] X-Mailman-Approved-At: Mon, 12 Jan 2004 13:40:33 -0500 Subject: [Qexo-general] syntax question X-BeenThere: qexo-general@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Qexo, the GNU Kawa-based XQuery implementation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2004 18:36:51 -0000 Does anyone know how to use the "contains" xquery syntax operation in Qexo? This does not work: { for $t in doc("file://S:/Qexo/XML/books.xml")//(chapter|section) where contains ($t/text(),"XML") return $t } I want an operation that searches within the content to see if that word exists!!! Thank-you in advance, Aubrie _________________________________________________________________ Get a FREE online virus check for your PC here, from McAfee. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From MAILER-DAEMON Mon Jan 12 15:35:11 2004 Received: from list by monty-python.gnu.org with archive (Exim 4.24) id 1Ag8mF-0002sD-7G for mharc-qexo-general@gnu.org; Mon, 12 Jan 2004 15:35:11 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Ag8mC-0002qw-LL for qexo-general@gnu.org; Mon, 12 Jan 2004 15:35:08 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Ag7sX-000706-FN for qexo-general@gnu.org; Mon, 12 Jan 2004 14:38:08 -0500 Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1Ag7sW-0006yh-5L for qexo-general@gnu.org; Mon, 12 Jan 2004 14:37:36 -0500 Received: from [64.164.98.52] (helo=mtaw4.prodigy.net) by mx20.gnu.org with esmtp (Exim 4.24) id 1Ag6sW-00024e-Fo for qexo-general@gnu.org; Mon, 12 Jan 2004 13:33:32 -0500 Received: from bothner.com (adsl-216-102-199-253.dsl.snfc21.pacbell.net [216.102.199.253]) by mtaw4.prodigy.net (8.12.10/8.12.10) with ESMTP id i0CIXTjC016366; Mon, 12 Jan 2004 10:33:29 -0800 (PST) Message-ID: <4002E879.90502@bothner.com> Date: Mon, 12 Jan 2004 10:33:29 -0800 From: Per Bothner User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sascha Opletal Subject: Re: [Qexo-general] XML Header and URIs References: <3FD468FB.7070003@web.de> <3FFCA2CF.1080505@web.de> In-Reply-To: <3FFCA2CF.1080505@web.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: qexo-general@gnu.org X-BeenThere: qexo-general@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Qexo, the GNU Kawa-based XQuery implementation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2004 20:35:09 -0000 Sascha Opletal wrote: > I have two problems here... > > 1) Is it possible to use some uri-resolver with qexo, to resolve and use > custom uris? something like "message://some.xml" I don't know. Only if there is some standard Java plug-in mechanism for URI schemes. > 2) The qexo parses file a with an XML-Header correctly, but i can't > create a header in my output file. > > How can i insert an XML Header? Two methods: (a) Use the unescaped-data function (documented in the manual). (b) I just checked in a patch to emit an XML declaration when printing a document node. So you can do: document { ... } The does not include a specification of the encoding, because XMLPrinter doesn't know what the encoding is. If we did, we could also be more intelligent about when we need to emit character enteties. > A query would be like this: > > > { > > Xquery stuff here > > } This is not valid XQuery syntax. -- --Per Bothner per@bothner.com http://per.bothner.com/ From MAILER-DAEMON Mon Jan 12 15:50:53 2004 Received: from list by monty-python.gnu.org with archive (Exim 4.24) id 1Ag91R-00082Q-33 for mharc-qexo-general@gnu.org; Mon, 12 Jan 2004 15:50:53 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Ag91O-00081a-3E for qexo-general@gnu.org; Mon, 12 Jan 2004 15:50:50 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Ag90r-0007rb-NW for qexo-general@gnu.org; Mon, 12 Jan 2004 15:50:48 -0500 Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1Ag90r-0007rT-EZ for qexo-general@gnu.org; Mon, 12 Jan 2004 15:50:17 -0500 Received: from [64.164.98.52] (helo=mtaw4.prodigy.net) by mx20.gnu.org with esmtp (Exim 4.24) id 1Ag7r7-000712-KC for qexo-general@gnu.org; Mon, 12 Jan 2004 14:36:09 -0500 Received: from bothner.com (adsl-216-102-199-253.dsl.snfc21.pacbell.net [216.102.199.253]) by mtaw4.prodigy.net (8.12.10/8.12.10) with ESMTP id i0CJa8jC022126; Mon, 12 Jan 2004 11:36:08 -0800 (PST) Message-ID: <4002F727.8070607@bothner.com> Date: Mon, 12 Jan 2004 11:36:07 -0800 From: Per Bothner User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sascha Opletal Subject: Re: [Qexo-general] Parent Navigation References: <3FC93AB3.6040402@web.de> In-Reply-To: <3FC93AB3.6040402@web.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: qexo-general@gnu.org X-BeenThere: qexo-general@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Qexo, the GNU Kawa-based XQuery implementation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2004 20:50:51 -0000 I forgot about this bug report, but noticed it going back through email. (This is why it is best to use bugzilla.) Anyway, I just checked in a fix. Also checked in a testcase based on your bug report. Thanks! Sascha Opletal wrote: > The (hopefully) last Problem i have with Qexo is the parent navigation. > The Data is: > > > 1 > ... > > > I use this: > > for $a in doc("data2.xml")/a/b/@c > return > > {$a} > {$a/../@d} > > java.lang.ArrayIndexOutOfBoundsException: 2146304153 -- --Per Bothner per@bothner.com http://per.bothner.com/ From MAILER-DAEMON Mon Jan 12 15:59:39 2004 Received: from list by monty-python.gnu.org with archive (Exim 4.24) id 1Ag99v-0002oW-Gi for mharc-qexo-general@gnu.org; Mon, 12 Jan 2004 15:59:39 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Ag99r-0002mU-Nf for qexo-general@gnu.org; Mon, 12 Jan 2004 15:59:35 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Ag99K-0002YN-1U for qexo-general@gnu.org; Mon, 12 Jan 2004 15:59:33 -0500 Received: from [64.164.98.52] (helo=mtaw4.prodigy.net) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ag8v1-0006hF-9V for qexo-general@gnu.org; Mon, 12 Jan 2004 15:44:15 -0500 Received: from bothner.com (adsl-216-102-199-253.dsl.snfc21.pacbell.net [216.102.199.253]) by mtaw4.prodigy.net (8.12.10/8.12.10) with ESMTP id i0CJgijC001144; Mon, 12 Jan 2004 11:42:44 -0800 (PST) Message-ID: <4002F8B4.5030406@bothner.com> Date: Mon, 12 Jan 2004 11:42:44 -0800 From: Per Bothner User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Aubrie & Jesse Lambert Subject: Re: [Qexo-general] syntax question References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: qexo-general@gnu.org X-BeenThere: qexo-general@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Qexo, the GNU Kawa-based XQuery implementation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2004 20:59:36 -0000 Aubrie & Jesse Lambert wrote: > Does anyone know how to use the "contains" xquery syntax operation in Qexo? > > This does not work: > > { > for $t in doc("file://S:/Qexo/XML/books.xml")//(chapter|section) > where contains ($t/text(),"XML") > return $t > } > Try narrowing down the problem. Does $t/text() give you the expected text? Try that with: { for $t in doc("file://S:/Qexo/XML/books.xml")//(chapter|section) return {$t/text()} } If that doesn't work as expected, we can look at that first, without worrying about the contains. An alternative to '$t/text()' is 'string($t)' or just '$t'. But please let me know the results for all of these. -- --Per Bothner per@bothner.com http://per.bothner.com/ From MAILER-DAEMON Tue Jan 13 15:25:41 2004 Received: from list by monty-python.gnu.org with archive (Exim 4.24) id 1AgV6a-0001U5-Ru for mharc-qexo-general@gnu.org; Tue, 13 Jan 2004 15:25:40 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AgV6Y-0001TQ-IP for qexo-general@gnu.org; Tue, 13 Jan 2004 15:25:38 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AgV62-0001Oa-Ch for qexo-general@gnu.org; Tue, 13 Jan 2004 15:25:37 -0500 Received: from [128.121.143.16] (helo=mail14b.sanjose14-verio.com) by monty-python.gnu.org with smtp (Exim 4.24) id 1AgUk7-0006D6-6Y for qexo-general@gnu.org; Tue, 13 Jan 2004 15:02:27 -0500 Received: from mmm1401.rapidsite.net (128.121.143.98) by mail14b.sanjose14-verio.com (RS ver 1.0.88vs) with SMTP id 4-0221814089; Tue, 13 Jan 2004 15:01:29 -0500 (EST) Received: (from root@localhost) by mmm1401.sanjose14-verio.com (8.12.9/8.12.9/Submit) id i0DK1Vkb011434; Tue, 13 Jan 2004 20:01:31 GMT (envelope-from brian@blumenfeld-maso.com) Message-Id: <200401132001.i0DK1Vkb011434@mmm1401.sanjose14-verio.com> Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 From: "Brian Maso" To: per@bothner.com, qexo-general@gnu.org, sascha_opletal@web.de Subject: Re: [Qexo-general] XML Header and URIs Date: Tue, 13 Jan 2004 15:01:30 -0500 X-Mailer: AutoBahn Webmail X-Originating-Ip: 198.26.130.37 X-Loop-Detect: 1 Cc: X-BeenThere: qexo-general@gnu.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: Brian Maso List-Id: Qexo, the GNU Kawa-based XQuery implementation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2004 20:25:39 -0000 There is a paper on writing custom protocol handlers in Java at [1]. Brian Maso brian@blumenfeld-maso.com (949) 395-8551 [1] http://java.sun.com/developer/onlineTraining/protocolhandlers/ >----- ------- Original Message ------- ----- >From: per@bothner.com >To: sascha_opletal@web.de >Sent: Mon, 12 Jan 2004 10:33:29 > >Sascha Opletal wrote: > >> I have two problems here... >> >> 1) Is it possible to use some uri-resolver with >qexo, to resolve and use >> custom uris? something like "message://some.xml" > >I don't know. Only if there is some standard Java >plug-in mechanism >for URI schemes. > >> 2) The qexo parses file a with an XML-Header >correctly, but i can't >> create a header in my output file. >> >> How can i insert an XML Header? > >Two methods: >(a) Use the unescaped-data function (documented in >the manual). > >(b) I just checked in a patch to emit an XML >declaration when >printing a document node. So you can do: >document { ... } > >The does not include a specification of the >encoding, >because XMLPrinter doesn't know what the encoding >is. >If we did, we could also be more intelligent about >when >we need to emit character enteties. > >> A query would be like this: >> >> >> { >> >> Xquery stuff here >> >> } > >This is not valid XQuery syntax. >-- > --Per Bothner >per@bothner.com http://per.bothner.com/ > > > > >_______________________________________________ >Qexo-general mailing list >Qexo-general@gnu.org >http://mail.gnu.org/mailman/listinfo/qexo-general From MAILER-DAEMON Fri Jan 23 11:00:45 2004 Received: from list by monty-python.gnu.org with archive (Exim 4.24) id 1Ak3jg-0001f7-Io for mharc-qexo-general@gnu.org; Fri, 23 Jan 2004 11:00:44 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Ak3jc-0001dz-Vq for qexo-general@gnu.org; Fri, 23 Jan 2004 11:00:40 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Ak3j3-0001Xv-Ou for qexo-general@gnu.org; Fri, 23 Jan 2004 11:00:37 -0500 Received: from [193.252.22.23] (helo=mwinf0802.wanadoo.fr) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ak3j3-0001Xe-BQ for qexo-general@gnu.org; Fri, 23 Jan 2004 11:00:05 -0500 Received: from julien (AToulouse-206-2-1-32.w81-50.abo.wanadoo.fr [81.50.133.32]) by mwinf0802.wanadoo.fr (SMTP Server) with ESMTP id 677CF1800351 for ; Fri, 23 Jan 2004 17:00:03 +0100 (CET) From: Julien Vinel To: qexo-general@gnu.org Date: Fri, 23 Jan 2004 17:00:08 +0100 User-Agent: KMail/1.5.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401231700.08755.jvinel@free.fr> Subject: [Qexo-general] Problem with namespaces ... X-BeenThere: qexo-general@gnu.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: jvinel@free.fr List-Id: Qexo, the GNU Kawa-based XQuery implementation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2004 16:00:42 -0000 Hi all, I have a problem with xml element with namespace ... To use Qexo (kawa-1.7), i declare 3 or 4 namespace : // specific java class for geographic operators declare namespace geo = "class:operators.GeoOperators" // gml from opengis.org declare namespace gml = "http://www.opengis.net/gml" // wfs from opengis.org declare namespace wfs = "http://www.opengis.net/wfs" // and sometimes for test default element namespace = "http://www.openplans.org/topp" The xml document looks like that : toto toto titi titi tata tata I can access tag a with : for $x in document("test.xml")//wfs:a return $x tag b : for $x in document("test.xml")//gml:b return $x But i can't access tag c with : for $x in document("test.xml")//c return $x I tried with a default namespace and without ... Any idea to resolv my problems ? Thank you, Julien Vinel From MAILER-DAEMON Thu Jan 29 15:53:07 2004 Received: from list by monty-python.gnu.org with archive (Exim 4.24) id 1AmJ9u-0000XK-Dt for mharc-qexo-general@gnu.org; Thu, 29 Jan 2004 15:53:06 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AmJ9q-0000WE-Nz for qexo-general@gnu.org; Thu, 29 Jan 2004 15:53:02 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AmJ3p-0007Hj-Lm for qexo-general@gnu.org; Thu, 29 Jan 2004 15:47:21 -0500 Received: from [132.206.51.234] (helo=mail.cs.mcgill.ca) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AmJ3f-00078Z-DL for qexo-general@gnu.org; Thu, 29 Jan 2004 15:46:39 -0500 Received: from mimi.cs.mcgill.ca (mimi.CS.McGill.CA [132.206.51.5]) by mail.cs.mcgill.ca (Postfix) with ESMTP id 487ED2F902 for ; Thu, 29 Jan 2004 15:46:36 -0500 (EST) Received: by mimi.cs.mcgill.ca (Postfix, from userid 15035) id 021B35DE20; Thu, 29 Jan 2004 15:46:35 -0500 (EST) Date: Thu, 29 Jan 2004 15:46:35 -0500 (EST) From: Raj SUCHAK X-X-Sender: rsucha@mimi To: qexo-general@gnu.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: [Qexo-general] Java Question X-BeenThere: qexo-general@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Qexo, the GNU Kawa-based XQuery implementation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 20:53:04 -0000 Hello, Please excuse me if this is a silly question. I have tried looking for the answers in the mailing lists, Qexo documentation etc. but failed. -I have a simple xml file called bib.xml. I want to run a XQuery on it using Java. Here is the code I am using: ///////////////////////////////////////////////////////// System.out.println("QexoTester "); String expr = args[0]; try { XQuery.registerEnvironment(); Interpreter interp = Interpreter.getInterpreter(); Environment env = Environment.getCurrent(); CharArrayOutPort out = new CharArrayOutPort(); InPort in = new CharArrayInPort(expr); OutPort err = OutPort.errDefault(); SourceMessages messages = new SourceMessages(); Lexer lexer = interp.getLexer(in, messages); CallContext ctx = CallContext.getInstance(); ctx.consumer = interp.getOutputConsumer(out); Compilation comp = interp.parse(env, lexer); ModuleExp.evalModule(env, ctx, comp); ctx.runUntilDone(); System.out.println(out.toCharArray()); ///////////////////////////////////////////////////////// To this class I pass as argument: "for $x in document(C:/Raj/existingCode/bib.xml)//title return $x;" As you can see, I am just trying a very simple query. My questions are: 1) Is this the way you query xml files? All examples shown on the webpage and mailing list query simple sequences like (1,2,3). Can you please give an example of how to query an xml file. 2) When I run this, out.toCharArray() returns nothing. Am I missing some initialization parms? 3) Does the InPort object represent the xml file being queried? 4) I realized that Qexo is pre-alpha software and a one man show. Thank you for all your effort. Is there any kind of JavaDoc API available that describes the classes? I downloaded kava-1.7.jar source code but couldn't find much documentation associated with it. Once again, thank you for your help. -Raj From MAILER-DAEMON Thu Jan 29 16:36:07 2004 Received: from list by monty-python.gnu.org with archive (Exim 4.24) id 1AmJpW-0001Z9-Vb for mharc-qexo-general@gnu.org; Thu, 29 Jan 2004 16:36:07 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AmJpU-0001YT-F7 for qexo-general@gnu.org; Thu, 29 Jan 2004 16:36:04 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AmJow-0001P3-9Z for qexo-general@gnu.org; Thu, 29 Jan 2004 16:36:02 -0500 Received: from [216.102.199.253] (helo=bothner.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AmJou-0001Mo-5e for qexo-general@gnu.org; Thu, 29 Jan 2004 16:35:28 -0500 Received: from bothner.com (persmac [192.168.1.10]) by bothner.com (8.12.10/8.12.10) with ESMTP id i0TLawbr024646; Thu, 29 Jan 2004 13:36:58 -0800 Message-ID: <40197C90.2030008@bothner.com> Date: Thu, 29 Jan 2004 13:35:12 -0800 From: Per Bothner User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Raj SUCHAK Subject: Re: [Qexo-general] Java Question References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: qexo-general@gnu.org X-BeenThere: qexo-general@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Qexo, the GNU Kawa-based XQuery implementation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 21:36:05 -0000 Raj SUCHAK wrote: > SourceMessages messages = new SourceMessages(); > Lexer lexer = interp.getLexer(in, messages); > CallContext ctx = CallContext.getInstance(); > ctx.consumer = interp.getOutputConsumer(out); > Compilation comp = interp.parse(env, lexer); > ModuleExp.evalModule(env, ctx, comp); > ctx.runUntilDone(); Please use the published interfaces if at all possible. Specifically, I recommend the eval methods documented in http://www.gnu.org/software/qexo/Running.html Anything else I feel free to change at any time, and/or you're on your own. Thus: InPort in = new CharArrayInPort(expr); CharArrayOutPort out = new CharArrayOutPort(); XQuery xq = new XQuery(); xq.eval((Reader) in, (Consumer) out); or: xq.eval(expr, (Consumer) out); or: xq.eval(expr, new XMLPrinter(out)); > System.out.println(out.toCharArray()); > ///////////////////////////////////////////////////////// > To this class I pass as argument: > "for $x in document(C:/Raj/existingCode/bib.xml)//title return $x;" > > As you can see, I am just trying a very simple query. My questions are: > > 1) Is this the way you query xml files? All examples shown on the webpage > and mailing list query simple sequences like (1,2,3). Can you please give > an example of how to query an xml file. You need to quote the pathname, since it's a string. Also, 'document' is now plain 'doc'. And I don't believe the semicolon is correct. Thus: "for $x in doc('C:/Raj/existingCode/bib.xml')//title return $x" > > 2) When I run this, out.toCharArray() returns nothing. Am I missing some > initialization parms? I'm not sure. Try the eval methods. > 3) Does the InPort object represent the xml file being queried? No. > 4) I realized that Qexo is pre-alpha software and a one man show. Thank > you for all your effort. Is there any kind of JavaDoc API available that > describes the classes? I downloaded kava-1.7.jar source code but couldn't > find much documentation associated with it. Get the newer 1.7.90 (or the even newer CVS sources). It has many improvements. The internal JavaDoc documentation is: http://www.gnu.org/software/kawa/api/ There is a "how-Kawa-works" paper at: http://www.gnu.org/software/kawa/internals.html but it is somewhat old and Scheme-focused. -- --Per Bothner per@bothner.com http://per.bothner.com/