Xquery collections
Hello I Michele i'm new to basex, i created a collection with different documents .xml. I want to know how to query the entire collection e its documents at one xquery. I'm trying,but i can't. Thanks. MG
-- ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it, per tutti i dettagli Clicca qui http://posta.email.it/caselle-di-posta-z-email-it/?utm_campaign=email_Zimbra_102014=main_footer/f
Sponsor: Caselle con tuo dominio su piattaforma Zimbra, fino a 30 GB di spazio, sincronizzazione dati e backup Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=13324&d=3-9
Ciao Michele,
welcome to the community :-)
Collections in BaseX are basically databases. You can simply open a database e.g. by issueing the XQuery db:open('mydatabase'). This will use all documents in your database.
You can find some more examples at http://docs.basex.org/wiki/Databases
It might also be helpful for you to read some of the Tutorials given at http://docs.basex.org/wiki/Getting_Started like BaseX for Dummies, given a concise introduction to BaseX.
Spero che sia d'aiuto Dirk
Quoted text · michele.greco2 at email.it · 19 lines
On 09/03/2015 05:48 PM, michele.greco2 at email.it wrote: > Hello I Michele i'm new to basex, > i created a collection with different documents .xml. > I want to know how to query the entire collection e its documents at > one xquery. > I'm trying,but i can't. > > Thanks. > MG > > > ---- > ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it, > per tutti i dettagli clicca qui > <http://posta.email.it/caselle-di-posta-z-email-it/?utm_campaign=email_Zimbra_102014=main_footer> > > Sponsor: > Idee regalo classiche o alternative? Trova l'offerta migliore in un click > Clicca qui <http://adv.email.it/cgi-bin/foclick.cgi?mid=13327&d=20150903>
Hi, i tried this xquery:
for $e in db:open("dbName")//w:tc[.//text()="Nome"] return $e/./following::text()except
(for $x in db:open("dbName")//w:tc[.//text()="Indirizzo"]
return $x//following::text())
but only returns the result of the first document.
How do i do it for all the documents?
Quoted text · Dirk Kirsten · 45 lines
--------- Original Message -------- Da: "Dirk Kirsten" <dk at basex.org> To: Cc: basex-talk at mailman.uni-konstanz.de Oggetto: Re: [basex-talk] Xquery collections Data: 03/09/15 18:08 Ciao Michele, welcome to the community :-) Collections in BaseX are basically databases. You can simply open a database e.g. by issueing the XQuery db:open('mydatabase'). This will use all documents in your database. You can find some more examples at http://docs.basex.org/wiki/Databases It might also be helpful for you to read some of the Tutorials given at http://docs.basex.org/wiki/Getting_Started like BaseX for Dummies, given a concise introduction to BaseX. Spero che sia d'aiuto Dirk On 09/03/2015 05:48 PM, michele.greco2 at email.it wrote: Hello I Michele i'm new to basex, i created a collection with different documents .xml. I want to know how to query the entire collection e its documents at one xquery. I'm trying,but i can't. Thanks. MG ---- ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it, per tutti i dettagli clicca qui Sponsor: Idee regalo classiche o alternative? Trova l'offerta migliore in un click Clicca qui -- Dirk Kirsten, BaseX GmbH, http://basexgmbh.de |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 -- ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it, per tutti i dettagli Clicca qui http://posta.email.it/caselle-di-posta-z-email-it/?utm_campaign=email_Zimbra_102014=main_footer/f Sponsor: Soluzioni di email hosting per tutte le esigenze: dalle caselle gratuite a quelle professionali su piattaforma Zimbra, da quelle su proprio dominio a quelle certificate PEC. Confronta le soluzioni Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=13325&d=4-9
Hi Michele,
The query looks quite unusual to me, because in practice, the following axis is hardly required. Could you possibly tell us what you would like to achieve? Next, did you deliberately write "$e/./"? It's the same as "$e/".
Christian
Quoted text · michele.greco2 · 71 lines
On Fri, Sep 4, 2015 at 3:49 PM, <michele.greco2 at email.it> wrote: > Hi, i tried this xquery: > for $e in db:open("dbName")//w:tc[.//text()="Nome"] > return $e/./following::text()except > (for $x in db:open("dbName")//w:tc[.//text()="Indirizzo"] > return $x//following::text()) > > but only returns the result of the first document. > How do i do it for all the documents? > > --------- Original Message -------- > Da: "Dirk Kirsten" <dk at basex.org> > To: > Cc: basex-talk at mailman.uni-konstanz.de > Oggetto: Re: [basex-talk] Xquery collections > Data: 03/09/15 18:08 > > Ciao Michele, > > welcome to the community :-) > > Collections in BaseX are basically databases. You can simply open a database > e.g. by issueing the XQuery db:open('mydatabase'). This will use all > documents in your database. > > You can find some more examples at http://docs.basex.org/wiki/Databases > > It might also be helpful for you to read some of the Tutorials given at > http://docs.basex.org/wiki/Getting_Started like BaseX for Dummies, given a > concise introduction to BaseX. > > Spero che sia d'aiuto > Dirk > > > > On 09/03/2015 05:48 PM, michele.greco2 at email.it wrote: > > Hello I Michele i'm new to basex, > i created a collection with different documents .xml. > I want to know how to query the entire collection e its documents at one > xquery. > I'm trying,but i can't. > > Thanks. > MG > > > ---- > ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it, per > tutti i dettagli clicca qui > > Sponsor: > Idee regalo classiche o alternative? Trova l'offerta migliore in un click > Clicca qui > > > -- Dirk Kirsten, BaseX GmbH, http://basexgmbh.de |-- Firmensitz: > Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, > Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael > Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 > > > ---- > ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it, per > tutti i dettagli clicca qui > > Sponsor: > Caselle con tuo dominio su piattaforma Zimbra, fino a 30 GB di spazio, > sincronizzazione dati e backup > Clicca qui
Hi Michele, Is it not because the following axis do'nt return the childrens? Do you try without the except to see if you have all your text()? Marc
Quoted text · michele.greco2 at email.it · 73 lines
Le 04/09/2015 15:49, michele.greco2 at email.it a écrit : > Hi, i tried this xquery: > for $e in db:open("dbName")//w:tc[.//text()="Nome"] > return $e/./following::text()except > (for $x in db:open("dbName")//w:tc[.//text()="Indirizzo"] > return $x//following::text()) > but only returns the result of the first document. > How do i do it for all the documents? > > --------- Original Message -------- > Da: "Dirk Kirsten" <dk at basex.org> > To: > Cc: basex-talk at mailman.uni-konstanz.de > Oggetto: Re: [basex-talk] Xquery collections > Data: 03/09/15 18:08 > > Ciao Michele, > > welcome to the community :-) > > Collections in BaseX are basically databases. You can simply open a > database e.g. by issueing the XQuery db:open('mydatabase'). This > will use all documents in your database. > > You can find some more examples at http://docs.basex.org/wiki/Databases > > It might also be helpful for you to read some of the Tutorials given > at http://docs.basex.org/wiki/Getting_Started like BaseX for > Dummies, given a concise introduction to BaseX. > > Spero che sia d'aiuto > Dirk > > > > On 09/03/2015 05:48 PM, michele.greco2 at email.it wrote: > > Hello I Michele i'm new to basex, > i created a collection with different documents .xml. > I want to know how to query the entire collection e its > documents at one xquery. > I'm trying,but i can't. > Thanks. > MG > > ---- > ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio > email.it, per tutti i dettagli clicca qui > <http://posta.email.it/caselle-di-posta-z-email-it/?utm_campaign=email_Zimbra_102014=main_footer> > > Sponsor: > Idee regalo classiche o alternative? Trova l'offerta migliore in > un click > Clicca qui > <http://adv.email.it/cgi-bin/foclick.cgi?mid=13327&d=20150903> > > > -- Dirk Kirsten, BaseX GmbH, http://basexgmbh.de |-- Firmensitz: > Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: > 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander > Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: > 0049 7531 20 05 22 > > > ---- > ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it, per > tutti i dettagli clicca qui > <http://posta.email.it/caselle-di-posta-z-email-it/?utm_campaign=email_Zimbra_102014=main_footer> > > Sponsor: > Caselle con tuo dominio su piattaforma Zimbra, fino a 30 GB di spazio, > sincronizzazione dati e backup > Clicca qui <http://adv.email.it/cgi-bin/foclick.cgi?mid=13324&d=20150904>
Written for BaseX 8.2. BaseX may have changed since: please check the current documentation.