Re: XQuery implementations

Juha <[email protected]>
Newsgroups gmane.comp.web.query-languages
Message-ID <[email protected]>
Hi,

Thank you everyone for your responses!

I am designing a system for accessing and modifying XML database content 
with XForms. This would enable you to do define dynamic web applications 
in a declarative way. I will most likely use XQuery for selecting the 
instance data for XForms. There is an example configuration file at the 
end of this e-mail.

As a test case or example, I am creating a web interface for editing the 
  definition files of a web-based exam system that I built last year for 
my university. It has an XML grammar for defining the exams, and I am 
tired of teaching the specs of my undocumented XML grammar to the people 
who create the exams ;)

Sorry about the errors in my example, I was trying out a similar query 
with XHive's online demo (without attribute testing), and that was my 
first two hours of learning XQuery, plus it was 4 am, and I just had my 
third lobotomy this year ;)

juha

here's an example of how you would setup a web application using the 
system (note that it's just a sketch right now):

<webapp xmlns="http://www.xsmiles.org/database/webapp-11-2003"
         xmlns:quiz="http://www.xsmiles.org/applications/webquiz">
   <info>
     <name>quiz</name>
     <database>
       <uri src="xmldb:exist://localhost:8080/exist/xmlrpc/db"/>
       <login name="admin" pass="admin"/>
       <collection name="quiz" path="/db/quiz"/>
     </database>
     <schema src="http://www.xsmiles.org/schemas/global.xsd"/>
   </info>

   <!-- Default is needed, because we might want to edit fragments of -->
   <!-- the complete collection, without transfering all the children -->
   <!-- to the client. For example, in this case, if a new chapter is -->
   <!-- added to the database, the question/* branch will be appended -->
   <!-- to the database as default data -->
   <defaultInstance
     xmlns="http://www.xsmiles.org/applications/webquiz">
     <data>
       <quiz>
         <config/>
         <intro/>
         <category>
           <question>
             <title/>
             <selectOne>
               <item/>
               <item/>
               <item/>
             </selectOne>
             <answer/>
           </question>
         </category>
       </quiz>
     </data>
   </defaultInstance>

<!-- each binding describes a mapping between a part of the xml tree -->
<!-- and a xforms editor -->
<binding name="quizes-edit" >
    <annotate>Edit all quizes</annotate>
    <instance target="data">
        <![CDATA[
          an XQuery statement to select the instance data from the DB
        ]]>
    </instance>
    <editor src="http://xsmiles.org/editors/quizes-editor.xhtml"/>
</binding>

<binding name="categories-edit">
    <annotate>Edit all categories in a quiz</annotate>
    <instance .../>
    <editor select="editors/catogories-editor"/>
</binding>
<webapp>


Xavier Franc wrote:
> Hello Juha,
> 
> why not try by yourself ? for the record, there
> are 5 open-source engines listed on the W3C site:
> - Fatdog's XQEngine
> - GNU's Qexo (Kawa-Query)
> - Lucent's Galax
> - Sourceforge's Saxon
> - Qizx/Open
> 
> By the way, I will be surprised if your query
> works as it is:
> in the where clause:  where @id = 'a'
> the path expression '@id' has no initial node(s), therefore
> -if I make no bloomer- a run-time error should be raised.
> 
> 
> 
>>> -----Original Message-----
>>> From: [email protected] [mailto:[email protected]]On Behalf Of
>>> Juha Vierinen
>>> Sent: Friday, November 21, 2003 5:19 AM
>>> To: [email protected]
>>> Subject: XQuery implementations
>>>
>>> Hi,
>>>
>>> Does anyone know of a open source XQuery implementation that can do the
>>> following statement:
>>>
>>>
>>> for $quizes in document(/db/quiz/data)/quiz
>>>    for $categories in $quizes/category
>>>       for $questions in $categories/question
>>>       where @id = 'a'
>>>       return
>>>       <quiz>
>>>           {$quizes/@*}
>>>            <category>
>>>               {$categories/@*}
>>>                     {$question}
>>>            </category>
>>> </quiz>
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.