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 :
 
<authlist>
 {
   let $input := document( parameter(“inputDocument”,xsd:anyURI,”bibl.xml”) <!—THE PARAMETER -->
   for $a in distinct-values($input//author)
   return
     <author>
      {
        <name>
           { $a/text() }
        </name>,
        <books>
         {
           for $b in $input//book
           where $b/author = $a
           return $b/title 
         }
        </books>
      }
     </author>
 }
</authlist>
 
Best regards
 
 
Stéphane
Mbaye
  _____  

 
 
GAEL Consultant 
Cité Descartes
18, rue Albert Einstein
77420 Champs-sur-Marne
France 
Software Director
 
mailto:stephane.mbaye@gael.fr
http://www.gael.fr 
 
 
tel +33-(0)1 64 73 99 55
fax +33-(0)1 64 73 51 60
 
 
 
 
 

Received on Thursday, 14 November 2002 09:54:33 UTC