From andrew.j.welch at gmail.com Thu Jun 6 08:47:16 2013 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Thu, 6 Jun 2013 16:47:16 +0100 Subject: [xquery-talk] contains or tokenize usage help required in Xquery In-Reply-To: <1370532966.98733.YahooMailNeo@web141601.mail.bf1.yahoo.com> References: <1370532966.98733.YahooMailNeo@web141601.mail.bf1.yahoo.com> Message-ID: On 6 June 2013 16:36, sudheshna iyer wrote: > Hello All, > > I will get a string of error codes from my vendor in a comma seperated > format. > I need an xquery function, which will return "Success" or "Failure" or > "Error" based on the following: > > If string contains AE* or -> Return "Failure" > else if GE* or SE* -> Return "Error" > else "Success" if (contains($str, 'AE')) then 'Failure' else if (contains($str, 'GE') or contains($str, 'SE') then 'Error' else 'Success' you get the idea.... if that's not sufficient then tokenize on comma and iterate the sequence checking each using starts-with(). > Below are the samples of strings that I can receive. > AS01,GS03 > -> Should return Success > AS01,GS01 > -> Should return Success > AS01,GE02 > -> Should return Error > AE01,GE02 > -> Should return Failure > > Thank you very much for your help. > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk -- Andrew Welch http://andrewjwelch.com From joewiz at gmail.com Thu Jun 6 09:49:59 2013 From: joewiz at gmail.com (Joe Wicentowski) Date: Thu, 6 Jun 2013 12:49:59 -0400 Subject: [xquery-talk] contains or tokenize usage help required in Xquery In-Reply-To: References: <1370532966.98733.YahooMailNeo@web141601.mail.bf1.yahoo.com> <1370534044.22721.YahooMailNeo@web141606.mail.bf1.yahoo.com> <1ee9d67ea84248eb9cdade34a9a3a373@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: > if( startsWith($s,"GE") or startsWith("SE" ) ) then return "Error" ---> if ( starts-with($s, "GE") or starts-with($s, "SE") ) then "Error" From msokolov at safaribooksonline.com Tue Jun 18 04:44:32 2013 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Tue, 18 Jun 2013 07:44:32 -0400 Subject: [xquery-talk] [ANN] Lux XML search engine Message-ID: <51C04820.1030409@safaribooksonline.com> I'm pleased to announce the first public release of Lux (version 0.9.1), an XML search engine embedding Saxon 9 and Lucene/Solr 4. Lux offers many features found in XML databases: persistent XML storage, index-optimized querying, an interactive query window, and some application support features - it is possible to build applications written exclusively in XQuery and XSLT using Lux. I call it a search engine, though, to indicate this is not a replacement for a full-featured database. I hope existing Solr/Lucene users dealing with XML documents will find Lux adds a unique and compelling query capability. Lux grew out of the need to provide an XML-aware query capability for documents stored in and indexed by Solr/Lucene; it is currently in use at my workplace, both as an ad hoc query tool for developers and as part of our content ingestion process. We believe that others may find it useful as well, and are providing it under an open source license in the hope that wider exposure will lead to a longer, healthier life. Lux is built on a production quality code base. It has been rigorously tested, and all known critical defects have been resolved. However, it is in a fairly early stage of development (it's about a year old). This means there are features users will miss. Some of them we already know about (see the Plans page on the web site or the issue tracker), but the relatively narrow distribution so far means there are certainly more to be found. I encourage you to report these on the mailing list (see below): this is a unique opportunity to influence the direction Lux takes in the future. Lots more information, including downloads and setup instructions, is available at http://luxdb.org, source code is at http://github.com/msokolov/lux, issues are tracked at http://issues.luxdb.org/, and please let us know what you think using the (brand new) mailing list at luxdb at luxdb.org, archived at https://groups.google.com/forum/?fromgroups#!topic/luxdb. (Please note the mailing list is hosted as a google group, which makes it a bit tricky to sign up with a non-gmail address, but you can. To do that, just tack your email address on to this link: http://groups.google.com/group/luxdb/boxsubscribe?email=) -Mike Sokolov PS: apologies for cross-posting; there is some overlap among the readership of these groups, I know -- but they are not identical, and we'll keep any followup to a single list -- or on the luxdb list. From pgfearo at googlemail.com Tue Jun 18 10:50:08 2013 From: pgfearo at googlemail.com (Philip Fearon) Date: Tue, 18 Jun 2013 18:50:08 +0100 Subject: [xquery-talk] [ANN] Syntax-highlighting XQuery 3.0 with XSLT Message-ID: Dear list members, I'm pleased to announce that I've just updated the XMLSpectrum project so it can now generate syntax-highlighted HTML for XQuery code conforming to the candidate recommendation for XQuery 3.0. XMLSpectrum comprises a set of standard-XSLT 2.0 stylesheets for syntax-highlighting languages that are part of the XPath family. Other supported specifications include XSLT 3.0, Schematron, XProc and XML Schema 1.1. XSLT parameters allow control over a range of options including 6 customisable color themes and css placement (inline/internal/external). Though this is purely an XSLT solution, a light-weight Java GUI front-end is included with the project - providing quick access to many of the rendering options for the transform and a built-in webkit browser for reviewing the result. To give an idea of how this performs for XQuery, the XHTML result from running the XMLSpectrum XSLT against the W3C (XQuery 3.0) specification samples is shown here: http://qutoric.com/samples/xquery-3.0cr-samples.html XMLSpectrum is an open source project hosted on GitHub at: https://github.com/pgfearo/xmlspectrum Many thanks Phil Fearon From dk at basex.org Wed Jun 19 04:28:38 2013 From: dk at basex.org (Dirk Kirsten) Date: Wed, 19 Jun 2013 13:28:38 +0200 Subject: [xquery-talk] value not bound exception while using empty() In-Reply-To: References: <2fcd3e72007340cea4a58b5e69a33faf@BY2PR08MB014.namprd08.prod.outlook.com> <15FC9FFE-12B8-47BC-B8EE-F602E5E7F69D@saxonica.com> <3507C53B-9D7F-41F4-A687-18C6F6E36FFB@saxonica.com> Message-ID: <51C195E6.8000505@basex.org> As you have to bind external variables in XQuery 1.0, just bind it to an empty sequence. So in your scenario: In case you get an empty result set for your values / nodes, just bind the external variable $a to an empty sequence. This way you can than also check for fn:empty($a). Cheers, Dirk On 06/19/2013 01:12 PM, Kunal Chauhan wrote: > Yes, that I know. I bind several different items. > > but the scenario is after some processing I get some value / nodes which > I need to bind to execute query. > in this case, I didn't get any value / node. > Still I need to run the query. > > declare variable $a external; > return empty($a) > > Query is generated dynamically, variable is defined but for $a I didn't > get any value. > So, I am unable to bind it. > and that's why I getting an error. > > > > > On Wed, Jun 19, 2013 at 4:20 PM, Michael Kay > wrote: > > Yes, of course you can bind a value from the application. In XQJ > that's done using the bind...() methods of XQDynamicContext. > > Michael Kay > Saxonica > > On 19 Jun 2013, at 08:58, Kunal Chauhan wrote: > >> Yes Michael, You are right. >> as soon as I run this query through java code where I am using >> XQuery 1.0 and XQJ implementation. It gives me an error. >> >> earlier I tried with Query editor so it works. but after >> integrating it with java code it doesn't. >> >> Is there any way to bind an empty sequence or any other work around? >> >> >> >> On Wed, Jun 19, 2013 at 12:52 PM, Michael Kay > > wrote: >> >> Actually, this is XQuery 3.0 syntax. >> >> XQuery 1.0 gives you no way to define a default value for an >> external variable (a crazy omission). >> >> You clearly have an expectation that the default value for an >> external variable should be an empty sequence. You may regard >> that as intuitive, but it's not what the spec says. >> >> Michael Kay >> Saxonica >> >> >> >> On 19 Jun 2013, at 07:34, Kunal Chauhan wrote: >> >>> Thanks David, Thanks for your quick response. >>> It's works. >>> can you tell me logic behind this ? >>> >>> >>> On Wed, Jun 19, 2013 at 11:44 AM, David Lee >> > wrote: >>> >>> try ____ >>> >>> __ __ >>> >>> declare variable $a external := ();____ >>> >>> __ __ >>> >>> __ >>> >> >> >> >> -- >> *Kunal Chauhan* >> mail4ck at gmail.com >> [+918655517141] >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > > > > -- > *Kunal Chauhan* > mail4ck at gmail.com > [+918655517141] > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -- Dirk Kirsten, BaseX GmbH, http://basex.org |-- 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 From joewiz at gmail.com Thu Jun 20 06:52:03 2013 From: joewiz at gmail.com (Joe Wicentowski) Date: Thu, 20 Jun 2013 09:52:03 -0400 Subject: [xquery-talk] JSONiq book available on Amazon In-Reply-To: <4F40A19D-E381-40D5-9BDC-1955EDCCEF58@mac.com> References: <4F40A19D-E381-40D5-9BDC-1955EDCCEF58@mac.com> Message-ID: Hi Daniela, Congratulations to you and the authors - I see a lot of value with JSONiq and hope the book leads to broader interest and adoption. I see the book is available as a Kindle edition too. Do you have a sense of whether the Kindle edition is formatted well enough that you would recommend it for readers? Joe From gkholman at CraneSoftwrights.com Thu Jun 20 07:48:59 2013 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Thu, 20 Jun 2013 10:48:59 -0400 Subject: [xquery-talk] strange behaviour of XQuery In-Reply-To: References: Message-ID: <7.0.1.0.2.20130620104743.024b98f0@wheresmymailserver.com> At 2013-06-20 20:16 +0530, Kunal Chauhan wrote: >Hello All, > >I run some sample XQuery. and it gives me very strange answer. >Following are my Query with the result. > >Query 1 : > >let $a := 10000 >let $b := 100000 > >return $a >= $b > >Output : false > > >Query 2 : > >let $a := 50000 >let $b := 100000 > >return $a >= $b > >Output : true > > >Query 3 : > >let $a := 50000 >let $b := 100000 > >return $a >= $b > >Output : false > >I am surprised with output of query 2. when I remove node and make >it value it gives proper output. > >can anyone tell me why it's behave lilke this way. In the absence of a schema declaring that and are numbers, the values are considered to be text strings. In your third example, the values are not nodes but are numbers by the syntax you've used, so you get what you expect. I hope this helps. . . . . . . . . Ken -- Contact us for world-wide XML consulting and instructor-led training | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ | G. Ken Holman mailto:gkholman at CraneSoftwrights.com | Google+ profile: https://plus.google.com/116832879756988317389/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal | From john.snelson at marklogic.com Thu Jun 20 07:50:40 2013 From: john.snelson at marklogic.com (John Snelson) Date: Thu, 20 Jun 2013 15:50:40 +0100 Subject: [xquery-talk] strange behaviour of XQuery In-Reply-To: References: Message-ID: <51C316C0.3070706@marklogic.com> The comparisons of element values are being done with string semantics. With untyped XML you should cast to a numeric type to reliably get numeric comparisons. John On 20/06/13 15:46, Kunal Chauhan wrote: > Hello All, > > I run some sample XQuery. and it gives me very strange answer. > Following are my Query with the result. > > Query 1 : > > let $a := 10000 > let $b := 100000 > > return $a >= $b > > Output : false > > > Query 2 : > > let $a := 50000 > let $b := 100000 > > return $a >= $b > > Output : true > > > Query 3 : > > let $a := 50000 > let $b := 100000 > > return $a >= $b > > Output : false > > I am surprised with output of query 2. when I remove node and make it > value it gives proper output. > > can anyone tell me why it's behave lilke this way. > > Regards, > > -- > *Kunal Chauhan* > mail4ck at gmail.com > [+918655517141] > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -- John Snelson, Lead Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com From john.snelson at marklogic.com Thu Jun 20 08:08:06 2013 From: john.snelson at marklogic.com (John Snelson) Date: Thu, 20 Jun 2013 16:08:06 +0100 Subject: [xquery-talk] strange behaviour of XQuery In-Reply-To: References: <7.0.1.0.2.20130620104743.024b98f0@wheresmymailserver.com> Message-ID: <51C31AD6.2090507@marklogic.com> Comparison under the default collation is simple codepoint-wise lexicographical comparison. John On 20/06/13 16:05, Kunal Chauhan wrote: > Ken , John you are right. > If we compare any two untyped value in XQuery, it will treated as string. > but Still if we compare string length wise or something, in that case > also it should give false result for query 2. > and why I am getting right ans for query 1 ? > > it would be good and helpful for me if any one can tell me on what basis > the comparison done ? > > Thanks, > > > On Thu, Jun 20, 2013 at 8:18 PM, G. Ken Holman > > > wrote: > > At 2013-06-20 20:16 +0530, Kunal Chauhan wrote: > > Hello All, > > I run some sample XQuery. and it gives me very strange answer. > Following are my Query with the result. > > Query 1 : > > let $a := 10000 > let $b := 100000 > > return $a >= $b > > Output : false > > > Query 2 : > > let $a := 50000 > let $b := 100000 > > return $a >= $b > > Output : true > > > Query 3 : > > let $a := 50000 > let $b := 100000 > > return $a >= $b > > Output : false > > I am surprised with output of query 2. when I remove node and > make it value it gives proper output. > > can anyone tell me why it's behave lilke this way. > > > In the absence of a schema declaring that and are numbers, > the values are considered to be text strings. In your third > example, the values are not nodes but are numbers by the syntax > you've used, so you get what you expect. > > I hope this helps. > > . . . . . . . . Ken > > -- > Contact us for world-wide XML consulting and instructor-led training | > Free 5-hour lecture: > http://www.CraneSoftwrights.__com/links/udemy.htm > | > Crane Softwrights Ltd. http://www.CraneSoftwrights.__com/q/ > | > G. Ken Holman > mailto:gkholman at __CraneSoftwrights.com > | > Google+ profile: > https://plus.google.com/__116832879756988317389/about > | > Legal business disclaimers: http://www.CraneSoftwrights.__com/legal > | > > _________________________________________________ > talk at x-query.com > http://x-query.com/mailman/__listinfo/talk > > > > > > -- > *Kunal Chauhan* > mail4ck at gmail.com > [+918655517141] > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -- John Snelson, Lead Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com From luca.cervone at unibo.it Thu Jun 20 08:17:58 2013 From: luca.cervone at unibo.it (Luca Cervone) Date: Thu, 20 Jun 2013 15:17:58 +0000 Subject: [xquery-talk] Log users into existdb using md5 password (xquery) Message-ID: <49EC16A90160C646BCAF14CB911C4B84A82D6216@E10-MBX1-CS.personale.dir.unibo.it> Hi, I need to log users into existdb using xquery. Of course I can use this code: xquery version "3.0"; declare namespace exist = "http://exist.sourceforge.net/NS/exist"; declare namespace request="http://exist-db.org/xquery/request"; declare namespace xmldb="http://exist-db.org/xquery/xmldb"; declare option exist:serialize "method=json media-type=text/javascript"; let $userName := request:get-parameter("userName", ()) let $hash := request:get-parameter("hash", ()) let $login := xmldb:authenticate('/db', $userName, $hash) return {$login} {$userName} The problem is that, due to the fact that I receive the password and the username from another service, I receive them in hash form encrypted with md5 (because the can't be passed in clear from a service to another). But the xmldb:authenticate function needs the password in clear. How can I resolve this? Any idea? Is there a way to login 'manually' in xquery without using the authenticate function? Luca Cervone Web And XML Solutions Designer CIRSFID - University of Bologna, Via Galliera 3, 40122, Bologna (Italy) Office Phone Number: +39 051 277267 Home Phone Number: +39 051 19982894 Mobile Phone: +39 3482627545 Skype: cervoneluca Email: cervoneluca at gmail.com, luca.cervone at unibo.it 5x1000 AI GIOVANI RICERCATORI DELL'UNIVERSIT? DI BOLOGNA Codice Fiscale: 80007010376 www.unibo.it/Vademecum5permille Questa informativa ? inserita in automatico dal sistema al fine esclusivo della realizzazione dei fini istituzionali dell?ente. From adam.retter at googlemail.com Thu Jun 20 08:26:27 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Thu, 20 Jun 2013 16:26:27 +0100 Subject: [xquery-talk] Log users into existdb using md5 password (xquery) In-Reply-To: <49EC16A90160C646BCAF14CB911C4B84A82D6216@E10-MBX1-CS.personale.dir.unibo.it> References: <49EC16A90160C646BCAF14CB911C4B84A82D6216@E10-MBX1-CS.personale.dir.unibo.it> Message-ID: Luca, As this is a very eXist-db specific question can I ask you to re-post this on the exist-open mailing list please? Here is not really the correct forum for eXist specific questions... On 20 June 2013 16:17, Luca Cervone wrote: > Hi, > I need to log users into existdb using xquery. Of course I can use this code: > > xquery version "3.0"; > declare namespace exist = "http://exist.sourceforge.net/NS/exist"; > declare namespace request="http://exist-db.org/xquery/request"; > declare namespace xmldb="http://exist-db.org/xquery/xmldb"; > declare option exist:serialize "method=json media-type=text/javascript"; > > let $userName := request:get-parameter("userName", ()) > let $hash := request:get-parameter("hash", ()) > let $login := xmldb:authenticate('/db', $userName, $hash) > return > {$login} > {$userName} > > > The problem is that, due to the fact that I receive the password and the username from another service, I receive them in hash form encrypted with md5 (because the can't be passed in clear from a service to another). > But the xmldb:authenticate function needs the password in clear. How can I resolve this? Any idea? Is there a way to login 'manually' in xquery without using the authenticate function? > > > Luca Cervone > Web And XML Solutions Designer > > CIRSFID - University of Bologna, Via Galliera 3, 40122, Bologna (Italy) > Office Phone Number: +39 051 277267 > Home Phone Number: +39 051 19982894 > Mobile Phone: +39 3482627545 > Skype: cervoneluca > Email: cervoneluca at gmail.com, luca.cervone at unibo.it > > > 5x1000 AI GIOVANI RICERCATORI > DELL'UNIVERSIT? DI BOLOGNA > Codice Fiscale: 80007010376 > www.unibo.it/Vademecum5permille > > Questa informativa ? inserita in automatico dal sistema al fine esclusivo della realizzazione dei fini istituzionali dell?ente. > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk -- Adam Retter skype: adam.retter tweet: adamretter http://www.adamretter.org.uk From luca.cervone at unibo.it Thu Jun 20 08:46:36 2013 From: luca.cervone at unibo.it (Luca Cervone) Date: Thu, 20 Jun 2013 15:46:36 +0000 Subject: [xquery-talk] Log users into existdb using md5 password (xquery) In-Reply-To: References: <49EC16A90160C646BCAF14CB911C4B84A82D6216@E10-MBX1-CS.personale.dir.unibo.it> Message-ID: <49EC16A90160C646BCAF14CB911C4B84A82D630E@E10-MBX1-CS.personale.dir.unibo.it> Opps ... Sure, sorry for the mistake. Thanks Luca > Luca, > > As this is a very eXist-db specific question can I ask you to re-post > this on the exist-open mailing list please? Here is not really the > correct forum for eXist specific questions... > > On 20 June 2013 16:17, Luca Cervone wrote: >> Hi, >> I need to log users into existdb using xquery. Of course I can use this code: >> >> xquery version "3.0"; >> declare namespace exist = "http://exist.sourceforge.net/NS/exist"; >> declare namespace request="http://exist-db.org/xquery/request"; >> declare namespace xmldb="http://exist-db.org/xquery/xmldb"; >> declare option exist:serialize "method=json media-type=text/javascript"; >> >> let $userName := request:get-parameter("userName", ()) >> let $hash := request:get-parameter("hash", ()) >> let $login := xmldb:authenticate('/db', $userName, $hash) >> return >> {$login} >> {$userName} >> >> >> The problem is that, due to the fact that I receive the password and the username from another service, I receive them in hash form encrypted with md5 (because the can't be passed in clear from a service to another). >> But the xmldb:authenticate function needs the password in clear. How can I resolve this? Any idea? Is there a way to login 'manually' in xquery without using the authenticate function? >> >> >> Luca Cervone >> Web And XML Solutions Designer >> >> CIRSFID - University of Bologna, Via Galliera 3, 40122, Bologna (Italy) >> Office Phone Number: +39 051 277267 >> Home Phone Number: +39 051 19982894 >> Mobile Phone: +39 3482627545 >> Skype: cervoneluca >> Email: cervoneluca at gmail.com, luca.cervone at unibo.it >> >> >> 5x1000 AI GIOVANI RICERCATORI >> DELL'UNIVERSIT? DI BOLOGNA >> Codice Fiscale: 80007010376 >> www.unibo.it/Vademecum5permille >> >> Questa informativa ? inserita in automatico dal sistema al fine esclusivo della realizzazione dei fini istituzionali dell?ente. >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > > > -- > Adam Retter > > skype: adam.retter > tweet: adamretter > http://www.adamretter.org.uk 5x1000 AI GIOVANI RICERCATORI DELL'UNIVERSIT? DI BOLOGNA Codice Fiscale: 80007010376 www.unibo.it/Vademecum5permille Questa informativa ? inserita in automatico dal sistema al fine esclusivo della realizzazione dei fini istituzionali dell?ente. From dflorescu at mac.com Mon Jun 24 16:10:20 2013 From: dflorescu at mac.com (daniela florescu) Date: Mon, 24 Jun 2013 16:10:20 -0700 Subject: [xquery-talk] ANN Zorba.io 2.9 -- Bringing 'SQL' to NOSQL Message-ID: <7403DB15-1670-42DE-BA19-B2480530D24D@mac.com> Dear semi-structured data fans, we have the pleasure to announce Zorba 2.9 - IO. zorba.io Three main features characterize this new release: 1. A better, simpler, cleaner version of JSONiq, and a better integration with the XML/XQuery counterpart 2. High Order Functions and 3.High level ( 99.1%) Conformance for the W3C XQuery 3.0 Test Suite For more information please check out of the 2.9 blog entry http://www.zorba.io/blog/ For the full change log (that's a long list of functionality, optimizations, and bug fixes) please check https://launchpadlibrarian.net/142881735/ChangeLog Happy coding, and, as usual, feedback is appreciated. Best regards Dana