W3C home > Mailing lists > Public > www-ql@w3.org > October to December 2002

RE: XQuery parameters

From: Michael Rys <mrys@microsoft.com>
Date: Thu, 14 Nov 2002 10:40:55 -0800
Message-ID: <5C39F806F9939046B4B1AFE652500A3A037027C8@RED-MSG-10.redmond.corp.microsoft.com>
To: Stéphane Mbaye <stephane.mbaye@gael.fr>, "XQuery" <www-ql@w3.org>
Dear Stephane


Thanks for your comment and suggestion. We are currently indeed looking into such mechanisms.


Although as a workaround, you could always wrap your XQuery expression into a parameterized function and provide the function parameter as part of your function invocation (this assumes that the XQuery API provides a way to call an XQuery function directly).


Best regards



-----Original Message-----
From: Stéphane Mbaye [mailto:stephane.mbaye@gael.fr] 
Sent: Thursday, November 14, 2002 6:55 AM
To: XQuery
Subject: XQuery parameters


Dear Sirs,


does the XQuery language foresee a mechanism for parameters set outside the query script ?

Such a system would enable the evaluation of queries from different documents or with different

extents, constants, etc. without modifying the source code of the query.


The parameter may be atomic values, possibly labeled or identified by a QName and have a default value

such as attributes of XML elements.


As an example a parameterized query may be :




   let $input := document( parameter("inputDocument",xsd:anyURI,"bibl.xml") <!-THE PARAMETER -->

   for $a in distinct-values($input//author)





           { $a/text() }




           for $b in $input//book

           where $b/author = $a

           return $b/title 








Best regards








GAEL Consultant 

Cité Descartes
18, rue Albert Einstein
77420 Champs-sur-Marne

Software Director





tel +33-(0)1 64 73 99 55
fax +33-(0)1 64 73 51 60





Received on Thursday, 14 November 2002 13:41:26 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:17:15 UTC