From adam.retter at googlemail.com Wed Jan 1 07:33:31 2014 From: adam.retter at googlemail.com (Adam Retter) Date: Wed, 1 Jan 2014 15:33:31 +0000 Subject: [xquery-talk] Matrix Multiplication In-Reply-To: References: <52C2E767.5070902@safaribooksonline.com> Message-ID: I seriously suggest that you email the XQuery Working Group with your use case. In particular you should contact Ghislain Fourny and Jonathan Robie, as both have been working on and gathering use cases for arrays in XQuery 3.1. So far efficient matrix operations is not one that I have seen. Cheers Adam. On 31 Dec 2013 17:03, "jean-marc Mercier" wrote: > @David pairs are also basically needed to write a linear algebra modulus, > the topic of this thread. And XQUERY don't provide any efficient pair. You > can't use Marklogic map, or any other vendor map to store vectors for > performance issues (a map is really slow). > > Note that there are a lot of workaround : I am using direct JAVA binding > or C++ binding from XQUERY for linear algebra not to pay a too heavy > tribute to these issue performances. > > The point is simply to notice that XQUERY could be really good to write an > efficient linear algebra modulus. But, due to these performance issues, > nobody can write it. I just hope that the next XQUERY version will give the > necessary container to write it. Meanwhile, nobody can contribute to XQUERY > through external modulus using heavy algorithms, and that's just too bad. > > > > > > > 2013/12/31 David Lee > >> Indeed ... pair( (1,2,3) ) is just a function that returns a function >> as per my example. >> >> But to the point, you can either use vendor extensions (such as >> marklogic's json:array and map:map types) which have good support for >> efficient operations, or look to another language () You may find >> Scala more amenable to this type of programming. >> >> >> >> >> >> >> >> *From:* talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] *On >> Behalf Of *jean-marc Mercier >> *Sent:* Tuesday, December 31, 2013 11:49 AM >> *To:* Michael Sokolov >> *Cc:* xquery-discuss; ihe onwuka; Andrew Welch >> >> *Subject:* Re: [xquery-talk] Matrix Multiplication >> >> >> >> @David, there are tricks to overcome sequence concatenations now. See for >> instance definition of a pair by Leo, John Snelson, or me : you can write >> pair( ( 1 , 2 , 3 ) , (4 5 , 6) ) to avoid sequence concatenation. I ve >> written also constant sized vectors using this trick : for instance >> NUPLE(1,(),,5), withh associated getters. >> >> The bad new is that these operations takes too much time with all the >> interpreters I have tried, and can't be used in heavy algorithms. >> >> >> >> >> >> >> >> >> >> 2013/12/31 jean-marc Mercier >> >> Hi >> >> >> >> @Michael Concerning your remark over the discussions I quoted, maps are >> the basic block for sparse linear algebra. Without performent "maps of >> nodes" (equivalent to std::map in C++) you will not be able to write any >> performant linear algebra modulus for sparse matrix. >> >> >> >> However, before even thinking to sparse matrix, operations on sequences >> as concatenations are the first "show-stop" to write a linear algebra >> modulus, since sequences are vectors. >> >> Another one is the lack of constant sized vectors (needed for basic dense >> matrix operations). >> >> >> >> @Ryan thx for these links, they are very interesting. >> >> >> >> Well, I am going to party ! Have a happy new year ! >> >> >> >> >> >> >> >> >> >> 2013/12/31 Michael Sokolov >> >> I would love to see some tests of pure XQuery implementations of both >> sparse and dense operations. I suspect performance of matrix multiply, >> inversion, etc, will be poorer than in C++ or Java, but I would expect >> performance comparable to Perl or Python (w/o its numpy extension) - just a >> wild guess. I'd also expect it might be easier to get good sparse >> performance. I don't know why, just a hunch. >> >> But the more interesting question for me is whether language changes are >> really needed to support this. I would have thought that proper >> optimization of operations on sequences would be enough? So for example, >> an extension module using sequences as matrix datatypes could possibly >> optimize performance using a lower-level implementation. Does anyone see >> any reason why that wouldn't be possible? >> >> -Mike >> >> PS: >> I reviewed the discussion you referred to, jean-marc, but it seems to >> have more to do with using functions as map keys, and I don't see any >> direct connection to linear algebra? >> >> >> >> On 12/31/2013 9:55 AM, jean-marc Mercier wrote: >> >> It is not due to the spec. It is rather due to the common usage of >> XQUERY, forcing vendor solutions (as BaseX) to focus primarily on XML Data >> Base requests more than algorithmic performances. >> >> >> >> There are actually some threads that are discussing these performance >> issues in the context of maps (maps are for instance used for sparse matrix >> representations) : look for instance to ""map module for XQUERY ?" that I >> initiated or "Higher-order XQuery Modules" by Leo from BaseX, on talk@ >> x-query.com mailing list. >> >> Anyhow, to write a serious linear algebra modulus, the basic need is to >> have a vector containers. Unfortunately, XQUERY does not provide any >> performant vector containers at present time, and it is not possible to >> code them in pure XQUERY : I have tried, and more experienced xquery >> developpers than me have also tried, without success. >> >> >> >> We have to wait for the XQUERY version that will give us these >> containers, a decision to be taken by the W3C. >> >> >> >> >> >> 2013/12/31 Andrew Welch >> >> >> Are you saying the spec as it stands somehow forces all implementations >> to be 1000x slower, or just what you have observed in some particular >> implementation? >> >> On 31 Dec 2013 14:27, "jean-marc Mercier" >> wrote: >> > >> > As far as I understand, you want to write a linear algebra module using >> XQUERY ? >> > If so, I opened a thread some months ago about this idea. My opinion >> today is that this is a false good idea at present time. >> > >> > 1) XQUERY would be really good for writing concise, efficient linear >> algebra modulus. >> > 2) However, I strongly recommend to wait a little bit for starting >> coding : the current version of XQUERY (3.0) suffers from performance >> issues. A linear algebra modulus written in XQUERY is expected to have >> performances performances 1000 X slower than its corresponding C++ or JAVA >> (you can measure it precisely). Any mathematician linear algebra modulus >> would probably trashed your modulus after the first test. >> > >> > Hope this helps >> > >> > >> > >> > 2013/12/31 Ihe Onwuka >> >> >> >> Assuming a sparse representation it is about 4 lines of SQL. This is >> known not least because you can read enough articles and papers that >> discuss it and it optimises well. The obvious google search does not reveal >> any corresponding XQuery discussion, neither does it appear to have >> surfaced on this or the eXist mailing list (allowing for my deficient >> search skills). For something so "trivial" I thought that was rather >> strange. Hence I thought it would be prudent to ask before naively >> embarking on a 600k X 40k matrix multiplication. >> >> >> >> >> >> >> >> On Tue, Dec 31, 2013 at 11:31 AM, Andrew Welch < >> andrew.j.welch at gmail.com> wrote: >> >>> >> >>> >> >>> It should be pretty trivial... >> >>> >> >>> On 31 Dec 2013 11:07, "Ihe Onwuka" wrote: >> >>> > >> >>> > Has anybody tried this in XQuery or if I am so foolish (not yet but >> give me time) would I be the courageous >> http://www.youtube.com/watch?v=ik8JT2S-kBE early >> adopter. >> >>> > >> >>> > >> >>> > _______________________________________________ >> >>> > talk at x-query.com >> >>> > http://x-query.com/mailman/listinfo/talk >> >> >> >> >> >> >> >> _______________________________________________ >> >> talk at x-query.com >> >> http://x-query.com/mailman/listinfo/talk >> > >> > >> >> >> >> >> >> _______________________________________________ >> >> talk at x-query.com >> >> http://x-query.com/mailman/listinfo/talk >> >> >> >> >> >> >> > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlee at calldei.com Wed Jan 1 07:54:42 2014 From: dlee at calldei.com (David Lee) Date: Wed, 1 Jan 2014 15:54:42 +0000 Subject: [xquery-talk] Matrix Multiplication In-Reply-To: References: <52C2E767.5070902@safaribooksonline.com> Message-ID: <80eff8918c3a47c6aaf50797e7f82d4a@BY2PR08MB014.namprd08.prod.outlook.com> On 31 Dec 2013 17:03, "jean-marc Mercier" > wrote: @David pairs are also basically needed to write a linear algebra modulus, the topic of this thread. And XQUERY don't provide any efficient pair. You can't use Marklogic map, or any other vendor map to store vectors for performance issues (a map is really slow). http://x-query.com/mailman/listinfo/talk [DAL:] Just an FYI but MarkLogic also have native arrays (in addition to maps) which are extremely efficient (they are stored internally as C arrays). But if you have to do a lot of iterating through the arrays - even though the accessors are very efficient , the surrounding FLOWR code is still XQuery which slows things down a bit. Maybe or maybe not enough to make them not useful for you. Also the marklogic maps are not the same as XQuery 3 implemented maps, they are a hash map under the hood and typically linear access. But back to your original issue, these are vendor extensions and hence not portable to other implementations (Until XQuery itself standardizes on arrays and maps - then it is likely that vendor extension implementations will be used to expose the standard interface). If what you want is pure XQuery ... it doesnt matter how fast these are if you cant use them because they dont exist in all implementations. -David -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam.retter at googlemail.com Wed Jan 1 10:26:21 2014 From: adam.retter at googlemail.com (Adam Retter) Date: Wed, 1 Jan 2014 18:26:21 +0000 Subject: [xquery-talk] Matrix Multiplication In-Reply-To: <211af0b88e3548559b7210cd568b36b5@BY2PR08MB014.namprd08.prod.outlook.com> References: <52C2E767.5070902@safaribooksonline.com> <80eff8918c3a47c6aaf50797e7f82d4a@BY2PR08MB014.namprd08.prod.outlook.com> <211af0b88e3548559b7210cd568b36b5@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: > > Now java compilers have become so good that they can run at nearly "native" speeds for some things ... > Whilst we are talking about avoiding generalisations. I would point out that the above statement is quite outdated, with modern JVMs and well optimised code, you can often achieve performance that is better than the equivalent C or C++ code. Just do some googling... -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlee at calldei.com Wed Jan 1 10:51:07 2014 From: dlee at calldei.com (David Lee) Date: Wed, 1 Jan 2014 18:51:07 +0000 Subject: [xquery-talk] Matrix Multiplication In-Reply-To: References: <52C2E767.5070902@safaribooksonline.com> <80eff8918c3a47c6aaf50797e7f82d4a@BY2PR08MB014.namprd08.prod.outlook.com> <211af0b88e3548559b7210cd568b36b5@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: Touch?' good call. I was about to mention that java could be faster but hadn't kept up with the facts enough to make a generalized statement :) I just stumbled on this http://dev.saxonica.com/blog/oneil/2013/12/saxonc---saxon-for-the-cc-and-php-platforms.html Which proves Java is 2x faster than the same code in C++ :)(***) And doing XSLT at that ! (***) in case the ":)" is not obvious enough, this proves (or disproves) nothing of the sort ... but it is still a fascinating write-up and definitely in-context with the thread. Good work Saxonica !!!! From: Adam Retter [mailto:adam.retter at googlemail.com] Sent: Wednesday, January 01, 2014 1:26 PM To: David Lee Cc: Andrew Welch; talk at x-query.com; ihe onwuka; jean-marc Mercier; Michael Sokolov Subject: RE: [xquery-talk] Matrix Multiplication > > Now java compilers have become so good that they can run at nearly "native" speeds for some things ... > Whilst we are talking about avoiding generalisations. I would point out that the above statement is quite outdated, with modern JVMs and well optimised code, you can often achieve performance that is better than the equivalent C or C++ code. Just do some googling... -------------- next part -------------- An HTML attachment was scrubbed... URL: From wcandillon at gmail.com Wed Jan 1 10:52:20 2014 From: wcandillon at gmail.com (William Candillon) Date: Wed, 1 Jan 2014 19:52:20 +0100 Subject: [xquery-talk] A flowering map In-Reply-To: References: Message-ID: Hello, I think that you are missing a return clause after the let clause. William On Wed, Jan 1, 2014 at 8:02 AM, Ihe Onwuka wrote: > The code below should (it's been edited) use map to create an element for A > B C D within the parent reviewData. > > The call to local:getReview is expensive though, so to avoid calling it > twice I am returning a sequence as the content of the element constructor. > > xquery version "3.0"; > > declare variable $coll:='/db/apps/spark/'; > > declare function local:getReviews($type as xs:string+) as element(review)* { > $type ! collection($coll || .))/descendant::review > }; > > > {('','A','B','C','D') ! > element {if (.) then . else 'total'} > > {local:getReviews(.)/(count(.),count(distinct-values(thing/@link)))}} > > > What I would like to do is cache the result of calling local:getReviews so > that I am not pushed into returning a sequence just so as to avoid multiple > expensive calls to local:getReviews. > > From my reading of the spec you should be able to have a FLOWR expression > on the right side of the map operator which if I could do it would give me > > {('','A','B','C','D') ! let $reviews:=local:getReviews(.) > element {if (.) then . else 'total'} > > {$reviews/(count(.),count(distinct-values($reviews/thing/@link)))}} > > following which I would dress up the output in the way I want. > > Trying to put the let where I did however gives me > unexpected token: $ (while expecting closing tag for element construct > > hence I am not sure whether my reading of the spec is wrong or whether it's > an implementation issue (this happened on eXist) or a general screw up due > to my rusty XQuery > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From joewiz at gmail.com Thu Jan 2 01:18:12 2014 From: joewiz at gmail.com (Joe Wicentowski) Date: Thu, 2 Jan 2014 03:18:12 -0600 Subject: [xquery-talk] A flowering map In-Reply-To: References: <9daf1d575d7243efb719fac7b2cf9051@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: I think you may have found a bug in eXist-db. Your code can be reduced to the following tests: Works in eXist-db: ('A','B','C','D') ! element {.} {'Z'} Fails with the undefined static context error. ('A','B','C','D') ! (let $x := 1 return element {.} {'Z'}) You may wish to report this on exist-open. Joe From liam at w3.org Thu Jan 2 11:56:44 2014 From: liam at w3.org (Liam R E Quin) Date: Thu, 02 Jan 2014 14:56:44 -0500 Subject: [xquery-talk] A flowering map In-Reply-To: References: <9daf1d575d7243efb719fac7b2cf9051@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <1388692604.1140.105.camel@slave.barefootcomputing.com> On Thu, 2014-01-02 at 03:18 -0600, Joe Wicentowski wrote: > I think you may have found a bug in eXist-db. Your code can be > reduced to the following tests: > > Works in eXist-db: > > ('A','B','C','D') ! element {.} {'Z'} > > Fails with the undefined static context error. > > ('A','B','C','D') ! (let $x := 1 return element {.} {'Z'}) Both these examples work in BaseX for what it's worth (I just tried, at least in "7.7beta"). -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml The barefoot typographer From charles at dyfis.net Thu Jan 2 13:36:38 2014 From: charles at dyfis.net (Charles Duffy) Date: Thu, 2 Jan 2014 15:36:38 -0600 Subject: [xquery-talk] Implementing algorithms involving state across iterations in XQuery Message-ID: Howdy -- I'd like to implement an algorithm akin to that described by the following pseudocode in XQuery 3 (my implementation of choice is BaseX): declare variable $inputs external; declare function local:map-contains-prefix-of($map, $element) { for $map-key in map:keys($map) where fn:string-prefix($map-key, $element/key) return map:get($map, $map-key) } declare function local:result-collection($inputs) { let $already-seen := map:new() (: intended to be "updated" / shadowed later :) for $element in $inputs where not(local:map-contains-prefix-of($already-seen, $element)) let $result := expensive-operation($element) let $already-seen := map:new(($already-seen, map:entry(get-key($element), $result)) return $already-seen } local:result-collections($inputs)[last()] ...to explain in prose: - I have a sequence of inputs, and expect to generate a shorter sequence of outputs. - I have a call, expensive-operation(), which results in (1) the desired return value for a given input, and (2) information necessary and sufficient to identify which other input elements will have the same output relatively cheaply (in this example, done with a string comparison). - I'm trying to determine how to minimize the number of calls to expensive-operation() in an XQuery statement while still generating the desired output. While I know how to do this in a few other functional languages (for instance, in Clojure with its atoms), I'm a bit lost in XQuery. Could I ask for a bit of clue? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From leo at woerteler.de Thu Jan 2 15:25:46 2014 From: leo at woerteler.de (=?UTF-8?B?TGVvbmFyZCBXw7ZydGVsZXI=?=) Date: Fri, 03 Jan 2014 00:25:46 +0100 Subject: [xquery-talk] Implementing algorithms involving state across iterations in XQuery In-Reply-To: References: Message-ID: <52C5F57A.20101@woerteler.de> Charles, Am 02.01.2014 22:36, schrieb Charles Duffy: > While I know how to do this in a few other functional languages (for > instance, in Clojure with its atoms), I'm a bit lost in XQuery. Could I > ask for a bit of clue? I think you are looking for `fn:fold-left(...)` and/or `fn:fold-right(...)` [1]. They can be used to thread some kind of state through while iterating over a sequence. `fn:fold-left($seq, $z, $f)` behaves similar to the following imperative snippet: > $accum <- $z; > foreach($item in $seq) { > $accum <- $f($accum, $item); > } > return $accum; Your algorithm could be written like this (untested): > fn:fold-left( > $inputs, > map:new(), > function($already-seen, $element) { > if(local:map-contains-prefix-of($already-seen, $element)) > then $already-seen > else ( > let $result := expensive-operation($element) > return map:new(( > $already-seen, > map:entry(get-key($element), $result) > )) > ) > } > ) Hope that helps, Leo [1] http://www.w3.org/TR/xpath-functions-30/#func-fold-left From joewiz at gmail.com Sun Jan 5 09:36:36 2014 From: joewiz at gmail.com (Joe Wicentowski) Date: Sun, 5 Jan 2014 11:36:36 -0600 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: Message-ID: Do you mean "sibling" in the sense of the XPath axes preceding-sibling and following-sibling, or in the general sense of documents being "children" of a "parent" collection and thus "siblings"? On Sun, Jan 5, 2014 at 10:50 AM, Ihe Onwuka wrote: > If x is the document element of a document in a collection, is it the > sibling of y that is the document element of another document in the same > collection? > > If not why not? > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From joewiz at gmail.com Sun Jan 5 10:20:38 2014 From: joewiz at gmail.com (Joe Wicentowski) Date: Sun, 5 Jan 2014 12:20:38 -0600 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: Message-ID: XPath axes only operate within the bounds of a single document. On Sun, Jan 5, 2014 at 11:38 AM, Ihe Onwuka wrote: > Certainly in the XPath sense and why not in the general sense (whatever that > means). > > > On Sun, Jan 5, 2014 at 5:36 PM, Joe Wicentowski wrote: >> >> Do you mean "sibling" in the sense of the XPath axes preceding-sibling >> and following-sibling, or in the general sense of documents being >> "children" of a "parent" collection and thus "siblings"? >> >> On Sun, Jan 5, 2014 at 10:50 AM, Ihe Onwuka wrote: >> > If x is the document element of a document in a collection, is it the >> > sibling of y that is the document element of another document in the >> > same >> > collection? >> > >> > If not why not? >> > >> > _______________________________________________ >> > talk at x-query.com >> > http://x-query.com/mailman/listinfo/talk > > From gkholman at CraneSoftwrights.com Sun Jan 5 10:24:31 2014 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Sun, 05 Jan 2014 13:24:31 -0500 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: Message-ID: <7.0.1.0.2.20140105131724.0227f590@wheresmymailserver.com> At 2014-01-05 16:50 +0000, Ihe Onwuka wrote: >If x is the document element of a document in a collection, is it >the sibling of y that is the document element of another document in >the same collection? > >If not why not? It doesn't, because the specification says it doesn't: http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#func-collection "returns a sequence of nodes" A sequence of nodes has no sibling inter-relationships. For my students there is a helpful diagram regarding memory organization on page 223 of my XSLT book that is available for free download on a "try and buy" basis at http://www.CraneSoftwrights.com/training/#ptux ... if you decide not to pay for the book, please delete the copy that you download for free. The memory organization in XQuery is the same, and I use a similar diagram in my XQuery hands-on class that shows the different declaration syntaxes. But the handouts for that class are not available publicly, so I can only share with you the XSLT pages. A tree of nodes is different than a sequence of nodes. In a tree nodes can have a sibling relationship, but in a sequence, there is no connection between the nodes. I hope this helps. . . . . . . . . . Ken -- Public XSLT, XSL-FO, UBL & code list classes: Melbourne, AU May 2014 | 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: http://plus.google.com/+GKenHolman-Crane/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal | From mike at saxonica.com Sun Jan 5 12:54:10 2014 From: mike at saxonica.com (Michael Kay) Date: Sun, 5 Jan 2014 20:54:10 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: Message-ID: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> On 5 Jan 2014, at 16:50, Ihe Onwuka wrote: > If x is the document element of a document in a collection, is it the sibling of y that is the document element of another document in the same collection? No. > > If not why not? "Why" questions are very difficult to answer. Do you want a historically accurate answer (was the question debated at a WG meeting, who argued which position, how did the vote go, and why did individual members vote as they did?) - because it's very rarely possible to give one. Or do you want a post-hoc justification (can you think of a sensible reason that anyone might have designed it this way?) One post-hoc justification is that collections are unordered, whereas axes are always ordered. Another is that documents may belong to more than one collection. Michael Kay Saxonica From dlee at calldei.com Sun Jan 5 12:59:58 2014 From: dlee at calldei.com (David Lee) Date: Sun, 5 Jan 2014 20:59:58 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> Message-ID: <74898a0ec019447e95876510f8137fad@BY2PR08MB014.namprd08.prod.outlook.com> Given those truths ... If you do have a sequence from fn:collection() or another function you *can* find the position of a document in that collection and its 'sibling' Note: this may be a horribly inefficient thing to do so buyer beware .... let $c := fn:collection(), $doc := local:pick-a-random-doc( $c ), $prev := $c[ fn:index-of( $c , $doc ) - 1 ] (: Might be bad to do on the first or only document :) return $c this will answer the question of "what is the previous document in the sequence provided by fn:collection() ... ( you can replace fn:collection() with any function that produces a sequence of documents ) ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Michael Kay Sent: Sunday, January 05, 2014 3:54 PM To: ihe.onwuka at gmail.com Cc: talk at x-query.com Subject: Re: [xquery-talk] Collections - family relationships On 5 Jan 2014, at 16:50, Ihe Onwuka wrote: > If x is the document element of a document in a collection, is it the sibling of y that is the document element of another document in the same collection? No. > > If not why not? "Why" questions are very difficult to answer. Do you want a historically accurate answer (was the question debated at a WG meeting, who argued which position, how did the vote go, and why did individual members vote as they did?) - because it's very rarely possible to give one. Or do you want a post-hoc justification (can you think of a sensible reason that anyone might have designed it this way?) One post-hoc justification is that collections are unordered, whereas axes are always ordered. Another is that documents may belong to more than one collection. Michael Kay Saxonica _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From mike at saxonica.com Sun Jan 5 13:20:46 2014 From: mike at saxonica.com (Michael Kay) Date: Sun, 5 Jan 2014 21:20:46 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <74898a0ec019447e95876510f8137fad@BY2PR08MB014.namprd08.prod.outlook.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <74898a0ec019447e95876510f8137fad@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <14064F52-B57D-4E84-A8FB-A80BE1ACDA41@saxonica.com> On 5 Jan 2014, at 20:59, David Lee wrote: > Given those truths ... > If you do have a sequence from fn:collection() or another function you *can* find the position of a document in that collection and its 'sibling' > > Note: this may be a horribly inefficient thing to do so buyer beware .... > > let $c := fn:collection(), > $doc := local:pick-a-random-doc( $c ), > $prev := $c[ fn:index-of( $c , $doc ) - 1 ] (: Might be bad to do on the first or only document :) > return $c > > This only works if all the documents have distinct string-values. A more efficient and reliable approach would be min(for $c at $i in collection() where $c is $doc return $i) Michael Kay Saxonica From dlee at calldei.com Sun Jan 5 13:24:02 2014 From: dlee at calldei.com (David Lee) Date: Sun, 5 Jan 2014 21:24:02 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <14064F52-B57D-4E84-A8FB-A80BE1ACDA41@saxonica.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <74898a0ec019447e95876510f8137fad@BY2PR08MB014.namprd08.prod.outlook.com> <14064F52-B57D-4E84-A8FB-A80BE1ACDA41@saxonica.com> Message-ID: <78859f73e395400aab2089153c156353@BY2PR08MB014.namprd08.prod.outlook.com> Arg ... so your saying index-of causes a string atomization ? Ug. I know it wants item* and uses "eq" as the comparison but didn't realize that would stringify documents ... Do you know of a sequence function that uses document or node ID's ? ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: Michael Kay [mailto:mike at saxonica.com] Sent: Sunday, January 05, 2014 4:21 PM To: David Lee Cc: ihe.onwuka at gmail.com; talk at x-query.com Subject: Re: [xquery-talk] Collections - family relationships On 5 Jan 2014, at 20:59, David Lee wrote: > Given those truths ... > If you do have a sequence from fn:collection() or another function you *can* find the position of a document in that collection and its 'sibling' > > Note: this may be a horribly inefficient thing to do so buyer beware .... > > let $c := fn:collection(), > $doc := local:pick-a-random-doc( $c ), > $prev := $c[ fn:index-of( $c , $doc ) - 1 ] (: Might be bad to do on the first or only document :) > return $c > > This only works if all the documents have distinct string-values. A more efficient and reliable approach would be min(for $c at $i in collection() where $c is $doc return $i) Michael Kay Saxonica From mike at saxonica.com Sun Jan 5 13:48:27 2014 From: mike at saxonica.com (Michael Kay) Date: Sun, 5 Jan 2014 21:48:27 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <78859f73e395400aab2089153c156353@BY2PR08MB014.namprd08.prod.outlook.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <74898a0ec019447e95876510f8137fad@BY2PR08MB014.namprd08.prod.outlook.com> <14064F52-B57D-4E84-A8FB-A80BE1ACDA41@saxonica.com> <78859f73e395400aab2089153c156353@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <9B03FE5F-7FDD-434E-849C-68E46CAB48F5@saxonica.com> On 5 Jan 2014, at 21:24, David Lee wrote: > Arg ... so your saying index-of causes a string atomization ? > Ug. I know it wants item* and uses "eq" as the comparison but didn't realize that would stringify documents ... Actually the function signature for index-of expects xs:anyAtomicType, which means that if you supply a node it is atomized during the function call. > > > Do you know of a sequence function that uses document or node ID's ? > union, intersect, difference.... The function index-of-node() is given as an example of a function you can write yourself: http://www.w3.org/TR/xpath-functions-30/#index-of-node Generally the functions in this appendix were considered for inclusion in the spec, and rejected because they can easily be implemented as user-defined functions. Michael Kay Saxonica From andrew.j.welch at gmail.com Sun Jan 5 14:09:13 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Sun, 5 Jan 2014 22:09:13 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <14064F52-B57D-4E84-A8FB-A80BE1ACDA41@saxonica.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <74898a0ec019447e95876510f8137fad@BY2PR08MB014.namprd08.prod.outlook.com> <14064F52-B57D-4E84-A8FB-A80BE1ACDA41@saxonica.com> Message-ID: On 5 January 2014 21:20, Michael Kay wrote: > > On 5 Jan 2014, at 20:59, David Lee wrote: > >> Given those truths ... >> If you do have a sequence from fn:collection() or another function you *can* find the position of a document in that collection and its 'sibling' >> >> Note: this may be a horribly inefficient thing to do so buyer beware .... >> >> let $c := fn:collection(), >> $doc := local:pick-a-random-doc( $c ), >> $prev := $c[ fn:index-of( $c , $doc ) - 1 ] (: Might be bad to do on the first or only document :) >> return $c >> >> > > This only works if all the documents have distinct string-values. > > A more efficient and reliable approach would be > > min(for $c at $i in collection() where $c is $doc return $i) Couldn't you use uri-collection() to give you an order, rather than the collection() directly? -- Andrew Welch http://andrewjwelch.com From dlee at calldei.com Sun Jan 5 14:17:26 2014 From: dlee at calldei.com (David Lee) Date: Sun, 5 Jan 2014 22:17:26 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <9B03FE5F-7FDD-434E-849C-68E46CAB48F5@saxonica.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <74898a0ec019447e95876510f8137fad@BY2PR08MB014.namprd08.prod.outlook.com> <14064F52-B57D-4E84-A8FB-A80BE1ACDA41@saxonica.com> <78859f73e395400aab2089153c156353@BY2PR08MB014.namprd08.prod.outlook.com> <9B03FE5F-7FDD-434E-849C-68E46CAB48F5@saxonica.com> Message-ID: Thanks. Not even knowing of the existence of fn:filter or fn:for-each-pair I wrote just now my version in old-fashioned-xquery declare function common:node-index-of( $nodes as node()* , $node as node() ) as xs:integer ? { for $n at $pos in $nodes return if( $n is $node ) then $pos else () }; Signature may have to change if the same node exists > 1 time in a sequence fn:for-each-pair looks like a really useful function ! I am often brain-stumped trying to skip over every other node in a sequence having to write div 2 and ($i div2) + 1 etc ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: Michael Kay [mailto:mike at saxonica.com] Sent: Sunday, January 05, 2014 4:48 PM To: David Lee Cc: ihe.onwuka at gmail.com; talk at x-query.com Subject: Re: [xquery-talk] Collections - family relationships On 5 Jan 2014, at 21:24, David Lee wrote: > Arg ... so your saying index-of causes a string atomization ? > Ug. I know it wants item* and uses "eq" as the comparison but didn't realize that would stringify documents ... Actually the function signature for index-of expects xs:anyAtomicType, which means that if you supply a node it is atomized during the function call. > > > Do you know of a sequence function that uses document or node ID's ? > union, intersect, difference.... The function index-of-node() is given as an example of a function you can write yourself: http://www.w3.org/TR/xpath-functions-30/#index-of-node Generally the functions in this appendix were considered for inclusion in the spec, and rejected because they can easily be implemented as user-defined functions. Michael Kay Saxonica From dlee at calldei.com Sun Jan 5 14:23:05 2014 From: dlee at calldei.com (David Lee) Date: Sun, 5 Jan 2014 22:23:05 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <74898a0ec019447e95876510f8137fad@BY2PR08MB014.namprd08.prod.outlook.com> <14064F52-B57D-4E84-A8FB-A80BE1ACDA41@saxonica.com> Message-ID: <7d42b77f527e4ae48013fcfd98e0b28f@BY2PR08MB014.namprd08.prod.outlook.com> Re: fn:uri-collection() !! Another new function for me ... looks useful If/and/only/if it correlates to what you want ... Seems there is no guarantee that uri-collection()!doc(.) produces the same results as collection() this is a broad field, that incidentally I think is underappreciated. Hans-Juergen brought up similar ideas at recent Balisage conferences about the "space" beyond XQuery ... That area where documents exist but standards fear to tread .... This "Info Space" as he calls it (I think it's a great word ...) could really use some serious brain-power to dig into and standardize. XQuery itself leaves it mostly in the realm where dragons life - for good reasons ... but as XML matures And we evolve into XML Databases and the web of all things, pushing the envelope of defining where documents come from, And what rules and API's we want to standardize on them could be really useful. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: Andrew Welch [mailto:andrew.j.welch at gmail.com] Sent: Sunday, January 05, 2014 5:09 PM To: Michael Kay Cc: David Lee; talk at x-query.com; ihe.onwuka at gmail.com Subject: Re: [xquery-talk] Collections - family relationships On 5 January 2014 21:20, Michael Kay wrote: > > On 5 Jan 2014, at 20:59, David Lee wrote: > >> Given those truths ... >> If you do have a sequence from fn:collection() or another function you *can* find the position of a document in that collection and its 'sibling' >> >> Note: this may be a horribly inefficient thing to do so buyer beware .... >> >> let $c := fn:collection(), >> $doc := local:pick-a-random-doc( $c ), >> $prev := $c[ fn:index-of( $c , $doc ) - 1 ] (: Might be bad to do on the first or only document :) >> return $c >> >> > > This only works if all the documents have distinct string-values. > > A more efficient and reliable approach would be > > min(for $c at $i in collection() where $c is $doc return $i) Couldn't you use uri-collection() to give you an order, rather than the collection() directly? -- Andrew Welch http://andrewjwelch.com From liam at w3.org Sun Jan 5 18:16:10 2014 From: liam at w3.org (Liam R E Quin) Date: Sun, 05 Jan 2014 21:16:10 -0500 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <7d42b77f527e4ae48013fcfd98e0b28f@BY2PR08MB014.namprd08.prod.outlook.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <74898a0ec019447e95876510f8137fad@BY2PR08MB014.namprd08.prod.outlook.com> <14064F52-B57D-4E84-A8FB-A80BE1ACDA41@saxonica.com> <7d42b77f527e4ae48013fcfd98e0b28f@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <1388974570.1140.298.camel@slave.barefootcomputing.com> On Sun, 2014-01-05 at 22:23 +0000, David Lee wrote: > Seems there is no guarantee that > uri-collection()!doc(.) produces the same results as collection() Right - collection() really marks the border of what we (W3C) could standardize at the time, when many implementations of XQuery do not (for example) use a database at all, or store a representation of parsed and data-typed XML in ISAM or in a single relational field accessible from SQL... Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml From dlee at calldei.com Sun Jan 5 18:28:42 2014 From: dlee at calldei.com (David Lee) Date: Mon, 6 Jan 2014 02:28:42 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <1388974570.1140.298.camel@slave.barefootcomputing.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <74898a0ec019447e95876510f8137fad@BY2PR08MB014.namprd08.prod.outlook.com> <14064F52-B57D-4E84-A8FB-A80BE1ACDA41@saxonica.com> <7d42b77f527e4ae48013fcfd98e0b28f@BY2PR08MB014.namprd08.prod.outlook.com>, <1388974570.1140.298.camel@slave.barefootcomputing.com> Message-ID: Docs don't even need uri's. ... That's where the fun really starts in info space Sent from my iPad (excuse the terseness) David A Lee dlee at calldei.com > On Jan 5, 2014, at 9:16 PM, "Liam R E Quin" wrote: > >> On Sun, 2014-01-05 at 22:23 +0000, David Lee wrote: >> Seems there is no guarantee that >> uri-collection()!doc(.) produces the same results as collection() > > Right - collection() really marks the border of what we (W3C) could > standardize at the time, when many implementations of XQuery do not (for > example) use a database at all, or store a representation of parsed and > data-typed XML in ISAM or in a single relational field accessible from > SQL... > > Liam > > -- > Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ > Pictures from old books: http://fromoldbooks.org/ > Ankh: irc.sorcery.net irc.gnome.org freenode/#xml > From andrew.j.welch at gmail.com Mon Jan 6 03:39:48 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Mon, 6 Jan 2014 11:39:48 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> Message-ID: > collection($sp:reviewsColl)/descendant::reviews[not(review[2])] > > but reviews has a @person attribute and that person may have 1 or more > reviews in another collection - so that doesn't work. In your collection of collections, group on @person then count the size of the group. -- Andrew Welch http://andrewjwelch.com From andrew.j.welch at gmail.com Mon Jan 6 04:21:18 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Mon, 6 Jan 2014 12:21:18 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> Message-ID: On 6 January 2014 12:07, Ihe Onwuka wrote: > Thank you. I'm not wishing to sound uncharitable or rude, but I deliberately > didn't ask for a solution because I wanted to focus on the original > question. The non-specific general approach to this problem is grouping... > Consider the use case in the context of someone who did not have access to > XQuery 3.0. You will have the fun of XQuery 1.0 grouping then : ) or of course vendor extensions, which from my XQuery days were 90% of the code written. From mike at saxonica.com Mon Jan 6 04:31:20 2014 From: mike at saxonica.com (Michael Kay) Date: Mon, 6 Jan 2014 12:31:20 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> Message-ID: <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> On 6 Jan 2014, at 12:07, Ihe Onwuka wrote: > Thank you. I'm not wishing to sound uncharitable or rude, but I deliberately didn't ask for a solution because I wanted to focus on the original question. > > Consider the use case in the context of someone who did not have access to XQuery 3.0. > Then you solve the problem using the clumsy grouping facilities of XQuery 1.0, i.e. use distinct-values() to find the distinct persons, then select the reviews for each of those distinct persons. Michael Kay Saxonica From msokolov at safaribooksonline.com Mon Jan 6 04:43:06 2014 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Mon, 06 Jan 2014 07:43:06 -0500 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> Message-ID: <52CAA4DA.9080003@safaribooksonline.com> On 1/6/2014 7:21 AM, Andrew Welch wrote: > On 6 January 2014 12:07, Ihe Onwuka wrote: >> Thank you. I'm not wishing to sound uncharitable or rude, but I deliberately >> didn't ask for a solution because I wanted to focus on the original >> question. > The non-specific general approach to this problem is grouping... > >> Consider the use case in the context of someone who did not have access to >> XQuery 3.0. > You will have the fun of XQuery 1.0 grouping then : ) or of course > vendor extensions, which from my XQuery days were 90% of the code > written. > Just because they are vendor extensions doesn't mean they aren't the "right" solution. Any database-oriented system should offer you a mechanism for indexing on a value such as "the author of the document" and then an efficient means to return the keys of your index, either in sorted order, or ordered by number of occurrences of (documents having) the key. This is a specific kind of grouping, sometimes called faceting. Once you have the values that occur once, the index should be able to return the matching documents quickly, too. Maybe with XQuery 3 the grouping operator will give you access to these mechanisms in a more idiomatic (vendor-neutral) way, but it is definitely worth verifying that your optimizer is able to do that if you are dealing with more than a handful of documents. -Mike From msokolov at safaribooksonline.com Mon Jan 6 05:11:49 2014 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Mon, 06 Jan 2014 08:11:49 -0500 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> Message-ID: <52CAAB95.10201@safaribooksonline.com> On 1/6/2014 7:50 AM, Ihe Onwuka wrote: > > The price the specification as is makes you pay for using the > collection arrangement is to lose the semantic relationship. Should > it? Thats the real question that motivated my posing the use case. It seems useful to me to have one set of relationships that work within-document and another (unspecified, as yet) that work among documents. Without this, what is the purpose of having data apportioned into documents at all? -Mike From mike at saxonica.com Mon Jan 6 05:28:22 2014 From: mike at saxonica.com (Michael Kay) Date: Mon, 6 Jan 2014 13:28:22 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <52CAAB95.10201@safaribooksonline.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> Message-ID: On 6 Jan 2014, at 13:11, Michael Sokolov wrote: > On 1/6/2014 7:50 AM, Ihe Onwuka wrote: >> >> The price the specification as is makes you pay for using the collection arrangement is to lose the semantic relationship. Should it? Thats the real question that motivated my posing the use case. > It seems useful to me to have one set of relationships that work within-document and another (unspecified, as yet) that work among documents. Without this, what is the purpose of having data apportioned into documents at all? > > -Mike I would say it is actually a rather unfortunate feature of the XML model that the partitioning of data into documents (and collections) is quite so visible at the query level, since this partitioning is often a "physical design" choice rather than something that flows naturally from the conceptual data model. It would be nice to have a model that hid this distinction, e.g. by making the entire database (or the entire web) appear to the query as a single document. But that's not the way life is. Michael Kay Saxonica From dlee at calldei.com Mon Jan 6 06:28:26 2014 From: dlee at calldei.com (David Lee) Date: Mon, 6 Jan 2014 14:28:26 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> Message-ID: <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> >> Michael Kay I would say it is actually a rather unfortunate feature of the XML model that the partitioning of data into documents (and collections) is quite so visible at the query level, since this partitioning is often a "physical design" choice rather than something that flows naturally from the conceptual data model. It would be nice to have a model that hid this distinction, e.g. by making the entire database (or the entire web) appear to the query as a single document. But that's not the way life is. ---------- [DAL:] I would like to add, not only total refreshing agreement to this sentiment but take it one step sideways. This isn't a new thought but its one us compute people often forget. Folders and Files. The whole concept of "The Filesystem" ... having to put things into Files, and Folders of Files and Volumes etc. is archaic ... I believe historically it was done both to try to model "the real world" of "The Office" into terms people could understand (literally files of paper bound in little file jackets put into folders, put into filing cabinets). AND as convenience to early disk based computing ... a simple way to organize data. This metaphor Documents and Collections (or Directories or Cabinets) has persevered for decades and now is so ingrained its the only way most people think data *must* be represented or stored or packaged. Onceaponatime we thought computers would free us from the Paper World ... but it has not - why ? because we used them to model paper !!! That and paper is a particularly nice way to view text ... -David From andrew.j.welch at gmail.com Mon Jan 6 06:30:20 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Mon, 6 Jan 2014 14:30:20 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> Message-ID: This post: > I want to find all reviews written by people that only wrote 1 review. I > wrote > > collection($sp:reviewsColl)/descendant::reviews[not(review[2])] > > but reviews has a @person attribute and that person may have 1 or more > reviews in another collection - so that doesn't work. > > The thing that seemed most natural to fix this was to supplement the > predicate to say there should be no sibling review by the same > reviews/@person. ...followed by this: > Note I did not post asking for code ...is puzzling. If you post code, don't be surprised if people post code back. Even if you don't want it, someone in the archives might. -- Andrew Welch http://andrewjwelch.com From joewiz at gmail.com Mon Jan 6 07:09:58 2014 From: joewiz at gmail.com (Joe Wicentowski) Date: Mon, 6 Jan 2014 10:09:58 -0500 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> Message-ID: Hi Ihe, > Still puzzled What are you still puzzled about? I thought your questions were all answered, no? Joe From john.snelson at marklogic.com Tue Jan 7 04:45:50 2014 From: john.snelson at marklogic.com (John Snelson) Date: Tue, 07 Jan 2014 12:45:50 +0000 Subject: [xquery-talk] XQuery 3.0 Grouping - Sufficiently baffled by ordering In-Reply-To: <4173A0AE-3791-4D64-B978-5D6BCB0697CE@saxonica.com> References: <6C78333F-1791-423D-B59D-6A69D2911F29@saxonica.com> <4173A0AE-3791-4D64-B978-5D6BCB0697CE@saxonica.com> Message-ID: <52CBF6FE.2060404@marklogic.com> On 07/01/14 12:39, Michael Kay wrote: > Yes, I was surprised to see that a "let" clause isn't allowed after an > order-by or group-by. I don't remember the reasons for that. A let clause _can_ be used after an order by or group by clause in XQuery 3.0: http://www.w3.org/TR/xquery-30/#prod-xquery30-FLWORExpr I suspect this is just unimplemented in eXist. John -- John Snelson, Lead Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com From mike at saxonica.com Wed Jan 8 01:14:42 2014 From: mike at saxonica.com (Michael Kay) Date: Wed, 8 Jan 2014 09:14:42 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: Message-ID: Could you explain where you think these two definitions differ? As far as I can tell, your confusion is about whether atomization is invoked in a particular context, not about what atomization actually does. In particular, atomization is NOT invoked in XQuery when you use a construct of the form: > > ($thing/@name) This is a very common source of confusion and programming mistakes. However, in terms of the specifications you cite: (a) The XQuery specification (correctly) does not include embedded expressions in its list of contexts where atomization takes place (b) This construct is specific to XQuery, and therefore outside the scope of my XSLT/XPath book. Michael Kay Saxonica From davidc at nag.co.uk Wed Jan 8 03:03:38 2014 From: davidc at nag.co.uk (David Carlisle) Date: Wed, 08 Jan 2014 11:03:38 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: Message-ID: <52CD308A.70003@nag.co.uk> On 08/01/2014 09:35, Ihe Onwuka wrote: > > > > {$thing/@name} > > I can't begin to fathom the rationale for the exception or the value of > such an exception over the simple rule of atomizing sequences if they > appear in contexts where a value is expected. why do you think an atomised value is expected here? would you expect element nodes {$thing/name} to be atomised as well? (They aren't: this would add a sequence of children to ) > It seems to me that it is > just demanding the explicit call of the data function (which is exactly > what I put in) for something it could just have easily handled implicitly. > But this construct is designed to add attribute nodes, so implicit atomization would be undesirable. > (b) This construct is specific to XQuery, and therefore outside the > scope of my XSLT/XPath book. > > > My paradigm is the possibly incorrect formula that XQuery 1.0 is a > superset of XPath 2.0 that I have seen bandied about. > XQuery has syntax changes but this is the same as XSLT/XPath 1 which would add attribute nodes to the person element. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From davidc at nag.co.uk Wed Jan 8 03:20:52 2014 From: davidc at nag.co.uk (David Carlisle) Date: Wed, 08 Jan 2014 11:20:52 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD308A.70003@nag.co.uk> Message-ID: <52CD3494.3010700@nag.co.uk> On 08/01/2014 11:11, Ihe Onwuka wrote: > > > > On Wed, Jan 8, 2014 at 11:03 AM, David Carlisle > wrote: > > On 08/01/2014 09:35, Ihe Onwuka wrote: > > > > > {$thing/@name} > > > I can't begin to fathom the rationale for the exception or the > value of > such an exception over the simple rule of atomizing sequences if > they > appear in contexts where a value is expected. > > > why do you think an atomised value is expected here? > > > because the value you put in an attribute must be atomic....... If you add such a sequence in an attribute constructor then it is atomized, but here you are copying a sequence of nodes into an element constructor. In particular you are adding attribute nodes. > > would you expect element nodes > > > {$thing/name} > > to be atomised as well? (They aren't: this would add a sequence of > children to ) > > > ......and the value of an element doesn't have to be. You are copying a sequence of nodes so that becodes their parent, attribute and element nodes are treated similarly. > > > > > It seems to me that it is > > just demanding the explicit call of the data function (which is > exactly > what I put in) for something it could just have easily handled > implicitly. > > > But this construct is designed to add attribute nodes, so implicit > atomization would be undesirable. > > > Why? It cannot be a placeholder for anything but an atomic value. No, as shown here it is copying attribute nodes. If $thing is then {$thing/@name} is but {$thing/@name/string()} is me You are (I think) saying that atomization should be automatic and you should get the second result, but then you would not be able to copy attribute (or element) nodes. David > > > > ________________________________________________________________________ > This e-mail has been scanned for all viruses by Star. > ________________________________________________________________________ -- google plus: https:/profiles.google.com/d.p.carlisle ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From davidc at nag.co.uk Wed Jan 8 03:44:43 2014 From: davidc at nag.co.uk (David Carlisle) Date: Wed, 08 Jan 2014 11:44:43 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD308A.70003@nag.co.uk> <52CD3494.3010700@nag.co.uk> Message-ID: <52CD3A2B.9030104@nag.co.uk> On 08/01/2014 11:36, Ihe Onwuka wrote: > No. I am saying that if the expression is an attrtibute constructor then > atomization should be atomic. OK so I'm completely lost as I don't understand what you expect. {$thing/@name} simply copies an attribute node from wherever it is to the newly constructed element. Atomization is just not relevant, the node is already an attribute node (with a value that is atomic) the node is just copied to the tree being generated. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From mike at saxonica.com Wed Jan 8 03:58:50 2014 From: mike at saxonica.com (Michael Kay) Date: Wed, 8 Jan 2014 11:58:50 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD308A.70003@nag.co.uk> <52CD3494.3010700@nag.co.uk> Message-ID: > I expect it to be atomized for the previously given reasons. It's a common expectation, but it's wrong. There is nothing in the spec that encourages you to have such an expectation; you're just saying that if you had designed the language, you would have done it differently. When the spec talks about an atomic value being expected, it's talking about expectations that are informed by reading the spec, not expectations based on how you would have liked the language to behave. Michael Kay Saxonica From davidc at nag.co.uk Wed Jan 8 04:07:44 2014 From: davidc at nag.co.uk (David Carlisle) Date: Wed, 08 Jan 2014 12:07:44 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD308A.70003@nag.co.uk> <52CD3494.3010700@nag.co.uk> <52CD3A2B.9030104@nag.co.uk> Message-ID: <52CD3F90.6080902@nag.co.uk> On 08/01/2014 11:55, Ihe Onwuka wrote: > > for $t in things/thing group by $sex:=$t/@sex return > {$t/@sex} > > the effect of the group by turns {$t/@sex} into a sequence of > attribute nodes and the processor (at least eXist) will barf about > duplicate attributes instead of atomizing them. Why barf - duplicate > atttributes are not allowed and demand an explicit atomization? because atomising would just be weird. If $t/sex is a single sex="M" attribute node then it is not atomized it is simply copied to producing If (as in your example) it is a sequence of two attribute nodes sex="M" sex="M" then as you can not have two attributes on the element it is an XQuery error. (XSLT takes a different route and just uses the last) If the sequence were atomised then you would get MM as for {$t/string(@sex)} which would be pretty strange to happen by default. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From davidc at nag.co.uk Wed Jan 8 04:26:08 2014 From: davidc at nag.co.uk (David Carlisle) Date: Wed, 08 Jan 2014 12:26:08 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD308A.70003@nag.co.uk> <52CD3494.3010700@nag.co.uk> <52CD3A2B.9030104@nag.co.uk> <52CD3F90.6080902@nag.co.uk> Message-ID: <52CD43E0.3020903@nag.co.uk> On 08/01/2014 12:17, Ihe Onwuka wrote: list of them, it is not weird at all. > > Furthermore atomizing it makes explicitly clear to the programmer whats > gone on whereas barfing about duplicate attribute nodes when what you > have coded > > {$t/@sex} > > has no explicit duplicate node in sight is bloody confusing until you > figure out that the duplicates have mysteriously morphed from the group > by clause. Note this can happen even if your are grouping on something > other than @sex. > > you seem to be saying you want if there is one attribute in the list but to atomise if there are two and produce MM I don't think that would be helpful but as Michael commented it's irrelevant what either of us think as that's not how it's defined (and basically it has been defined this way since Xpath 1, 15 years ago) If you want a single attribute you want {$t[1]/@sex} If you want the concatenation of the atomisation of all the attributes as a text node child, you want {$t/string(@sex)} MM If you want the atomisation of a single attribute as a text node child you want {$t[1]/@sex} M I can't imagine a case where you want to decide between those depending on whether there is a duplicate or not. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From davidc at nag.co.uk Wed Jan 8 05:04:32 2014 From: davidc at nag.co.uk (David Carlisle) Date: Wed, 08 Jan 2014 13:04:32 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD308A.70003@nag.co.uk> <52CD3494.3010700@nag.co.uk> <52CD3A2B.9030104@nag.co.uk> <52CD3F90.6080902@nag.co.uk> <52CD43E0.3020903@nag.co.uk> Message-ID: <52CD4CE0.2040804@nag.co.uk> On 08/01/2014 12:55, Ihe Onwuka wrote: > Now thats me done. If it sounds weird to you , well the client doesn't > think so. The client requirements are reasonable, but the code did not match that requirement. The product attribute in your desired result is not a copy of any attribute in the source so you need to use an attribute constructor. _would_ be atomised exactly as you wish as, the content of an attribute constructor is implicitly atomized. You were copying into the content of an element constructor, and the contents of element constructors are not atomized by default. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From andrew.j.welch at gmail.com Wed Jan 8 05:59:14 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Wed, 8 Jan 2014 13:59:14 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD308A.70003@nag.co.uk> <52CD3494.3010700@nag.co.uk> <52CD3A2B.9030104@nag.co.uk> <52CD3F90.6080902@nag.co.uk> <52CD43E0.3020903@nag.co.uk> <52CD4CE0.2040804@nag.co.uk> Message-ID: > I don't care David, because you miss the whole point. Has DC misunderstood something? If so we should print and frame this thread for posterity. From geert.josten at dayon.nl Wed Jan 8 07:31:02 2014 From: geert.josten at dayon.nl (Geert Josten) Date: Wed, 8 Jan 2014 16:31:02 +0100 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD308A.70003@nag.co.uk> <52CD3494.3010700@nag.co.uk> <52CD3A2B.9030104@nag.co.uk> <52CD3F90.6080902@nag.co.uk> <52CD43E0.3020903@nag.co.uk> <52CD4CE0.2040804@nag.co.uk> Message-ID: > Has DC misunderstood something? If so we should print and frame this > thread for posterity. :-) From davidc at nag.co.uk Wed Jan 8 08:22:43 2014 From: davidc at nag.co.uk (David Carlisle) Date: Wed, 08 Jan 2014 16:22:43 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD308A.70003@nag.co.uk> <52CD3494.3010700@nag.co.uk> <52CD3A2B.9030104@nag.co.uk> <52CD3F90.6080902@nag.co.uk> <52CD43E0.3020903@nag.co.uk> <52CD4CE0.2040804@nag.co.uk> Message-ID: <52CD7B53.3010108@nag.co.uk> On 08/01/2014 15:38, Ihe Onwuka wrote: > because it is going to end up (by whatever process) as an attribute > node. That seems to be the cause of your confusion (and your misreading of the spec and Mike Kay's book) If you go {$d/@*} You are _not_ copying nodes to a context where atomic values are expected, you are copying them to an element node constructor, which is expecting nodes. If the sequence were atomized (implicitly or by explicit use of data() or string() then it would not "end up by any process as an attribute node", it would make text node child of the element (which is why I assumed originally that was what you intended to generate). Implicit atomization would do the same as {$d/@*/data()} and the odd thing is you have said repeatedly that data() solved your problem, but that will not generate any attribute nodes, the values of the attributes will be concatenated as text node child of . Had you gone then you are copying to such a context, and atomization would be automatic and you would get the result you want. The FLWOR expression and group by clause are not really relevant to the issue, you get the same behaviour (and same error messages) without any grouping. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From john.snelson at marklogic.com Wed Jan 8 08:29:37 2014 From: john.snelson at marklogic.com (John Snelson) Date: Wed, 08 Jan 2014 16:29:37 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD3494.3010700@nag.co.uk> <52CD3A2B.9030104@nag.co.uk> <52CD3F90.6080902@nag.co.uk> <52CD43E0.3020903@nag.co.uk> <52CD4CE0.2040804@nag.co.uk> <52CD7B53.3010108@nag.co.uk> Message-ID: <52CD7CF1.4060004@marklogic.com> On 08/01/14 16:25, Ihe Onwuka wrote: > > On Wed, Jan 8, 2014 at 4:22 PM, David Carlisle > wrote: > > On 08/01/2014 15:38, Ihe Onwuka wrote: > > because it is going to end up (by whatever process) as an attribute > node. > > > > That seems to be the cause of your confusion (and your misreading of the > spec and Mike Kay's book) > > > Ok. What sections of Mike Kay's book Mike Kay's book doesn't cover XQuery. > and the spec didn't I read that conveyed the information you just gave and what references to them did I > miss. http://www.w3.org/TR/xquery-30/#id-content John -- John Snelson, Lead Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com From davidc at nag.co.uk Wed Jan 8 08:34:56 2014 From: davidc at nag.co.uk (David Carlisle) Date: Wed, 08 Jan 2014 16:34:56 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD3494.3010700@nag.co.uk> <52CD3A2B.9030104@nag.co.uk> <52CD3F90.6080902@nag.co.uk> <52CD43E0.3020903@nag.co.uk> <52CD4CE0.2040804@nag.co.uk> <52CD7B53.3010108@nag.co.uk> Message-ID: <52CD7E30.5060704@nag.co.uk> On 08/01/2014 16:25, Ihe Onwuka wrote: > Ok. What sections of Mike Kay's book and the spec didn't I read that > conveyed the information you just gave and what references to them > did I miss. That's really the only reason I carried on with the thread. To see if there are any parts of the spec that can be clarified. (Not that I have any input to that, other than bug reports). It is hard to see how (from either source) you came to the conclusion that atomization would happen here so I can't really guess which parts of either text could be clarified. Also since you haven't shown how you used data() in any way that works (and I can't think of one) I can't suggest what part of the text would tell you to use data in the way that you say works. The issue is that you want to generate an attribute, so you should use an attribute constructor. If you do that then any data you supply to the constructor is implicitly atomized and the resulting space separated sequence used as the attribute value. You didn't use an attribute constructor and so didn't get the result you expected, but I am not sure what you expect the spec to say. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From john.snelson at marklogic.com Wed Jan 8 08:40:54 2014 From: john.snelson at marklogic.com (John Snelson) Date: Wed, 08 Jan 2014 16:40:54 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD3A2B.9030104@nag.co.uk> <52CD3F90.6080902@nag.co.uk> <52CD43E0.3020903@nag.co.uk> <52CD4CE0.2040804@nag.co.uk> <52CD7B53.3010108@nag.co.uk> <52CD7CF1.4060004@marklogic.com> Message-ID: <52CD7F96.9010007@marklogic.com> In the XQuery 3.0 specification, section 3.9.1 describes direct element constructors. A sub-section inside that (3.9.1.3 Content) describes how to process the content of direct element constructors. This section is also linked from "3.9.3.1 Computed Element Constructors". http://www.w3.org/TR/xquery-30/#id-content The XQuery spec is not always straight forward to read, but I think it's clear in this case. However the XQuery spec is not meant to be a tutorial in XQuery - there are better places to learn XQuery. John On 08/01/14 16:39, Ihe Onwuka wrote: > and that referenced from section 2.4.2 where? > > or was I supposed to have sussed that from seeing > > * > > Constructor expressions for various kinds of nodes > > if I was....I guess it's my bad. > > > On Wed, Jan 8, 2014 at 4:29 PM, John Snelson > wrote: > > On 08/01/14 16:25, Ihe Onwuka wrote: > > > On Wed, Jan 8, 2014 at 4:22 PM, David Carlisle > >> wrote: > > On 08/01/2014 15:38, Ihe Onwuka wrote: > > because it is going to end up (by whatever process) as > an attribute > node. > > > > That seems to be the cause of your confusion (and your > misreading of the > spec and Mike Kay's book) > > > Ok. What sections of Mike Kay's book > > > Mike Kay's book doesn't cover XQuery. > > > and the spec didn't I read that conveyed the information you > just gave and what references to them did I > miss. > > > http://www.w3.org/TR/xquery-__30/#id-content > > > > John > > -- > John Snelson, Lead Engineer http://twitter.com/jpcs > MarkLogic Corporation http://www.marklogic.com > _________________________________________________ > 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 davidc at nag.co.uk Wed Jan 8 08:47:56 2014 From: davidc at nag.co.uk (David Carlisle) Date: Wed, 08 Jan 2014 16:47:56 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD3A2B.9030104@nag.co.uk> <52CD3F90.6080902@nag.co.uk> <52CD43E0.3020903@nag.co.uk> <52CD4CE0.2040804@nag.co.uk> <52CD7B53.3010108@nag.co.uk> <52CD7CF1.4060004@marklogic.com> Message-ID: <52CD813C.4060108@nag.co.uk> On 08/01/2014 16:39, Ihe Onwuka wrote: > and that referenced from section 2.4.2 where? > > or was I supposed to have sussed that from seeing > > * > > Constructor expressions for various kinds of nodes > > if I was....I guess it's my bad. > That perhaps but more to the point it says in the first line > Atomization is applied to a value when the value is used in a context > in which a sequence of atomic values is required. and the content of an element constructor is (fairly obviously I would have thought) _not_ a context where a sequence of atomic values is required. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From davidc at nag.co.uk Wed Jan 8 08:59:57 2014 From: davidc at nag.co.uk (David Carlisle) Date: Wed, 08 Jan 2014 16:59:57 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: References: <52CD3F90.6080902@nag.co.uk> <52CD43E0.3020903@nag.co.uk> <52CD4CE0.2040804@nag.co.uk> <52CD7B53.3010108@nag.co.uk> <52CD7CF1.4060004@marklogic.com> <52CD813C.4060108@nag.co.uk> Message-ID: <52CD840D.2090500@nag.co.uk> On 08/01/2014 16:51, Ihe Onwuka wrote: > I guess what I said about the error message didn't resonate. The error message seems clear and appropriate: if you copy two attributes with the same name to the same element you get an error. (It could be defined not to be an error, XSLT as I mentioned ignores all of the copied nodes except the last) but it is hard to see how atomization (the subject line you chose for this thread) is related to that. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From andrew.j.welch at gmail.com Wed Jan 8 09:13:57 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Wed, 8 Jan 2014 17:13:57 +0000 Subject: [xquery-talk] Tales of the unexpected version III - Atomization In-Reply-To: <52CD840D.2090500@nag.co.uk> References: <52CD3F90.6080902@nag.co.uk> <52CD43E0.3020903@nag.co.uk> <52CD4CE0.2040804@nag.co.uk> <52CD7B53.3010108@nag.co.uk> <52CD7CF1.4060004@marklogic.com> <52CD813C.4060108@nag.co.uk> <52CD840D.2090500@nag.co.uk> Message-ID: On 8 January 2014 16:59, David Carlisle wrote: > On 08/01/2014 16:51, Ihe Onwuka wrote: >> >> I guess what I said about the error message didn't resonate. > > > The error message seems clear and appropriate: if you copy two > attributes with the same name to the same element you get an error. (It > could be defined not to be an error, XSLT as I mentioned ignores all of > the copied nodes except the last) but it is hard to see how atomization > (the subject line you chose for this thread) is related to that. Indeed - this is ultimately all boils down to the gotcha of xquery returning element and attribute nodes instead of the string values of those nodes ala xslt. (my test framework uses xquery in the junit tests and I still often get caught by this when I forget /string(.) on the end of simple xpaths) Like all gotchas you will get got until you know about them. The thing is, xquery has a load more, so if they are all played out like this it should be fun. -- Andrew Welch http://andrewjwelch.com From christian.gruen at gmail.com Sat Jan 11 10:27:04 2014 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Sat, 11 Jan 2014 19:27:04 +0100 Subject: [xquery-talk] FLWOR Question In-Reply-To: <7AC1D93CF590E5458FCE12A130606357209B7962@us09exm01.MacLean-Fogg.com> References: <7AC1D93CF590E5458FCE12A130606357209B7962@us09exm01.MacLean-Fogg.com> Message-ID: Hi Chris, > Can the below code be improved to retrieve the current effective price > (4000) given the following: each query processor may benefit from different optimizations, but this is what I noticed: > xs:date($price/@effective/string()) Your input (01/01/2014) doesn?t seem to be valid (2014-01-01); did you already have some thoughts on this? If you work with a valid date format, you could as well get rid of the date conversion, as all values can also be sorted as strings, which is usually faster. Next, it seems that you are requesting the effective price twice. It could be faster to bind it to a variable instead. Your resulting query could then look as follows: let $current := string(current-date()) for $iap in //iap let $effective-price := ( for $price in $iap/price let $effective := $price/@effective/string() where $current >= $effective order by $effective descending return $price )[1] return element { $iap/@name/string() } { $effective-price } You may have noted that I have flattened the FLWOR expressions to a single one. This is sth. that?s already done automatically by some processors. Hope this helps, Christian From CMisztur at macleanfogg.com Sat Jan 11 13:24:40 2014 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Sat, 11 Jan 2014 21:24:40 +0000 Subject: [xquery-talk] FLWOR Question In-Reply-To: References: <7AC1D93CF590E5458FCE12A130606357209B7962@us09exm01.MacLean-Fogg.com>, Message-ID: <7AC1D93CF590E5458FCE12A130606357209B7D49@us09exm01.MacLean-Fogg.com> The date format was my mistake. Thank you for the explanation. That clears up the FLWOR acronym. ________________________________________ From: Christian Gr?n [christian.gruen at gmail.com] Sent: Saturday, January 11, 2014 12:27 PM To: Misztur, Chris Cc: talk at x-query.com Subject: Re: [xquery-talk] FLWOR Question Hi Chris, > Can the below code be improved to retrieve the current effective price > (4000) given the following: each query processor may benefit from different optimizations, but this is what I noticed: > xs:date($price/@effective/string()) Your input (01/01/2014) doesn?t seem to be valid (2014-01-01); did you already have some thoughts on this? If you work with a valid date format, you could as well get rid of the date conversion, as all values can also be sorted as strings, which is usually faster. Next, it seems that you are requesting the effective price twice. It could be faster to bind it to a variable instead. Your resulting query could then look as follows: let $current := string(current-date()) for $iap in //iap let $effective-price := ( for $price in $iap/price let $effective := $price/@effective/string() where $current >= $effective order by $effective descending return $price )[1] return element { $iap/@name/string() } { $effective-price } You may have noted that I have flattened the FLWOR expressions to a single one. This is sth. that?s already done automatically by some processors. Hope this helps, Christian ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From ihe.onwuka at gmail.com Mon Jan 13 11:11:22 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 13 Jan 2014 19:11:22 +0000 Subject: [xquery-talk] Multiple output via a stream of filters Message-ID: I am running through about a gigabyte worth of xml documents. The ideal processing scenario is to offer each node in the sequence to a list of filters and augment different XML documents (or different branches of one encompassing document) based on the outcome of the filter. If anyone has seen the example used to illustrate continuation passing style in Chapter 8 of the Little Schemer that is exactly what I have in mind (albeit not necessarily in continuation passing style). What I am doing at the moment is cycling through the nodes n times where n is the number of filters I am applying. Clearly sub-optimal. However it is not a priority to what I am actually doing (which is simply to get the result rather than to do so performantly) so I am not quite motivated enough to figure out how to do this. Hence I am asking instead what others have done in a similar scenario. I suppose some sort of customised HOF entailing head/tail recursion over the sequence and accepting a list of filter functions, would be the likely form a solution would take. From dlee at calldei.com Mon Jan 13 12:40:11 2014 From: dlee at calldei.com (David Lee) Date: Mon, 13 Jan 2014 20:40:11 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: Message-ID: This is the type of problem xmlsh and XProc were designed for ... What engine are you using? I personally prefer designing with lots of small programs instead of a monolith. This is practical only if the startup overhead for each is small and preferably if in memory data can be passed between steps. XProc, xmlsh, and most xquery database engines support this model efficiently. I find it so much easier to write and debug if I can work in small transformations and let the framework do the plumbing for me. Sent from my iPad (excuse the terseness) David A Lee dlee at calldei.com > On Jan 13, 2014, at 11:12 AM, "Ihe Onwuka" wrote: > > I am running through about a gigabyte worth of xml documents. > > The ideal processing scenario is to offer each node in the sequence to > a list of filters and augment different XML documents (or different > branches of one encompassing document) based on the outcome of the > filter. > > If anyone has seen the example used to illustrate continuation passing > style in Chapter 8 of the Little Schemer that is exactly what I have > in mind (albeit not necessarily in continuation passing style). > > What I am doing at the moment is cycling through the nodes n times > where n is the number of filters I am applying. Clearly sub-optimal. > However it is not a priority to what I am actually doing (which is > simply to get the result rather than to do so performantly) so I am > not quite motivated enough to figure out how to do this. > > Hence I am asking instead what others have done in a similar scenario. > I suppose some sort of customised HOF entailing head/tail recursion > over the sequence and accepting a list of filter functions, would be > the likely form a solution would take. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From dlee at calldei.com Mon Jan 13 12:43:24 2014 From: dlee at calldei.com (David Lee) Date: Mon, 13 Jan 2014 20:43:24 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: , Message-ID: <1A0ED542-91C3-40AE-A229-051ED1B13DA6@calldei.com> FYI working on build machine and store 2 today ... Let me know when you need it back. Maybe we need a store3;) Sent from my iPad (excuse the terseness) David A Lee dlee at calldei.com > On Jan 13, 2014, at 12:40 PM, "David Lee" wrote: > > This is the type of problem xmlsh and XProc were designed for ... > What engine are you using? I personally prefer designing with lots of small programs instead of a monolith. This is practical only if the startup overhead for each is small and preferably if in memory data can be passed between steps. XProc, xmlsh, and most xquery database engines support this model efficiently. I find it so much easier to write and debug if I can work in small transformations and let the framework do the plumbing for me. > > > Sent from my iPad (excuse the terseness) > David A Lee > dlee at calldei.com > > >> On Jan 13, 2014, at 11:12 AM, "Ihe Onwuka" wrote: >> >> I am running through about a gigabyte worth of xml documents. >> >> The ideal processing scenario is to offer each node in the sequence to >> a list of filters and augment different XML documents (or different >> branches of one encompassing document) based on the outcome of the >> filter. >> >> If anyone has seen the example used to illustrate continuation passing >> style in Chapter 8 of the Little Schemer that is exactly what I have >> in mind (albeit not necessarily in continuation passing style). >> >> What I am doing at the moment is cycling through the nodes n times >> where n is the number of filters I am applying. Clearly sub-optimal. >> However it is not a priority to what I am actually doing (which is >> simply to get the result rather than to do so performantly) so I am >> not quite motivated enough to figure out how to do this. >> >> Hence I am asking instead what others have done in a similar scenario. >> I suppose some sort of customised HOF entailing head/tail recursion >> over the sequence and accepting a list of filter functions, would be >> the likely form a solution would take. >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From dlee at calldei.com Mon Jan 13 12:48:49 2014 From: dlee at calldei.com (David Lee) Date: Mon, 13 Jan 2014 20:48:49 +0000 Subject: [xquery-talk] Ignore ; ) Re: Multiple output via a stream of filters In-Reply-To: <1A0ED542-91C3-40AE-A229-051ED1B13DA6@calldei.com> References: , , <1A0ED542-91C3-40AE-A229-051ED1B13DA6@calldei.com> Message-ID: <147E0F87-DEC7-4795-B815-62C748AB8822@calldei.com> Sorry replied to wrong email Sent from my iPad (excuse the terseness) David A Lee dlee at calldei.com > On Jan 13, 2014, at 12:43 PM, "David Lee" wrote: > > FYI working on build machine and store 2 today ... Let me know when you need it back. > Maybe we need a store3;) > > > Sent from my iPad (excuse the terseness) > David A Lee > dlee at calldei.com > > >> On Jan 13, 2014, at 12:40 PM, "David Lee" wrote: >> >> This is the type of problem xmlsh and XProc were designed for ... >> What engine are you using? I personally prefer designing with lots of small programs instead of a monolith. This is practical only if the startup overhead for each is small and preferably if in memory data can be passed between steps. XProc, xmlsh, and most xquery database engines support this model efficiently. I find it so much easier to write and debug if I can work in small transformations and let the framework do the plumbing for me. >> >> >> Sent from my iPad (excuse the terseness) >> David A Lee >> dlee at calldei.com >> >> >>> On Jan 13, 2014, at 11:12 AM, "Ihe Onwuka" wrote: >>> >>> I am running through about a gigabyte worth of xml documents. >>> >>> The ideal processing scenario is to offer each node in the sequence to >>> a list of filters and augment different XML documents (or different >>> branches of one encompassing document) based on the outcome of the >>> filter. >>> >>> If anyone has seen the example used to illustrate continuation passing >>> style in Chapter 8 of the Little Schemer that is exactly what I have >>> in mind (albeit not necessarily in continuation passing style). >>> >>> What I am doing at the moment is cycling through the nodes n times >>> where n is the number of filters I am applying. Clearly sub-optimal. >>> However it is not a priority to what I am actually doing (which is >>> simply to get the result rather than to do so performantly) so I am >>> not quite motivated enough to figure out how to do this. >>> >>> Hence I am asking instead what others have done in a similar scenario. >>> I suppose some sort of customised HOF entailing head/tail recursion >>> over the sequence and accepting a list of filter functions, would be >>> the likely form a solution would take. >>> _______________________________________________ >>> talk at x-query.com >>> http://x-query.com/mailman/listinfo/talk >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From ihe.onwuka at gmail.com Mon Jan 13 13:12:39 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 13 Jan 2014 21:12:39 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: Message-ID: The documents are in an eXist database hence I was expecting and think I need an XQuery solution but am open to other approaches. On Mon, Jan 13, 2014 at 8:40 PM, David Lee wrote: > This is the type of problem xmlsh and XProc were designed for ... > What engine are you using? I personally prefer designing with lots of small programs instead of a monolith. This is practical only if the startup overhead for each is small and preferably if in memory data can be passed between steps. XProc, xmlsh, and most xquery database engines support this model efficiently. I find it so much easier to write and debug if I can work in small transformations and let the framework do the plumbing for me. > > > Sent from my iPad (excuse the terseness) > David A Lee > dlee at calldei.com > > >> On Jan 13, 2014, at 11:12 AM, "Ihe Onwuka" wrote: >> >> I am running through about a gigabyte worth of xml documents. >> >> The ideal processing scenario is to offer each node in the sequence to >> a list of filters and augment different XML documents (or different >> branches of one encompassing document) based on the outcome of the >> filter. >> >> If anyone has seen the example used to illustrate continuation passing >> style in Chapter 8 of the Little Schemer that is exactly what I have >> in mind (albeit not necessarily in continuation passing style). >> >> What I am doing at the moment is cycling through the nodes n times >> where n is the number of filters I am applying. Clearly sub-optimal. >> However it is not a priority to what I am actually doing (which is >> simply to get the result rather than to do so performantly) so I am >> not quite motivated enough to figure out how to do this. >> >> Hence I am asking instead what others have done in a similar scenario. >> I suppose some sort of customised HOF entailing head/tail recursion >> over the sequence and accepting a list of filter functions, would be >> the likely form a solution would take. >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk From adam.retter at googlemail.com Mon Jan 13 15:26:24 2014 From: adam.retter at googlemail.com (Adam Retter) Date: Mon, 13 Jan 2014 23:26:24 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: Message-ID: Ihe, I think the XQuery solution is exactly as you described it. A recursive descent, most likely starting with an identity transform, and a sequence of functions that can be combined and applied at each level of the descent. On 13 January 2014 21:12, Ihe Onwuka wrote: > The documents are in an eXist database hence I was expecting and think > I need an XQuery solution but am open to other approaches. > > On Mon, Jan 13, 2014 at 8:40 PM, David Lee wrote: >> This is the type of problem xmlsh and XProc were designed for ... >> What engine are you using? I personally prefer designing with lots of small programs instead of a monolith. This is practical only if the startup overhead for each is small and preferably if in memory data can be passed between steps. XProc, xmlsh, and most xquery database engines support this model efficiently. I find it so much easier to write and debug if I can work in small transformations and let the framework do the plumbing for me. >> >> >> Sent from my iPad (excuse the terseness) >> David A Lee >> dlee at calldei.com >> >> >>> On Jan 13, 2014, at 11:12 AM, "Ihe Onwuka" wrote: >>> >>> I am running through about a gigabyte worth of xml documents. >>> >>> The ideal processing scenario is to offer each node in the sequence to >>> a list of filters and augment different XML documents (or different >>> branches of one encompassing document) based on the outcome of the >>> filter. >>> >>> If anyone has seen the example used to illustrate continuation passing >>> style in Chapter 8 of the Little Schemer that is exactly what I have >>> in mind (albeit not necessarily in continuation passing style). >>> >>> What I am doing at the moment is cycling through the nodes n times >>> where n is the number of filters I am applying. Clearly sub-optimal. >>> However it is not a priority to what I am actually doing (which is >>> simply to get the result rather than to do so performantly) so I am >>> not quite motivated enough to figure out how to do this. >>> >>> Hence I am asking instead what others have done in a similar scenario. >>> I suppose some sort of customised HOF entailing head/tail recursion >>> over the sequence and accepting a list of filter functions, would be >>> the likely form a solution would take. >>> _______________________________________________ >>> talk at x-query.com >>> http://x-query.com/mailman/listinfo/talk > > _______________________________________________ > 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 dlee at calldei.com Mon Jan 13 15:54:45 2014 From: dlee at calldei.com (David Lee) Date: Mon, 13 Jan 2014 23:54:45 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: Message-ID: If your running in exist then pure XQuery is probably as good or better then anything else. Could you expand on your problem ? I don't know exist that well but I cant think off hand of a better solution Unless there is a shortcut to know ahead of time what transforms to apply ... Do make sure you iterate over the docs *once* then the transforms N times ... E.g. For $d in doc() For $transform in $transforms ... Not the other way ( i.e. DON'T do For $n in $transforms For $d in $doc ... ) I don't know exist that well but typically once a document is fetched into memory in a XML DB it can stay cached, But if you are loading too many docs the cache will get full and it will have to reload the docs. That is assuming that the size of your documents is bigger than the transforms. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] Sent: Monday, January 13, 2014 1:13 PM To: David Lee Cc: talk at x-query.com Subject: Re: [xquery-talk] Multiple output via a stream of filters The documents are in an eXist database hence I was expecting and think I need an XQuery solution but am open to other approaches. On Mon, Jan 13, 2014 at 8:40 PM, David Lee wrote: > This is the type of problem xmlsh and XProc were designed for ... > What engine are you using? I personally prefer designing with lots of small programs instead of a monolith. This is practical only if the startup overhead for each is small and preferably if in memory data can be passed between steps. XProc, xmlsh, and most xquery database engines support this model efficiently. I find it so much easier to write and debug if I can work in small transformations and let the framework do the plumbing for me. > > > Sent from my iPad (excuse the terseness) David A Lee dlee at calldei.com > > >> On Jan 13, 2014, at 11:12 AM, "Ihe Onwuka" wrote: >> >> I am running through about a gigabyte worth of xml documents. >> >> The ideal processing scenario is to offer each node in the sequence >> to a list of filters and augment different XML documents (or >> different branches of one encompassing document) based on the outcome >> of the filter. >> >> If anyone has seen the example used to illustrate continuation >> passing style in Chapter 8 of the Little Schemer that is exactly what >> I have in mind (albeit not necessarily in continuation passing style). >> >> What I am doing at the moment is cycling through the nodes n times >> where n is the number of filters I am applying. Clearly sub-optimal. >> However it is not a priority to what I am actually doing (which is >> simply to get the result rather than to do so performantly) so I am >> not quite motivated enough to figure out how to do this. >> >> Hence I am asking instead what others have done in a similar scenario. >> I suppose some sort of customised HOF entailing head/tail recursion >> over the sequence and accepting a list of filter functions, would be >> the likely form a solution would take. >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk From dlee at calldei.com Mon Jan 13 16:03:15 2014 From: dlee at calldei.com (David Lee) Date: Tue, 14 Jan 2014 00:03:15 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: Message-ID: XML Databases tend to be good at this (keeping things cached, avoiding unnecessary parsing and serialization, etc). If it is a NxM problem that may be fine unless it goes too slow. Then you might want to see about ways of optimization ... Generally though (not sure about Exist but I suspect it falls in the general guidelines of XML DBs) taking a document and applying multiple functions/xquery/xslt to it is just fine. The system will keep the document in memory and usually the setup time to apply exit one function and apply the next is small compared the the functions. And much easier than one big huge complicated function/transform. XML DB's also tend to cache the functions or xqueries after compilation so they don?t need to recompile them every iteration. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: Adam Retter [mailto:adam.retter at googlemail.com] Sent: Monday, January 13, 2014 3:26 PM To: Ihe Onwuka Cc: David Lee; talk at x-query.com Subject: Re: [xquery-talk] Multiple output via a stream of filters Ihe, I think the XQuery solution is exactly as you described it. A recursive descent, most likely starting with an identity transform, and a sequence of functions that can be combined and applied at each level of the descent. On 13 January 2014 21:12, Ihe Onwuka wrote: > The documents are in an eXist database hence I was expecting and think > I need an XQuery solution but am open to other approaches. > > On Mon, Jan 13, 2014 at 8:40 PM, David Lee wrote: >> This is the type of problem xmlsh and XProc were designed for ... >> What engine are you using? I personally prefer designing with lots of small programs instead of a monolith. This is practical only if the startup overhead for each is small and preferably if in memory data can be passed between steps. XProc, xmlsh, and most xquery database engines support this model efficiently. I find it so much easier to write and debug if I can work in small transformations and let the framework do the plumbing for me. >> >> >> Sent from my iPad (excuse the terseness) David A Lee dlee at calldei.com >> >> >>> On Jan 13, 2014, at 11:12 AM, "Ihe Onwuka" wrote: >>> >>> I am running through about a gigabyte worth of xml documents. >>> >>> The ideal processing scenario is to offer each node in the sequence >>> to a list of filters and augment different XML documents (or >>> different branches of one encompassing document) based on the >>> outcome of the filter. >>> >>> If anyone has seen the example used to illustrate continuation >>> passing style in Chapter 8 of the Little Schemer that is exactly >>> what I have in mind (albeit not necessarily in continuation passing style). >>> >>> What I am doing at the moment is cycling through the nodes n times >>> where n is the number of filters I am applying. Clearly sub-optimal. >>> However it is not a priority to what I am actually doing (which is >>> simply to get the result rather than to do so performantly) so I am >>> not quite motivated enough to figure out how to do this. >>> >>> Hence I am asking instead what others have done in a similar scenario. >>> I suppose some sort of customised HOF entailing head/tail recursion >>> over the sequence and accepting a list of filter functions, would >>> be the likely form a solution would take. >>> _______________________________________________ >>> talk at x-query.com >>> http://x-query.com/mailman/listinfo/talk > > _______________________________________________ > 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 adam.retter at googlemail.com Mon Jan 13 16:04:50 2014 From: adam.retter at googlemail.com (Adam Retter) Date: Tue, 14 Jan 2014 00:04:50 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: Message-ID: > > I don't know exist that well but typically once a document is fetched into memory in a XML DB it can stay cached, > But if you are loading too many docs the cache will get full and it will have to reload the docs. > > That is assuming that the size of your documents is bigger than the transforms. Just for clarity. In eXist we do not load entire documents into memory, rather we load proxies to only those nodes that you address in your query. The nodes themselves are only really read during serialization, and that should be done in a streaming manner, so memory should not be an issue. However, even then it is still true in eXist that iterating over the documents instead of the transforms, just as you suggested, would be more efficient. -- Adam Retter skype: adam.retter tweet: adamretter http://www.adamretter.org.uk From ihe.onwuka at gmail.com Mon Jan 13 16:19:21 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 14 Jan 2014 00:19:21 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: Message-ID: On Mon, Jan 13, 2014 at 11:54 PM, David Lee wrote: > If your running in exist then pure XQuery is probably as good or better then anything else. > Could you expand on your problem ? > I have a collection. Suppose I have 10 different outputs I want and the decision as to which output a node is routed to (not necessarily mutual exclusive though) can be encapsulated in a predicate (hence amenable to a filter HOF). I only want to iterate over the collection once but I wish to apply the 10 predicates to each node in the sequence so as to determine which of the 10 outputs (again not necessarily mutually exclusive) the node will feature in. The algorithm is straightforward using structural recursion (or tail recursion if tail call elimination is an issue). Asking whether there is an idiomatic XQuery solution that is different from this. From dlee at calldei.com Mon Jan 13 16:38:54 2014 From: dlee at calldei.com (David Lee) Date: Tue, 14 Jan 2014 00:38:54 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: Message-ID: Could you define what you mean by "output" ? ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] Sent: Monday, January 13, 2014 4:19 PM To: David Lee Cc: talk at x-query.com Subject: Re: [xquery-talk] Multiple output via a stream of filters On Mon, Jan 13, 2014 at 11:54 PM, David Lee wrote: > If your running in exist then pure XQuery is probably as good or better then anything else. > Could you expand on your problem ? > I have a collection. Suppose I have 10 different outputs I want and the decision as to which output a node is routed to (not necessarily mutual exclusive though) can be encapsulated in a predicate (hence amenable to a filter HOF). I only want to iterate over the collection once but I wish to apply the 10 predicates to each node in the sequence so as to determine which of the 10 outputs (again not necessarily mutually exclusive) the node will feature in. The algorithm is straightforward using structural recursion (or tail recursion if tail call elimination is an issue). Asking whether there is an idiomatic XQuery solution that is different from this. From ihe.onwuka at gmail.com Mon Jan 13 16:41:13 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 14 Jan 2014 00:41:13 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: Message-ID: take the simplest case..... a straight copy of the node provided the predicate passes. On Tue, Jan 14, 2014 at 12:38 AM, David Lee wrote: > Could you define what you mean by "output" ? > > ---------------------------------------- > David A. Lee > dlee at calldei.com > http://www.xmlsh.org > > > -----Original Message----- > From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] > Sent: Monday, January 13, 2014 4:19 PM > To: David Lee > Cc: talk at x-query.com > Subject: Re: [xquery-talk] Multiple output via a stream of filters > > On Mon, Jan 13, 2014 at 11:54 PM, David Lee wrote: >> If your running in exist then pure XQuery is probably as good or better then anything else. >> Could you expand on your problem ? >> > > I have a collection. Suppose I have 10 different outputs I want and the decision as to which output a node is routed to (not necessarily mutual exclusive though) can be encapsulated in a predicate (hence amenable to a filter HOF). > > I only want to iterate over the collection once but I wish to apply the 10 predicates to each node in the sequence so as to determine which of the 10 outputs (again not necessarily mutually exclusive) the node will feature in. > > The algorithm is straightforward using structural recursion (or tail recursion if tail call elimination is an issue). Asking whether there is an idiomatic XQuery solution that is different from this. From ihe.onwuka at gmail.com Mon Jan 13 16:55:59 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 14 Jan 2014 00:55:59 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: Message-ID: If it helps think of an entity that entails a bazillion fields like a credit card application and you have multiple ways you wish to classify it. So you have a filter for each classification scheme and the application "filters" through to the output stream of whichever predicates return true. On Tue, Jan 14, 2014 at 12:38 AM, David Lee wrote: > Could you define what you mean by "output" ? > > ---------------------------------------- > David A. Lee > dlee at calldei.com > http://www.xmlsh.org > > > -----Original Message----- > From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] > Sent: Monday, January 13, 2014 4:19 PM > To: David Lee > Cc: talk at x-query.com > Subject: Re: [xquery-talk] Multiple output via a stream of filters > > On Mon, Jan 13, 2014 at 11:54 PM, David Lee wrote: >> If your running in exist then pure XQuery is probably as good or better then anything else. >> Could you expand on your problem ? >> > > I have a collection. Suppose I have 10 different outputs I want and the decision as to which output a node is routed to (not necessarily mutual exclusive though) can be encapsulated in a predicate (hence amenable to a filter HOF). > > I only want to iterate over the collection once but I wish to apply the 10 predicates to each node in the sequence so as to determine which of the 10 outputs (again not necessarily mutually exclusive) the node will feature in. > > The algorithm is straightforward using structural recursion (or tail recursion if tail call elimination is an issue). Asking whether there is an idiomatic XQuery solution that is different from this. From dlee at calldei.com Mon Jan 13 19:42:09 2014 From: dlee at calldei.com (David Lee) Date: Tue, 14 Jan 2014 03:42:09 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: Message-ID: <366f4a83ec74463eb7f6f552d2a0cdfc@BY2PR08MB014.namprd08.prod.outlook.com> A Single XQuery invocation has only one "output stream" ... but when your working in a database often you don't need any, you want to put the data back into the database. Functions don't have "streams" really either although the word is overloaded. One way it to produce a "sequence" of results which you then do something with, either output in the main output or store into the database (as separate documents). Also I believe eXist has functions for writing to files so your question my have more relevance on the exists mailing list. But if what I think you mean by "stream" is a long result ... and your dealing with GB+ data you need to be very careful, True "streaming" is very hard to achieve in XQuery. Functions don't "stream" they return values. XPath doesn't "stream" ... there is no real "streams" in XQuery ... so if your not careful you end up with having to hold the entire result set in memory. But if your output is to the 'main' output (is this an HTTP call ?) you might be able to stream to it .. all depends on the vendor implementation. I suspect what your really after is to write multiple results to either documents or files. XQuery doesn't support this generically but XML Databases like eXist do so you might want to ask there. Or I may have completely misunderstood your question. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] Sent: Monday, January 13, 2014 4:56 PM To: David Lee Cc: talk at x-query.com Subject: Re: [xquery-talk] Multiple output via a stream of filters If it helps think of an entity that entails a bazillion fields like a credit card application and you have multiple ways you wish to classify it. So you have a filter for each classification scheme and the application "filters" through to the output stream of whichever predicates return true. On Tue, Jan 14, 2014 at 12:38 AM, David Lee wrote: > Could you define what you mean by "output" ? > > ---------------------------------------- > David A. Lee > dlee at calldei.com > http://www.xmlsh.org > > > -----Original Message----- > From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] > Sent: Monday, January 13, 2014 4:19 PM > To: David Lee > Cc: talk at x-query.com > Subject: Re: [xquery-talk] Multiple output via a stream of filters > > On Mon, Jan 13, 2014 at 11:54 PM, David Lee wrote: >> If your running in exist then pure XQuery is probably as good or better then anything else. >> Could you expand on your problem ? >> > > I have a collection. Suppose I have 10 different outputs I want and the decision as to which output a node is routed to (not necessarily mutual exclusive though) can be encapsulated in a predicate (hence amenable to a filter HOF). > > I only want to iterate over the collection once but I wish to apply the 10 predicates to each node in the sequence so as to determine which of the 10 outputs (again not necessarily mutually exclusive) the node will feature in. > > The algorithm is straightforward using structural recursion (or tail recursion if tail call elimination is an issue). Asking whether there is an idiomatic XQuery solution that is different from this. From ihe.onwuka at gmail.com Mon Jan 13 19:50:19 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 14 Jan 2014 03:50:19 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: <366f4a83ec74463eb7f6f552d2a0cdfc@BY2PR08MB014.namprd08.prod.outlook.com> References: <366f4a83ec74463eb7f6f552d2a0cdfc@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: Input .... ginormous xml document containing data relating to a credit card application that I only want to read once. Filters. - under 25's, college educated, single mother, bankrupts, 6 figure income, repeat applicants, self-employed. 1 input - 7 outputs All applicants that meet the criteria of a given filter are copied to the output corresponding to that filter. We could camouflage the 7 outputs into one by wrapping an element around the whole 7. On Tue, Jan 14, 2014 at 3:42 AM, David Lee wrote: > A Single XQuery invocation has only one "output stream" ... but when your working in a database often you don't need any, you want to put the data back into the database. > Functions don't have "streams" really either although the word is overloaded. > One way it to produce a "sequence" of results which you then do something with, either output in the main output or store into the database (as separate documents). > > Also I believe eXist has functions for writing to files so your question my have more relevance on the exists mailing list. > > But if what I think you mean by "stream" is a long result ... and your dealing with GB+ data you need to be very careful, > True "streaming" is very hard to achieve in XQuery. Functions don't "stream" they return values. > XPath doesn't "stream" ... there is no real "streams" in XQuery ... so if your not careful you end up with having to hold the entire result set in memory. > But if your output is to the 'main' output (is this an HTTP call ?) you might be able to stream to it .. all depends on the vendor implementation. > > I suspect what your really after is to write multiple results to either documents or files. > XQuery doesn't support this generically but XML Databases like eXist do so you might want to ask there. > > Or I may have completely misunderstood your question. > > > > ---------------------------------------- > David A. Lee > dlee at calldei.com > http://www.xmlsh.org > > -----Original Message----- > From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] > Sent: Monday, January 13, 2014 4:56 PM > To: David Lee > Cc: talk at x-query.com > Subject: Re: [xquery-talk] Multiple output via a stream of filters > > If it helps think of an entity that entails a bazillion fields like a credit card application and you have multiple ways you wish to classify it. So you have a filter for each classification scheme and the application "filters" through to the output stream of whichever predicates return true. > > > > On Tue, Jan 14, 2014 at 12:38 AM, David Lee wrote: >> Could you define what you mean by "output" ? >> >> ---------------------------------------- >> David A. Lee >> dlee at calldei.com >> http://www.xmlsh.org >> >> >> -----Original Message----- >> From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] >> Sent: Monday, January 13, 2014 4:19 PM >> To: David Lee >> Cc: talk at x-query.com >> Subject: Re: [xquery-talk] Multiple output via a stream of filters >> >> On Mon, Jan 13, 2014 at 11:54 PM, David Lee wrote: >>> If your running in exist then pure XQuery is probably as good or better then anything else. >>> Could you expand on your problem ? >>> >> >> I have a collection. Suppose I have 10 different outputs I want and the decision as to which output a node is routed to (not necessarily mutual exclusive though) can be encapsulated in a predicate (hence amenable to a filter HOF). >> >> I only want to iterate over the collection once but I wish to apply the 10 predicates to each node in the sequence so as to determine which of the 10 outputs (again not necessarily mutually exclusive) the node will feature in. >> >> The algorithm is straightforward using structural recursion (or tail recursion if tail call elimination is an issue). Asking whether there is an idiomatic XQuery solution that is different from this. From ihe.onwuka at gmail.com Mon Jan 13 19:51:43 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 14 Jan 2014 03:51:43 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: <366f4a83ec74463eb7f6f552d2a0cdfc@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: I only read the ginormous XML once... I apply the 7 filters to each node read and it gets allocated to one of the 7 output buckets (hows that for a semantically neutral term). On Tue, Jan 14, 2014 at 3:50 AM, Ihe Onwuka wrote: > Input .... ginormous xml document containing data relating to a credit > card application that I only want to read once. > > Filters. - under 25's, college educated, single mother, bankrupts, 6 > figure income, repeat applicants, self-employed. > > 1 input - 7 outputs > > All applicants that meet the criteria of a given filter are copied to > the output corresponding to that filter. > > We could camouflage the 7 outputs into one by wrapping an element > around the whole 7. > > On Tue, Jan 14, 2014 at 3:42 AM, David Lee wrote: >> A Single XQuery invocation has only one "output stream" ... but when your working in a database often you don't need any, you want to put the data back into the database. >> Functions don't have "streams" really either although the word is overloaded. >> One way it to produce a "sequence" of results which you then do something with, either output in the main output or store into the database (as separate documents). >> >> Also I believe eXist has functions for writing to files so your question my have more relevance on the exists mailing list. >> >> But if what I think you mean by "stream" is a long result ... and your dealing with GB+ data you need to be very careful, >> True "streaming" is very hard to achieve in XQuery. Functions don't "stream" they return values. >> XPath doesn't "stream" ... there is no real "streams" in XQuery ... so if your not careful you end up with having to hold the entire result set in memory. >> But if your output is to the 'main' output (is this an HTTP call ?) you might be able to stream to it .. all depends on the vendor implementation. >> >> I suspect what your really after is to write multiple results to either documents or files. >> XQuery doesn't support this generically but XML Databases like eXist do so you might want to ask there. >> >> Or I may have completely misunderstood your question. >> >> >> >> ---------------------------------------- >> David A. Lee >> dlee at calldei.com >> http://www.xmlsh.org >> >> -----Original Message----- >> From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] >> Sent: Monday, January 13, 2014 4:56 PM >> To: David Lee >> Cc: talk at x-query.com >> Subject: Re: [xquery-talk] Multiple output via a stream of filters >> >> If it helps think of an entity that entails a bazillion fields like a credit card application and you have multiple ways you wish to classify it. So you have a filter for each classification scheme and the application "filters" through to the output stream of whichever predicates return true. >> >> >> >> On Tue, Jan 14, 2014 at 12:38 AM, David Lee wrote: >>> Could you define what you mean by "output" ? >>> >>> ---------------------------------------- >>> David A. Lee >>> dlee at calldei.com >>> http://www.xmlsh.org >>> >>> >>> -----Original Message----- >>> From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] >>> Sent: Monday, January 13, 2014 4:19 PM >>> To: David Lee >>> Cc: talk at x-query.com >>> Subject: Re: [xquery-talk] Multiple output via a stream of filters >>> >>> On Mon, Jan 13, 2014 at 11:54 PM, David Lee wrote: >>>> If your running in exist then pure XQuery is probably as good or better then anything else. >>>> Could you expand on your problem ? >>>> >>> >>> I have a collection. Suppose I have 10 different outputs I want and the decision as to which output a node is routed to (not necessarily mutual exclusive though) can be encapsulated in a predicate (hence amenable to a filter HOF). >>> >>> I only want to iterate over the collection once but I wish to apply the 10 predicates to each node in the sequence so as to determine which of the 10 outputs (again not necessarily mutually exclusive) the node will feature in. >>> >>> The algorithm is straightforward using structural recursion (or tail recursion if tail call elimination is an issue). Asking whether there is an idiomatic XQuery solution that is different from this. From dlee at calldei.com Mon Jan 13 19:55:50 2014 From: dlee at calldei.com (David Lee) Date: Tue, 14 Jan 2014 03:55:50 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: <366f4a83ec74463eb7f6f552d2a0cdfc@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: In pure generic XQuery there is one output; So if you want 7 outputs you need to either produce a "sequence" of 7 items or a single document encapsulating them. To produce a sequence you don't actually need to collect the values just let them evaluate let $doc = doc("huge.xml") return ( filter1($doc) , filter2($doc) .... ) TO produce a wrapped element is similar let $doc = doc("huge.xml") return { filter1($doc) }{ filter2($doc) } ..... ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] Sent: Monday, January 13, 2014 7:52 PM To: David Lee Cc: talk at x-query.com Subject: Re: [xquery-talk] Multiple output via a stream of filters I only read the ginormous XML once... I apply the 7 filters to each node read and it gets allocated to one of the 7 output buckets (hows that for a semantically neutral term). On Tue, Jan 14, 2014 at 3:50 AM, Ihe Onwuka wrote: > Input .... ginormous xml document containing data relating to a credit > card application that I only want to read once. > > Filters. - under 25's, college educated, single mother, bankrupts, 6 > figure income, repeat applicants, self-employed. > > 1 input - 7 outputs > > All applicants that meet the criteria of a given filter are copied to > the output corresponding to that filter. > > We could camouflage the 7 outputs into one by wrapping an element > around the whole 7. > > On Tue, Jan 14, 2014 at 3:42 AM, David Lee wrote: >> A Single XQuery invocation has only one "output stream" ... but when your working in a database often you don't need any, you want to put the data back into the database. >> Functions don't have "streams" really either although the word is overloaded. >> One way it to produce a "sequence" of results which you then do something with, either output in the main output or store into the database (as separate documents). >> >> Also I believe eXist has functions for writing to files so your question my have more relevance on the exists mailing list. >> >> But if what I think you mean by "stream" is a long result ... and >> your dealing with GB+ data you need to be very careful, True "streaming" is very hard to achieve in XQuery. Functions don't "stream" they return values. >> XPath doesn't "stream" ... there is no real "streams" in XQuery ... so if your not careful you end up with having to hold the entire result set in memory. >> But if your output is to the 'main' output (is this an HTTP call ?) you might be able to stream to it .. all depends on the vendor implementation. >> >> I suspect what your really after is to write multiple results to either documents or files. >> XQuery doesn't support this generically but XML Databases like eXist do so you might want to ask there. >> >> Or I may have completely misunderstood your question. >> >> >> >> ---------------------------------------- >> David A. Lee >> dlee at calldei.com >> http://www.xmlsh.org >> >> -----Original Message----- >> From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] >> Sent: Monday, January 13, 2014 4:56 PM >> To: David Lee >> Cc: talk at x-query.com >> Subject: Re: [xquery-talk] Multiple output via a stream of filters >> >> If it helps think of an entity that entails a bazillion fields like a credit card application and you have multiple ways you wish to classify it. So you have a filter for each classification scheme and the application "filters" through to the output stream of whichever predicates return true. >> >> >> >> On Tue, Jan 14, 2014 at 12:38 AM, David Lee wrote: >>> Could you define what you mean by "output" ? >>> >>> ---------------------------------------- >>> David A. Lee >>> dlee at calldei.com >>> http://www.xmlsh.org >>> >>> >>> -----Original Message----- >>> From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] >>> Sent: Monday, January 13, 2014 4:19 PM >>> To: David Lee >>> Cc: talk at x-query.com >>> Subject: Re: [xquery-talk] Multiple output via a stream of filters >>> >>> On Mon, Jan 13, 2014 at 11:54 PM, David Lee wrote: >>>> If your running in exist then pure XQuery is probably as good or better then anything else. >>>> Could you expand on your problem ? >>>> >>> >>> I have a collection. Suppose I have 10 different outputs I want and the decision as to which output a node is routed to (not necessarily mutual exclusive though) can be encapsulated in a predicate (hence amenable to a filter HOF). >>> >>> I only want to iterate over the collection once but I wish to apply the 10 predicates to each node in the sequence so as to determine which of the 10 outputs (again not necessarily mutually exclusive) the node will feature in. >>> >>> The algorithm is straightforward using structural recursion (or tail recursion if tail call elimination is an issue). Asking whether there is an idiomatic XQuery solution that is different from this. From mike at saxonica.com Tue Jan 14 00:42:51 2014 From: mike at saxonica.com (Michael Kay) Date: Tue, 14 Jan 2014 08:42:51 +0000 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: <366f4a83ec74463eb7f6f552d2a0cdfc@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: > I only read the ginormous XML once... I apply the 7 filters to each > node read and it gets allocated to one of the 7 output buckets (hows > that for a semantically neutral term). > This is known within the XSL WG as the "coloured widgets" problem after a streaming use case put forward by Oliver Becker. (The problem is, given an input document containing widgets of different colours, produce N output documents, one for each colour present in the file. There are two variants of the problem, one where the set of colours is known statically, one where it is dynamic). The XSLT 3.0 streaming solution for the static case is: A streaming processor is required to evaluate this in a single pass of the input document; the three "prongs" of the xsl:fork are effectively executed in parallel. I mention this purely for academic interest, since there is no implementation available, unless you count the one I wrote last week. I don't think XSLT 3.0 currently has an equivalent solution for the dynamic case, where the colours are not known in advance. The normal solution would use "group-by" but this is not streamable. Michael Kay Saxonica From wcandillon at gmail.com Tue Jan 14 00:56:03 2014 From: wcandillon at gmail.com (William Candillon) Date: Tue, 14 Jan 2014 09:56:03 +0100 Subject: [xquery-talk] Multiple output via a stream of filters In-Reply-To: References: <366f4a83ec74463eb7f6f552d2a0cdfc@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: Hi Ihe, Here are a couple of resources about streaming xml and json documents with Zorba: http://www.zorba.io/blog/60027975996/xml-streaming-with-xquery http://www.zorba.io/blog/60027825488/json-streaming-with-xquery As I'm reading your use case, I have a feeling that the transform.xq library from John Snelson at https://github.com/jpcs/transform.xq might hopefully be implementing the pattern you are looking for. Kind regards, William On Tue, Jan 14, 2014 at 9:42 AM, Michael Kay wrote: > > >> I only read the ginormous XML once... I apply the 7 filters to each >> node read and it gets allocated to one of the 7 output buckets (hows >> that for a semantically neutral term). >> > > This is known within the XSL WG as the "coloured widgets" problem after a streaming use case put forward by Oliver Becker. (The problem is, given an input document containing widgets of different colours, produce N output documents, one for each colour present in the file. There are two variants of the problem, one where the set of colours is known statically, one where it is dynamic). The XSLT 3.0 streaming solution for the static case is: > > > > > > > > > > > > > > > > > > > > > > A streaming processor is required to evaluate this in a single pass of the input document; the three "prongs" of the xsl:fork are effectively executed in parallel. > > I mention this purely for academic interest, since there is no implementation available, unless you count the one I wrote last week. > > I don't think XSLT 3.0 currently has an equivalent solution for the dynamic case, where the colours are not known in advance. The normal solution would use "group-by" but this is not streamable. > > Michael Kay > Saxonica > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From ihe.onwuka at gmail.com Fri Jan 17 10:14:37 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Fri, 17 Jan 2014 18:14:37 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: Continuing on the them of recreating the limitations of the physical world. where someNode does not exist in the document has no effect. ---------- > [DAL:] > I would like to add, not only total refreshing agreement to this sentiment but take it one step sideways. > This isn't a new thought but its one us compute people often forget. > Folders and Files. The whole concept of "The Filesystem" ... having to put things into Files, and Folders of Files and Volumes etc. is archaic ... > I believe historically it was done both to try to model "the real world" of "The Office" into terms people could understand (literally files of paper bound in little file jackets put into folders, put into filing cabinets). AND as convenience to early disk based computing ... a simple way to organize data. > This metaphor Documents and Collections (or Directories or Cabinets) has persevered for decades and now is so ingrained its the only way most people think data *must* be represented or stored or packaged. Onceaponatime we thought computers would free us from the Paper World ... but it has not - why ? because we used them to model paper !!! > > That and paper is a particularly nice way to view text ... > > -David > From adam.retter at googlemail.com Fri Jan 17 11:31:42 2014 From: adam.retter at googlemail.com (Adam Retter) Date: Fri, 17 Jan 2014 19:31:42 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: Assuming that you are using Saxon for XSLT - how about using fn:collection instead of fn:doc, as it allows you to control how the errors are propagated - http://saxonica.com/documentation9.4-demo/html/sourcedocs/collections.html There may also be something similar for fn:doc but I cannot find the documentation On 17 January 2014 18:14, Ihe Onwuka wrote: > Continuing on the them of recreating the limitations of the physical world. > > > > where someNode does not exist in the document has no effect. > > > ---------- >> [DAL:] >> I would like to add, not only total refreshing agreement to this sentiment but take it one step sideways. >> This isn't a new thought but its one us compute people often forget. >> Folders and Files. The whole concept of "The Filesystem" ... having to put things into Files, and Folders of Files and Volumes etc. is archaic ... >> I believe historically it was done both to try to model "the real world" of "The Office" into terms people could understand (literally files of paper bound in little file jackets put into folders, put into filing cabinets). AND as convenience to early disk based computing ... a simple way to organize data. >> This metaphor Documents and Collections (or Directories or Cabinets) has persevered for decades and now is so ingrained its the only way most people think data *must* be represented or stored or packaged. Onceaponatime we thought computers would free us from the Paper World ... but it has not - why ? because we used them to model paper !!! >> >> That and paper is a particularly nice way to view text ... >> >> -David >> > > _______________________________________________ > 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 gkholman at CraneSoftwrights.com Fri Jan 17 20:39:35 2014 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Fri, 17 Jan 2014 18:39:35 -1000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <7.0.1.0.2.20140117183706.0236c7f0@wheresmymailserver.com> At 2014-01-17 18:14 +0000, Ihe Onwuka wrote: >Continuing on the them of recreating the limitations of the physical world. > > > >where someNode does not exist in the document has no effect. > > I hope this helps. . . . . . . . Ken -- Public XSLT, XSL-FO, UBL & code list classes: Melbourne, AU May 2014 | 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: http://plus.google.com/+GKenHolman-Crane/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal | From ihe.onwuka at gmail.com Fri Jan 17 20:58:26 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sat, 18 Jan 2014 04:58:26 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <7.0.1.0.2.20140117183706.0236c7f0@wheresmymailserver.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <7.0.1.0.2.20140117183706.0236c7f0@wheresmymailserver.com> Message-ID: On Sat, Jan 18, 2014 at 4:39 AM, G. Ken Holman wrote: > At 2014-01-17 18:14 +0000, Ihe Onwuka wrote: >> >> Continuing on the them of recreating the limitations of the physical >> world. >> >> >> >> where someNode does not exist in the document has no effect. >> >> > Which if the verbatim of my prior experiment () is anything to go by will still give you a "Failed to load document ihe.xml" error. From mike at saxonica.com Sat Jan 18 01:19:21 2014 From: mike at saxonica.com (Michael Kay) Date: Sat, 18 Jan 2014 09:19:21 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: On 17 Jan 2014, at 18:14, Ihe Onwuka wrote: > Continuing on the them of recreating the limitations of the physical world. > > > > where someNode does not exist in the document has no effect. > > >> >> where someNode does not exist in the document has no effect. >> >> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: On Sat, Jan 18, 2014 at 1:57 PM, Adam Retter wrote: >>> You know full well that the design isn't going to be improved in a subsequent release unless there's an issue that's a real stopper, because people expect backwards compatibility. >> >> http://exist.2174344.n4.nabble.com/Signature-of-fn-filter-doesn-t-look-like-it-conforms-to-the-spec-td4662991.html >> > > I am not sure that this is making the point you think it is! It does. > snipped > > Anyway, I am sure you realise that you could write your own function > in XSLT, let's call it 'doc-or-empty' and use it in place of doc to > achieve exactly what you want. > Yes and I have no intention of doing so. See the original post here. http://exist.2174344.n4.nabble.com/Why-does-it-think-the-variable-is-not-set-tc4663027.html#none I knew that parenthesising the return expression would fix the problem but I didn't know why. Wolfgang's answer told me. From joewiz at gmail.com Sat Jan 18 10:01:23 2014 From: joewiz at gmail.com (Joe Wicentowski) Date: Sat, 18 Jan 2014 13:01:23 -0500 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> I have a major bone to pick with the XQuery working group and all users of the language, who must all be insane. When I'm trying to write a program in XQuery and it isn't working, I need to blow off steam with a pissed off comment in the code right where the error message appears. So I write my comment: >:( XQuery makes no sense to me!!! ):< But this raises new errors! So I try a different comment syntax: >:^( GRRRR! )v:< And another error appears! Why doesn't XQuery understand my comments? Change it now or I will never cease to complain. Oh, and I'm not interested in code samples showing the correct syntax for comments or explanations about the origins of whatever crazy comment syntax they came up with. One final note to anyone who tries to be helpful: Shove it! Sent from my iPhone > On Jan 18, 2014, at 11:02 AM, Ihe Onwuka wrote: > > On Sat, Jan 18, 2014 at 1:57 PM, Adam Retter wrote: >>>> You know full well that the design isn't going to be improved in a subsequent release unless there's an issue that's a real stopper, because people expect backwards compatibility. >>> >>> http://exist.2174344.n4.nabble.com/Signature-of-fn-filter-doesn-t-look-like-it-conforms-to-the-spec-td4662991.html >> >> I am not sure that this is making the point you think it is! > > It does. > >> snipped > > >> >> Anyway, I am sure you realise that you could write your own function >> in XSLT, let's call it 'doc-or-empty' and use it in place of doc to >> achieve exactly what you want. > > Yes and I have no intention of doing so. > > See the original post here. > > http://exist.2174344.n4.nabble.com/Why-does-it-think-the-variable-is-not-set-tc4663027.html#none > > I knew that parenthesising the return expression would fix the problem > but I didn't know why. Wolfgang's answer told me. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From ihe.onwuka at gmail.com Sat Jan 18 10:13:44 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sat, 18 Jan 2014 18:13:44 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> Message-ID: If getting code, syntax, solutions and help with writing your program is your primary and sole objective I recommend StackOverflow.com. On Sat, Jan 18, 2014 at 6:01 PM, Joe Wicentowski wrote: > I have a major bone to pick with the XQuery working group and all users of the language, who must all be insane. > > When I'm trying to write a program in XQuery and it isn't working, I need to blow off steam with a pissed off comment in the code right where the error message appears. So I write my comment: > >>:( XQuery makes no sense to me!!! ):< > > But this raises new errors! So I try a different comment syntax: > >>:^( GRRRR! )v:< > > And another error appears! > > Why doesn't XQuery understand my comments? Change it now or I will never cease to complain. > > Oh, and I'm not interested in code samples showing the correct syntax for comments or explanations about the origins of whatever crazy comment syntax they came up with. > > One final note to anyone who tries to be helpful: Shove it! > > Sent from my iPhone > >> On Jan 18, 2014, at 11:02 AM, Ihe Onwuka wrote: >> >> On Sat, Jan 18, 2014 at 1:57 PM, Adam Retter wrote: >>>>> You know full well that the design isn't going to be improved in a subsequent release unless there's an issue that's a real stopper, because people expect backwards compatibility. >>>> >>>> http://exist.2174344.n4.nabble.com/Signature-of-fn-filter-doesn-t-look-like-it-conforms-to-the-spec-td4662991.html >>> >>> I am not sure that this is making the point you think it is! >> >> It does. >> >>> snipped >> >> >>> >>> Anyway, I am sure you realise that you could write your own function >>> in XSLT, let's call it 'doc-or-empty' and use it in place of doc to >>> achieve exactly what you want. >> >> Yes and I have no intention of doing so. >> >> See the original post here. >> >> http://exist.2174344.n4.nabble.com/Why-does-it-think-the-variable-is-not-set-tc4663027.html#none >> >> I knew that parenthesising the return expression would fix the problem >> but I didn't know why. Wolfgang's answer told me. >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk From joewiz at gmail.com Sat Jan 18 10:26:57 2014 From: joewiz at gmail.com (Joe Wicentowski) Date: Sat, 18 Jan 2014 13:26:57 -0500 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> Message-ID: <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> I didn't ask for constructive suggestions. Read the original post. Sent from my iPhone > On Jan 18, 2014, at 1:13 PM, Ihe Onwuka wrote: > > If getting code, syntax, solutions and help with writing your program > is your primary and sole objective I recommend StackOverflow.com. > > > >> On Sat, Jan 18, 2014 at 6:01 PM, Joe Wicentowski wrote: >> I have a major bone to pick with the XQuery working group and all users of the language, who must all be insane. >> >> When I'm trying to write a program in XQuery and it isn't working, I need to blow off steam with a pissed off comment in the code right where the error message appears. So I write my comment: >> >>> :( XQuery makes no sense to me!!! ):< >> >> But this raises new errors! So I try a different comment syntax: >> >>> :^( GRRRR! )v:< >> >> And another error appears! >> >> Why doesn't XQuery understand my comments? Change it now or I will never cease to complain. >> >> Oh, and I'm not interested in code samples showing the correct syntax for comments or explanations about the origins of whatever crazy comment syntax they came up with. >> >> One final note to anyone who tries to be helpful: Shove it! >> >> Sent from my iPhone >> >>> On Jan 18, 2014, at 11:02 AM, Ihe Onwuka wrote: >>> >>> On Sat, Jan 18, 2014 at 1:57 PM, Adam Retter wrote: >>>>>> You know full well that the design isn't going to be improved in a subsequent release unless there's an issue that's a real stopper, because people expect backwards compatibility. >>>>> >>>>> http://exist.2174344.n4.nabble.com/Signature-of-fn-filter-doesn-t-look-like-it-conforms-to-the-spec-td4662991.html >>>> >>>> I am not sure that this is making the point you think it is! >>> >>> It does. >>> >>>> snipped >>> >>> >>>> >>>> Anyway, I am sure you realise that you could write your own function >>>> in XSLT, let's call it 'doc-or-empty' and use it in place of doc to >>>> achieve exactly what you want. >>> >>> Yes and I have no intention of doing so. >>> >>> See the original post here. >>> >>> http://exist.2174344.n4.nabble.com/Why-does-it-think-the-variable-is-not-set-tc4663027.html#none >>> >>> I knew that parenthesising the return expression would fix the problem >>> but I didn't know why. Wolfgang's answer told me. >>> _______________________________________________ >>> talk at x-query.com >>> http://x-query.com/mailman/listinfo/talk From ihe.onwuka at gmail.com Sat Jan 18 10:34:33 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sat, 18 Jan 2014 18:34:33 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: You have too many R's in your GRRRRR! Try GRRRI instead and use ? instead of ! at the end of your R's thats the normal way to solve these kind of problems in 3.0 On Sat, Jan 18, 2014 at 6:26 PM, Joe Wicentowski wrote: > I didn't ask for constructive suggestions. Read the original post. > > Sent from my iPhone > >> On Jan 18, 2014, at 1:13 PM, Ihe Onwuka wrote: >> >> If getting code, syntax, solutions and help with writing your program >> is your primary and sole objective I recommend StackOverflow.com. >> >> >> >>> On Sat, Jan 18, 2014 at 6:01 PM, Joe Wicentowski wrote: >>> I have a major bone to pick with the XQuery working group and all users of the language, who must all be insane. >>> >>> When I'm trying to write a program in XQuery and it isn't working, I need to blow off steam with a pissed off comment in the code right where the error message appears. So I write my comment: >>> >>>> :( XQuery makes no sense to me!!! ):< >>> >>> But this raises new errors! So I try a different comment syntax: >>> >>>> :^( GRRRR! )v:< >>> >>> And another error appears! >>> >>> Why doesn't XQuery understand my comments? Change it now or I will never cease to complain. >>> >>> Oh, and I'm not interested in code samples showing the correct syntax for comments or explanations about the origins of whatever crazy comment syntax they came up with. >>> >>> One final note to anyone who tries to be helpful: Shove it! >>> >>> Sent from my iPhone >>> >>>> On Jan 18, 2014, at 11:02 AM, Ihe Onwuka wrote: >>>> >>>> On Sat, Jan 18, 2014 at 1:57 PM, Adam Retter wrote: >>>>>>> You know full well that the design isn't going to be improved in a subsequent release unless there's an issue that's a real stopper, because people expect backwards compatibility. >>>>>> >>>>>> http://exist.2174344.n4.nabble.com/Signature-of-fn-filter-doesn-t-look-like-it-conforms-to-the-spec-td4662991.html >>>>> >>>>> I am not sure that this is making the point you think it is! >>>> >>>> It does. >>>> >>>>> snipped >>>> >>>> >>>>> >>>>> Anyway, I am sure you realise that you could write your own function >>>>> in XSLT, let's call it 'doc-or-empty' and use it in place of doc to >>>>> achieve exactly what you want. >>>> >>>> Yes and I have no intention of doing so. >>>> >>>> See the original post here. >>>> >>>> http://exist.2174344.n4.nabble.com/Why-does-it-think-the-variable-is-not-set-tc4663027.html#none >>>> >>>> I knew that parenthesising the return expression would fix the problem >>>> but I didn't know why. Wolfgang's answer told me. >>>> _______________________________________________ >>>> talk at x-query.com >>>> http://x-query.com/mailman/listinfo/talk From joewiz at gmail.com Sat Jan 18 10:35:00 2014 From: joewiz at gmail.com (Joe Wicentowski) Date: Sat, 18 Jan 2014 13:35:00 -0500 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: In fact, while I (of course) was expecting you to read my mind, I don't even think I know what I wanted in the first place. On second thought, maybe I did. How about if you read it again, and remind me what I said. I can't be bothered to re-read old messages. In the meantime I'll just keep adding more nonsense to each new email I write and make sure I get the last word. P-( ARRGH! This doesn't work either! )-d Sent from my iPhone > On Jan 18, 2014, at 1:26 PM, Joe Wicentowski wrote: > > I didn't ask for constructive suggestions. Read the original post. > > Sent from my iPhone > >> On Jan 18, 2014, at 1:13 PM, Ihe Onwuka wrote: >> >> If getting code, syntax, solutions and help with writing your program >> is your primary and sole objective I recommend StackOverflow.com. >> >> >> >>> On Sat, Jan 18, 2014 at 6:01 PM, Joe Wicentowski wrote: >>> I have a major bone to pick with the XQuery working group and all users of the language, who must all be insane. >>> >>> When I'm trying to write a program in XQuery and it isn't working, I need to blow off steam with a pissed off comment in the code right where the error message appears. So I write my comment: >>> >>>> :( XQuery makes no sense to me!!! ):< >>> >>> But this raises new errors! So I try a different comment syntax: >>> >>>> :^( GRRRR! )v:< >>> >>> And another error appears! >>> >>> Why doesn't XQuery understand my comments? Change it now or I will never cease to complain. >>> >>> Oh, and I'm not interested in code samples showing the correct syntax for comments or explanations about the origins of whatever crazy comment syntax they came up with. >>> >>> One final note to anyone who tries to be helpful: Shove it! >>> >>> Sent from my iPhone >>> >>>> On Jan 18, 2014, at 11:02 AM, Ihe Onwuka wrote: >>>> >>>> On Sat, Jan 18, 2014 at 1:57 PM, Adam Retter wrote: >>>>>>> You know full well that the design isn't going to be improved in a subsequent release unless there's an issue that's a real stopper, because people expect backwards compatibility. >>>>>> >>>>>> http://exist.2174344.n4.nabble.com/Signature-of-fn-filter-doesn-t-look-like-it-conforms-to-the-spec-td4662991.html >>>>> >>>>> I am not sure that this is making the point you think it is! >>>> >>>> It does. >>>> >>>>> snipped >>>> >>>> >>>>> >>>>> Anyway, I am sure you realise that you could write your own function >>>>> in XSLT, let's call it 'doc-or-empty' and use it in place of doc to >>>>> achieve exactly what you want. >>>> >>>> Yes and I have no intention of doing so. >>>> >>>> See the original post here. >>>> >>>> http://exist.2174344.n4.nabble.com/Why-does-it-think-the-variable-is-not-set-tc4663027.html#none >>>> >>>> I knew that parenthesising the return expression would fix the problem >>>> but I didn't know why. Wolfgang's answer told me. >>>> _______________________________________________ >>>> talk at x-query.com >>>> http://x-query.com/mailman/listinfo/talk From christian.gruen at gmail.com Sat Jan 18 10:39:20 2014 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Sat, 18 Jan 2014 19:39:20 +0100 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: > P-( ARRGH! This doesn't work either! )-d { ((: This ? ? ? ? ? works! :)) } ________________________________ On Sat, Jan 18, 2014 at 7:35 PM, Joe Wicentowski wrote: > In fact, while I (of course) was expecting you to read my mind, I don't even think I know what I wanted in the first place. On second thought, maybe I did. How about if you read it again, and remind me what I said. I can't be bothered to re-read old messages. In the meantime I'll just keep adding more nonsense to each new email I write and make sure I get the last word. > > > Sent from my iPhone > >> On Jan 18, 2014, at 1:26 PM, Joe Wicentowski wrote: >> >> I didn't ask for constructive suggestions. Read the original post. >> >> Sent from my iPhone >> >>> On Jan 18, 2014, at 1:13 PM, Ihe Onwuka wrote: >>> >>> If getting code, syntax, solutions and help with writing your program >>> is your primary and sole objective I recommend StackOverflow.com. >>> >>> >>> >>>> On Sat, Jan 18, 2014 at 6:01 PM, Joe Wicentowski wrote: >>>> I have a major bone to pick with the XQuery working group and all users of the language, who must all be insane. >>>> >>>> When I'm trying to write a program in XQuery and it isn't working, I need to blow off steam with a pissed off comment in the code right where the error message appears. So I write my comment: >>>> >>>>> :( XQuery makes no sense to me!!! ):< >>>> >>>> But this raises new errors! So I try a different comment syntax: >>>> >>>>> :^( GRRRR! )v:< >>>> >>>> And another error appears! >>>> >>>> Why doesn't XQuery understand my comments? Change it now or I will never cease to complain. >>>> >>>> Oh, and I'm not interested in code samples showing the correct syntax for comments or explanations about the origins of whatever crazy comment syntax they came up with. >>>> >>>> One final note to anyone who tries to be helpful: Shove it! >>>> >>>> Sent from my iPhone >>>> >>>>> On Jan 18, 2014, at 11:02 AM, Ihe Onwuka wrote: >>>>> >>>>> On Sat, Jan 18, 2014 at 1:57 PM, Adam Retter wrote: >>>>>>>> You know full well that the design isn't going to be improved in a subsequent release unless there's an issue that's a real stopper, because people expect backwards compatibility. >>>>>>> >>>>>>> http://exist.2174344.n4.nabble.com/Signature-of-fn-filter-doesn-t-look-like-it-conforms-to-the-spec-td4662991.html >>>>>> >>>>>> I am not sure that this is making the point you think it is! >>>>> >>>>> It does. >>>>> >>>>>> snipped >>>>> >>>>> >>>>>> >>>>>> Anyway, I am sure you realise that you could write your own function >>>>>> in XSLT, let's call it 'doc-or-empty' and use it in place of doc to >>>>>> achieve exactly what you want. >>>>> >>>>> Yes and I have no intention of doing so. >>>>> >>>>> See the original post here. >>>>> >>>>> http://exist.2174344.n4.nabble.com/Why-does-it-think-the-variable-is-not-set-tc4663027.html#none >>>>> >>>>> I knew that parenthesising the return expression would fix the problem >>>>> but I didn't know why. Wolfgang's answer told me. >>>>> _______________________________________________ >>>>> talk at x-query.com >>>>> http://x-query.com/mailman/listinfo/talk > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From ihe.onwuka at gmail.com Sat Jan 18 10:42:00 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sat, 18 Jan 2014 18:42:00 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: On Sat, Jan 18, 2014 at 6:35 PM, Joe Wicentowski wrote: > In fact, while I (of course) was expecting you to read > ....before you started answering a question that was never asked. From ihe.onwuka at gmail.com Sat Jan 18 11:14:23 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sat, 18 Jan 2014 19:14:23 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: Thou shalt take our solutions and be grateful for them. Whether you asked for or needed them or not because that is our default setting and we cannot parse anything posted here in any other way. Anything you say contrary to the specification may be taken as evidence of your hatred of the members of the XQuery Working Group and may be used against you on a or the mailing list. On Sat, Jan 18, 2014 at 6:47 PM, Andrew Welch wrote: > > He's being satirical. > > It's hard not to agree with his observations. > > On 18 Jan 2014 18:43, "Ihe Onwuka" wrote: >> >> On Sat, Jan 18, 2014 at 6:35 PM, Joe Wicentowski wrote: >> > In fact, while I (of course) was expecting you to read >> > >> >> ....before you started answering a question that was never asked. >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk From joewiz at gmail.com Sat Jan 18 11:17:03 2014 From: joewiz at gmail.com (Joe Wicentowski) Date: Sat, 18 Jan 2014 14:17:03 -0500 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: Finally, someone understands my pure, noble intentions! I aim to advance the state of the field through the following tactics: lob questions phrased so vaguely and researched so lightly that rational, compassionate people feel no choice but to respond lest they let me wallow in my very evident frustration and cluelessness. Then, when they provide their best answer, I reply even more belligerently. This pulls all the others into the discussion to sort out the mess. Rinse, lather, repeat. Eventually, through the mass of frustration, people start to piece together some vague sense of my original issue and acknowledge that there was some kernel of a point there. By that time I have moved on and don't care anymore, and tell everyone so. But look at what was accomplished. Field, advanced, suckers! Other people might have stepped back from their initial sense of frustration, researched the issue, and made a polite request for assistance or comment. But that's no fun. And it's not my style. And if you don't like it, go ahead, call me on it. You'll be sorry. Sent from my iPhone On Jan 18, 2014, at 1:39 PM, Christian Gr?n wrote: >> P-( ARRGH! This doesn't work either! )-d > > { ((: This ? ? ? ? ? works! :)) } > ________________________________ > >> On Sat, Jan 18, 2014 at 7:35 PM, Joe Wicentowski wrote: >> In fact, while I (of course) was expecting you to read my mind, I don't even think I know what I wanted in the first place. On second thought, maybe I did. How about if you read it again, and remind me what I said. I can't be bothered to re-read old messages. In the meantime I'll just keep adding more nonsense to each new email I write and make sure I get the last word. >> >> >> Sent from my iPhone >> >>> On Jan 18, 2014, at 1:26 PM, Joe Wicentowski wrote: >>> >>> I didn't ask for constructive suggestions. Read the original post. >>> >>> Sent from my iPhone >>> >>>> On Jan 18, 2014, at 1:13 PM, Ihe Onwuka wrote: >>>> >>>> If getting code, syntax, solutions and help with writing your program >>>> is your primary and sole objective I recommend StackOverflow.com. >>>> >>>> >>>> >>>>> On Sat, Jan 18, 2014 at 6:01 PM, Joe Wicentowski wrote: >>>>> I have a major bone to pick with the XQuery working group and all users of the language, who must all be insane. >>>>> >>>>> When I'm trying to write a program in XQuery and it isn't working, I need to blow off steam with a pissed off comment in the code right where the error message appears. So I write my comment: >>>>> >>>>>> :( XQuery makes no sense to me!!! ):< >>>>> >>>>> But this raises new errors! So I try a different comment syntax: >>>>> >>>>>> :^( GRRRR! )v:< >>>>> >>>>> And another error appears! >>>>> >>>>> Why doesn't XQuery understand my comments? Change it now or I will never cease to complain. >>>>> >>>>> Oh, and I'm not interested in code samples showing the correct syntax for comments or explanations about the origins of whatever crazy comment syntax they came up with. >>>>> >>>>> One final note to anyone who tries to be helpful: Shove it! >>>>> >>>>> Sent from my iPhone >>>>> >>>>>> On Jan 18, 2014, at 11:02 AM, Ihe Onwuka wrote: >>>>>> >>>>>> On Sat, Jan 18, 2014 at 1:57 PM, Adam Retter wrote: >>>>>>>>> You know full well that the design isn't going to be improved in a subsequent release unless there's an issue that's a real stopper, because people expect backwards compatibility. >>>>>>>> >>>>>>>> http://exist.2174344.n4.nabble.com/Signature-of-fn-filter-doesn-t-look-like-it-conforms-to-the-spec-td4662991.html >>>>>>> >>>>>>> I am not sure that this is making the point you think it is! >>>>>> >>>>>> It does. >>>>>> >>>>>>> snipped >>>>>> >>>>>> >>>>>>> >>>>>>> Anyway, I am sure you realise that you could write your own function >>>>>>> in XSLT, let's call it 'doc-or-empty' and use it in place of doc to >>>>>>> achieve exactly what you want. >>>>>> >>>>>> Yes and I have no intention of doing so. >>>>>> >>>>>> See the original post here. >>>>>> >>>>>> http://exist.2174344.n4.nabble.com/Why-does-it-think-the-variable-is-not-set-tc4663027.html#none >>>>>> >>>>>> I knew that parenthesising the return expression would fix the problem >>>>>> but I didn't know why. Wolfgang's answer told me. >>>>>> _______________________________________________ >>>>>> talk at x-query.com >>>>>> http://x-query.com/mailman/listinfo/talk >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk From ihe.onwuka at gmail.com Sat Jan 18 11:54:58 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sat, 18 Jan 2014 19:54:58 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: On Sat, Jan 18, 2014 at 7:17 PM, Joe Wicentowski wrote: > Finally, someone understands my pure, noble intentions! I aim to advance the state of the field through the following tactics: lob questions phrased so vaguely and researched so lightly that rational, compassionate people feel no choice but to respond lest they let me wallow in my very evident frustration and cluelessness. Then, when they provide their best answer, I reply even more belligerently. This pulls all the others into the discussion to sort out the mess. Rinse, lather, repeat. Eventually, through the mass of frustration, people start to piece together some vague sense of my original issue and acknowledge that there was some kernel of a point there. By that time I have moved on and don't care anymore, and tell everyone so. But look at what was accomplished. Field, advanced, suckers! > > Other people might have stepped back from their initial sense of frustration, researched the issue, and made a polite request for assistance or comment. But that's no fun. And it's not my style. And if you don't like it, go ahead, call me on it. You'll be sorry. > If you have already solved your problem you have no reason to be frustrated. The minute you give any sort of detail...... the fatal words in this thread were....... "Let me give a bit of background to the use case motivating the question." someone immediately launches in with code and then expects you to be grateful. So you feel obligated out of politeness and respect to respond and they continue feeding you code and examples and you just want to get back to your work because you already knew that an aggregated group by would get the result but you really want to know why putting things in different collections because they come from different places or have different schemas should mandate the destruction of other relationships that exist in the real world you are modelling. Because in the real world you wouldn't aggregate and group these things - you would simply say they came from the same person. And of course there isn't code to answer that so you either have to ignore the fellow feeding it to you or find some way of saying thats not what I am asking and the longer this situation persists it keeps you from getting on with what you are supposed to be doing and keeps the discussion from getting round to what you actually wanted to talk about. THATS THE POINT where frustration is liable to kick in because without fail on every thread that this happens there are people who get what is being asked straight away. From ihe.onwuka at gmail.com Sat Jan 18 12:12:10 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sat, 18 Jan 2014 20:12:10 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: On Sat, Jan 18, 2014 at 7:17 PM, Joe Wicentowski wrote: > Finally, someone understands my pure, noble intentions! I aim to advance the state of the field through the following tactics: lob questions phrased so vaguely and researched so lightly that rational, compassionate people feel no choice but to respond lest they let me wallow in my very evident frustration and cluelessness. Then, when they provide their best answer, I reply even more belligerently. This pulls all the others into the discussion to sort out the mess. Rinse, lather, repeat. Eventually, through the mass of frustration, people start to piece together some vague sense of my original issue and acknowledge that there was some kernel of a point there. By that time I have moved on and don't care anymore, and tell everyone so. But look at what was accomplished. Field, advanced, suckers! > > Other people might have stepped back from their initial sense of frustration, researched the issue, and made a polite request for assistance or comment. But that's no fun. And it's not my style. And if you don't like it, go ahead, call me on it. You'll be sorry. > Oh and lest I forget. Mock people who actually make an effort to read the specification, try to figure things out for themselves and don't just post demanding answers, simply because their needs do not meet the level of understanding required of a language implementer. Way to achieve critical mass. From adam.retter at googlemail.com Sat Jan 18 12:23:02 2014 From: adam.retter at googlemail.com (Adam Retter) Date: Sat, 18 Jan 2014 20:23:02 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: I do not think anyone has mocked you... until just a second ago. I think the XQuery community and this mailing list are friendly and helpful. I have been a part of it for 9 years now. Given the way that you phrase your enquiries, I also think they are incredibly patient and tolerant. I'm going to be honest. Your pushing the limits of what the majority find acceptable, and you are rubbing people up the wrong way, not just here but on other mailing lists too. May I suggest, that if you want to seek help from the community by posting to these mailing lists, then you will get a better response by being polite and considered. I know JoeW to be a very calm, knowledgeable, helpful and above all, nice person, but I fear you may have broken him. On 18 Jan 2014 20:12, "Ihe Onwuka" wrote: > On Sat, Jan 18, 2014 at 7:17 PM, Joe Wicentowski wrote: > > Finally, someone understands my pure, noble intentions! I aim to > advance the state of the field through the following tactics: lob questions > phrased so vaguely and researched so lightly that rational, compassionate > people feel no choice but to respond lest they let me wallow in my very > evident frustration and cluelessness. Then, when they provide their best > answer, I reply even more belligerently. This pulls all the others into > the discussion to sort out the mess. Rinse, lather, repeat. Eventually, > through the mass of frustration, people start to piece together some vague > sense of my original issue and acknowledge that there was some kernel of a > point there. By that time I have moved on and don't care anymore, and tell > everyone so. But look at what was accomplished. Field, advanced, suckers! > > > > Other people might have stepped back from their initial sense of > frustration, researched the issue, and made a polite request for assistance > or comment. But that's no fun. And it's not my style. And if you don't > like it, go ahead, call me on it. You'll be sorry. > > > > Oh and lest I forget. > > Mock people who actually make an effort to read the specification, try > to figure things out for themselves and don't just post demanding > answers, simply because their needs do not meet the level of > understanding required of a language implementer. > > Way to achieve critical mass. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihe.onwuka at gmail.com Sat Jan 18 13:40:55 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sat, 18 Jan 2014 21:40:55 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: On Sat, Jan 18, 2014 at 8:23 PM, Adam Retter wrote: > I do not think anyone has mocked you... until just a second ago. If I hadn't seen it happen to others I wouldn't have mentioned it. > I think the > XQuery community and this mailing list are friendly and helpful. I have been > a part of it for 9 years now. > Exactly. But hang on I never said the list wasn't friendly and helpful. I get offered code and solutions that I don't want or need and I've said why that gets frustrating. So why are you saying this? Because someone just mocked me and thats not friendly and helpful. Look I'm not bothered. It's like being told I have a shallow grasp of the fundamentals of Scrabble when the only reason I am playing it is because I have an eye for a member of the opposite sex who enjoys it. > Given the way that you phrase your enquiries, I also think they are > incredibly patient and tolerant. > > I'm going to be honest. Your pushing the limits of what the majority find > acceptable, and you are rubbing people up the wrong way, not just here but > on other mailing lists too. I'm going to be honest too. It's because of who I'm saying it to isn't it. Because if I said to a johnny come lately don't mock people who are making an effort to read the language specification and solve their own problems there would be a chorus of agreement. > May I suggest, that if you want to seek help > from the community by posting to these mailing lists, then you will get a > better response by being polite and considered. > Thank you but I always end up getting fantastic, helpful and knowledgeable responses to my questions. Always. > > I know JoeW to be a very calm, knowledgeable, helpful and above all, nice > person, but I fear you may have broken him. > Yeah I know and he's part of what you are part of and I'm not. I know how it works. I have seen this dynamic at play before on sibling lists and I am neither the first nor the only one to have made that observation. I am a regular visitor to DC Metro. Since my self-esteem is not aligned with the perception of my proficiency in XQuery nothing he has said here would act as a barrier to my desire to willingness to quaff a beer with the man. On the other hand Uche Ogbuji despite being a tribesman is a completely different matter. He is a Gooner. From joewiz at gmail.com Sat Jan 18 18:06:54 2014 From: joewiz at gmail.com (Joe Wicentowski) Date: Sat, 18 Jan 2014 21:06:54 -0500 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: In all seriousness now, my satire was meant to help us reflect on and acknowledge a pattern of abrasive interactions that has dominated this list as of late, to raise it for discussion if needed, and hopefully to bring it to a close by letting everyone see its absurdity. Discussion can be civil but productive, direct and even heated but respectful. When you start a topic, you bear a special responsibility to be comprehensive up front, to respect the time and effort everyone takes to respond in good faith, and to guide your thread to a productive, respectful close. Acknowledge failures in this responsibility readily. Neglect it at your own peril. Productive discussions, started and guided by responsible participants, has always been the norm on xquery-talk in the time I have been a member. I look forward to its return to that state. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihe.onwuka at gmail.com Sat Jan 18 19:28:42 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sun, 19 Jan 2014 03:28:42 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <3F006995-4488-4497-ACF8-8EA2597628CA@gmail.com> <055FAD1B-454F-4321-AEC8-898CBF9B567C@gmail.com> Message-ID: On Sun, Jan 19, 2014 at 2:06 AM, Joe Wicentowski wrote: > In all seriousness now, my satire was meant to help us reflect on and > acknowledge a pattern of abrasive interactions that has dominated this list > as of late, to raise it for discussion if needed, and hopefully to bring it > to a close by letting everyone see its absurdity. > > Discussion can be civil but productive, direct and even heated but > respectful. > > When you start a topic, you bear a special responsibility to be > comprehensive up front, to respect the time and effort everyone takes to > respond in good faith, and to guide your thread to a productive, respectful > close. Acknowledge failures in this responsibility readily. Neglect it at > your own peril. > > Productive discussions, started and guided by responsible participants, has > always been the norm on xquery-talk in the time I have been a member. I > look forward to its return to that state. > Sometimes people have a sense of humour that may not necessarily translate like .... of course I say nothing of the sort when raising it on eXist............. yeah I was thinking that but y'know how it is when you go in all guns blazing and claiming you've found a bug...... but now that you have emboldened my keyboard I'm thinking of a subject heading like t will be Bug. Fix it you b******ds. On Thu, Jan 2, 2014 at 9:18 AM, Joe Wicentowski wrote: I think you may have found a bug in eXist-db. Your code can be reduced to the following tests: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sometimes you need a sense of humour when your morning is dissipating in the face of a simple query that turns into a runaway task When the scheduler says terminating does that me............... or rather is it meant to stop saying terminating. On Tue, Jan 14, 2014 at 11:49 AM, Ihe Onwuka wrote: > So I killed it..... and the bastard is now taking an age to die. > > On Tue, Jan 14, 2014 at 11:31 AM, Ihe Onwuka wrote: >> Killing it would leave me with a half-updated database would it >> not,...... as long as it finishes. > ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- I found alot of things just in the course of doing stuff. That eXist doesn't let you do let after group by. That it doesn't support the count clause in 3.0, That there is something wrong with it's implementation of the position() function because it sometimes gives 0. That the order of it's arguments to HOF's are not spec-compliant and you think - yeah this stuff is not a problem for me because I've solved it, or you think I'm not going to use this thing ...say for example if position() doesn't give me the nth out of m then it doesn't do what it says on the tin and you don't want to use it Of course you could avoid being cast as a villain, by just doing your thing and keeping quiet. Sometimes my attitude is look there is something wrong here - I have moved on but I'm doing my bit for the community by reporting it. ________________________________________________________________________________________________________ It doesn't seem that you can pose a question here without somebody trying to force feed it into something that can be answered with code or reference to the spec. This thread is a prime but not sole example. The thread divides into 2 strands. Those that do the former and those that see the issue. You give the thing a title - Collections - Family relationships. Your original post says you are asking whether and why document elements are or are not siblings and somehow that gets parsed into - I don't know how to group these things and count them. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ and wobetide you if you ask why something is the way it is - because the spec says so, you don't know anything about the language, if you don't like it go off and write your own. From davidc at nag.co.uk Mon Jan 20 01:43:37 2014 From: davidc at nag.co.uk (David Carlisle) Date: Mon, 20 Jan 2014 09:43:37 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <52DCEFC9.8040109@nag.co.uk> On 18/01/2014 10:03, Ihe Onwuka wrote: > http://www.biglist.com/cgi-bin/wilma/wilma_hiliter/xsl-list at lists.mulberrytech.com/201212/msg00024.html?line=98#hilite > I also offered privately back then By "back then" do you mean 2012?? doc() is XPath 2 and the first draft of XPath 2 was 2001 and it was a Recommendation in 2007. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From ihe.onwuka at gmail.com Mon Jan 20 01:51:18 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 20 Jan 2014 09:51:18 +0000 Subject: [xquery-talk] Collections - family relationships In-Reply-To: <52DCEFC9.8040109@nag.co.uk> References: <2C8DA241-39C6-4B88-B66D-E21792B6391A@saxonica.com> <598CDD0D-D5B9-459F-9FF7-9377B0F8582F@saxonica.com> <0B2690A5-E6CE-4DDA-84CA-ACC329727DB8@saxonica.com> <52CAAB95.10201@safaribooksonline.com> <24fdc011bd004b4db432e1301c2f4dda@BY2PR08MB014.namprd08.prod.outlook.com> <52DCEFC9.8040109@nag.co.uk> Message-ID: Yes David 2012. I think the suggestion was to get involved in some ongoing standards effort so I offered. With respect to the subject matter of the thread, I currently data have relating to one person split across 7 collections - some of it is metadata, some of it relates to different types of products. The prospect of a 2nd data source with a different schema looms - so replicating the current design would mean splitting across 14 collections - so it's a concern - obviously one that can be overcome but a concern. On Mon, Jan 20, 2014 at 9:43 AM, David Carlisle wrote: > On 18/01/2014 10:03, Ihe Onwuka wrote: >> >> >> http://www.biglist.com/cgi-bin/wilma/wilma_hiliter/xsl-list at lists.mulberrytech.com/201212/msg00024.html?line=98#hilite >> I also offered privately back then > > > By "back then" do you mean 2012?? doc() is XPath 2 and the first draft of > XPath 2 was 2001 and it was a Recommendation in 2007. > > David > > > ________________________________________________________________________ > The Numerical Algorithms Group Ltd is a company registered in England > and Wales with company number 1249803. The registered office is: > Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. > > This e-mail has been scanned for all viruses by Star. The service is > powered by MessageLabs. > ________________________________________________________________________ From ihe.onwuka at gmail.com Wed Jan 22 08:12:50 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Wed, 22 Jan 2014 16:12:50 +0000 Subject: [xquery-talk] A Poor Man's XPROC Message-ID: Just sharing something I've used to get by with a bash shell transformation workflow. I have already been served a large portion of "Why don't you use XPROC/xmlsh" and the answer is because I didn't think of it at the outset. The two "tricks" here are process substitution - a means of piping one output into several subsequent steps and piping output direct to the shell for execution. I lay no claim to originality or shell expertise, it's just something that has worked for me and is worth sharing. Some of my terminology may also be off for the same reason but this works. Suppose we wish to parse some html - lets say amazon. We start out with a bog standard curl request piped into tagsoup to make it well formed. curl -s --request GET "www.amazon.com" | java -jar $HOME/tagsoup-1.2.1.jar --nons | this is where the fun starts tagsoup has given us some xhtml and we want a) save it b) parse it further so..... tee amazon.xhtml | java -jar $HOME/saxon9he.jar -s:- -xsl:createMetadata.xsl | tee the xhtml and passes it on to the next step which is our first transform to create some Metadata from amazon.xhtml. Now we want to pass this metadata on to 3 processes. 1. a transformation to create a metadata Header 2. a transformation to create a metadata Tail record. 3 then we wish to process the xhtml (a step which I will explain later). This is where the first use of process substitution kicks in. A quick note. You need to start your script with #!/bin/bash rather than #!/bin/sh to get this to work. We invoke process substitution by tee >(some process) >(some other process) etc. What this will do is take the input that was piped into tee and pass it on to other subprocesses in the workflow where the thing in brackets is what I call a subprocess. Note you need the > sign that precedes the brackets. So lets apply this to the output of the createMetadata stage tee >(java -jar $HOME/saxon9he.jar -s:- -xsl:metadataHeader.xsl | curl -s --request PUT etc) that stores the metadata header in the database, but we want the same input to go into the transform that creates the metadata Tail so...... >(java -jar $HOME/saxon9he.jar -s:- -xsl:metadataTail.xsl | curl -s --request PUT etc) and now we have a third use for the output of the createMetadata transform. We are going to generate the rest of the shell script to complete the workflow. What I did here was to write a transformation that produced bash shell code to do the rest of the work. The reason for doing so was to take advantage of the power of XSLT (or XQuery) to handle the conditional logic that would determine how the job would proceed. For example maybe a certain step is only to execute if a certain metadata element is present (or a certain XML file exists). Instead of testing for this and trying to introduce conditional logic into the bash script you could say use doc-available to check fro the file and then depending on the outcome generate the appropriate script code. To execute it all you need to do is pipe the output into bash. Here is the finally process substitution step. Recall we still have access to the output of the create metadata step. > (java -jar $HOME/saxon9he.jar -s:- -xsl:generateReviews.xsl | bash ) where generateReviews transforms the metadata to the appropriate bash shell script code and that gets executed by piping it into bash. Not claiming it is elegant or efficient - it is just something that has worked for me. Somebody may find it or bits of it useful or I may get told of a better way (xmlsh/Xproc excepted). From CMisztur at macleanfogg.com Thu Jan 23 05:25:55 2014 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Thu, 23 Jan 2014 13:25:55 +0000 Subject: [xquery-talk] A Poor Man's XPROC In-Reply-To: References: Message-ID: Thanks for this. I just noticed that an xproc module is now showing up in eXist's package manager and can work with calabash, which I want to try. Also, Stylus Studio has a great pipeline. -c > On Jan 22, 2014, at 10:16 AM, "Ihe Onwuka" wrote: > > Just sharing something I've used to get by with a bash shell > transformation workflow. I have already been served a large portion > of "Why don't you use XPROC/xmlsh" and the answer is because I didn't > think of it at the outset. > > The two "tricks" here are process substitution - a means of piping one > output into several subsequent steps and piping output direct to the > shell for execution. > I lay no claim to originality or shell expertise, it's just something > that has worked for me and is worth sharing. Some of my terminology > may also be off for the same reason but this works. > > Suppose we wish to parse some html - lets say amazon. We start out > with a bog standard curl request piped into tagsoup to make it well > formed. > > curl -s --request GET "www.amazon.com" | java -jar > $HOME/tagsoup-1.2.1.jar --nons | > > this is where the fun starts tagsoup has given us some xhtml and we > want a) save it b) parse it further so..... > > tee amazon.xhtml | java -jar $HOME/saxon9he.jar -s:- -xsl:createMetadata.xsl | > > tee the xhtml and passes it on to the next step which is our first > transform to create some Metadata from amazon.xhtml. Now we want to > pass this metadata on to 3 processes. > > 1. a transformation to create a metadata Header > 2. a transformation to create a metadata Tail record. > 3 then we wish to process the xhtml (a step which I will explain later). > > This is where the first use of process substitution kicks in. A quick > note. You need to start your script with #!/bin/bash rather than > #!/bin/sh to get this to work. > > We invoke process substitution by tee >(some process) >(some other > process) etc. What this will do is take the input that was piped into > tee and pass it on to other subprocesses in the workflow where the > thing in brackets is what I call a subprocess. Note you need the > > sign that precedes the brackets. So lets apply this to the output of > the createMetadata stage > > tee >(java -jar $HOME/saxon9he.jar -s:- -xsl:metadataHeader.xsl | curl > -s --request PUT etc) > > that stores the metadata header in the database, but we want the same > input to go into the transform that creates the metadata Tail so...... > >> (java -jar $HOME/saxon9he.jar -s:- -xsl:metadataTail.xsl | curl -s --request PUT etc) > > and now we have a third use for the output of the createMetadata > transform. We are going to generate the rest of the shell script to > complete the workflow. What I did here was to write a transformation > that produced bash shell code to do the rest of the work. The reason > for doing so was to take advantage of the power of XSLT (or XQuery) > to handle the conditional logic that would determine how the job would > proceed. For example maybe a certain step is only to execute if a > certain metadata element is present (or a certain XML file exists). > Instead of testing for this and trying to introduce conditional logic > into the bash script you could say use doc-available to check fro the > file and then depending on the outcome generate the appropriate script > code. To execute it all you need to do is pipe the output into bash. > Here is the finally process substitution step. Recall we still have > access to the output of the create metadata step. > >> (java -jar $HOME/saxon9he.jar -s:- -xsl:generateReviews.xsl | bash ) > > where generateReviews transforms the metadata to the appropriate bash > shell script code and that gets executed by piping it into bash. > > Not claiming it is elegant or efficient - it is just something that > has worked for me. Somebody may find it or bits of it useful or I may > get told of a better way (xmlsh/Xproc excepted). > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From ihe.onwuka at gmail.com Thu Jan 23 14:24:36 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Thu, 23 Jan 2014 22:24:36 +0000 Subject: [xquery-talk] A Poor Man's XPROC In-Reply-To: References: Message-ID: Cheers, Another useful factlet. the bash command true acts as a noop. Here is an example. Suppose your XML content contains pagination information i.e whether or not there are more pages is determined by the value of some node. So you can have the transform pipe a curl command to retrieve the next page to the bash shell if there are more pages or it can pipe true if there aren't and there is nothing else to do. On Thu, Jan 23, 2014 at 1:25 PM, Misztur, Chris wrote: > Thanks for this. > > I just noticed that an xproc module is now showing up in eXist's package manager and can work with calabash, which I want to try. > > Also, Stylus Studio has a great pipeline. > > -c > >> On Jan 22, 2014, at 10:16 AM, "Ihe Onwuka" wrote: >> >> Just sharing something I've used to get by with a bash shell >> transformation workflow. I have already been served a large portion >> of "Why don't you use XPROC/xmlsh" and the answer is because I didn't >> think of it at the outset. >> >> The two "tricks" here are process substitution - a means of piping one >> output into several subsequent steps and piping output direct to the >> shell for execution. >> I lay no claim to originality or shell expertise, it's just something >> that has worked for me and is worth sharing. Some of my terminology >> may also be off for the same reason but this works. >> >> Suppose we wish to parse some html - lets say amazon. We start out >> with a bog standard curl request piped into tagsoup to make it well >> formed. >> >> curl -s --request GET "www.amazon.com" | java -jar >> $HOME/tagsoup-1.2.1.jar --nons | >> >> this is where the fun starts tagsoup has given us some xhtml and we >> want a) save it b) parse it further so..... >> >> tee amazon.xhtml | java -jar $HOME/saxon9he.jar -s:- -xsl:createMetadata.xsl | >> >> tee the xhtml and passes it on to the next step which is our first >> transform to create some Metadata from amazon.xhtml. Now we want to >> pass this metadata on to 3 processes. >> >> 1. a transformation to create a metadata Header >> 2. a transformation to create a metadata Tail record. >> 3 then we wish to process the xhtml (a step which I will explain later). >> >> This is where the first use of process substitution kicks in. A quick >> note. You need to start your script with #!/bin/bash rather than >> #!/bin/sh to get this to work. >> >> We invoke process substitution by tee >(some process) >(some other >> process) etc. What this will do is take the input that was piped into >> tee and pass it on to other subprocesses in the workflow where the >> thing in brackets is what I call a subprocess. Note you need the > >> sign that precedes the brackets. So lets apply this to the output of >> the createMetadata stage >> >> tee >(java -jar $HOME/saxon9he.jar -s:- -xsl:metadataHeader.xsl | curl >> -s --request PUT etc) >> >> that stores the metadata header in the database, but we want the same >> input to go into the transform that creates the metadata Tail so...... >> >>> (java -jar $HOME/saxon9he.jar -s:- -xsl:metadataTail.xsl | curl -s --request PUT etc) >> >> and now we have a third use for the output of the createMetadata >> transform. We are going to generate the rest of the shell script to >> complete the workflow. What I did here was to write a transformation >> that produced bash shell code to do the rest of the work. The reason >> for doing so was to take advantage of the power of XSLT (or XQuery) >> to handle the conditional logic that would determine how the job would >> proceed. For example maybe a certain step is only to execute if a >> certain metadata element is present (or a certain XML file exists). >> Instead of testing for this and trying to introduce conditional logic >> into the bash script you could say use doc-available to check fro the >> file and then depending on the outcome generate the appropriate script >> code. To execute it all you need to do is pipe the output into bash. >> Here is the finally process substitution step. Recall we still have >> access to the output of the create metadata step. >> >>> (java -jar $HOME/saxon9he.jar -s:- -xsl:generateReviews.xsl | bash ) >> >> where generateReviews transforms the metadata to the appropriate bash >> shell script code and that gets executed by piping it into bash. >> >> Not claiming it is elegant or efficient - it is just something that >> has worked for me. Somebody may find it or bits of it useful or I may >> get told of a better way (xmlsh/Xproc excepted). >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > From ihe.onwuka at gmail.com Fri Jan 24 05:14:59 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Fri, 24 Jan 2014 13:14:59 +0000 Subject: [xquery-talk] Functional XPath commands Message-ID: So I have just written if (@firstpage eq 0) then floor($totalPagesDecimal) else ceiling($totalPagesDecimal) but how close would (floor,ceiling)[@firstpage + 1]($totalPagesDecimal) have been I'm guessing I would at least have to put some function invoking paraphenalia around the calls to floor and ceiling (hopefully not). From christian.gruen at gmail.com Fri Jan 24 05:26:24 2014 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Fri, 24 Jan 2014 14:26:24 +0100 Subject: [xquery-talk] Functional XPath commands In-Reply-To: References: Message-ID: > but how close would > (floor,ceiling)[@firstpage + 1]($totalPagesDecimal) have been Try this: (floor#1,ceiling#1)[@firstpage + 1]($totalPagesDecimal) From ihe.onwuka at gmail.com Fri Jan 24 05:43:19 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Fri, 24 Jan 2014 13:43:19 +0000 Subject: [xquery-talk] Functional XPath commands In-Reply-To: References: Message-ID: Then the right answer was very close........ no just joking. Thanks - nice that you don't have to do any unnecessary function wrapping. On Fri, Jan 24, 2014 at 1:26 PM, Christian Gr?n wrote: >> but how close would >> (floor,ceiling)[@firstpage + 1]($totalPagesDecimal) have been > > Try this: > > (floor#1,ceiling#1)[@firstpage + 1]($totalPagesDecimal) From ihe.onwuka at gmail.com Fri Jan 24 21:43:46 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sat, 25 Jan 2014 05:43:46 +0000 Subject: [xquery-talk] Everything is a sequence ...so .... Message-ID: ..are there any drawbacks to always using the general comparison form thisThing = ('thatThing') rather than thisThing eq 'thatThing' even when you know that you are dealing with a singleton sequence. I am guessing this may be an implementation dependent issue. From liam at w3.org Fri Jan 24 21:54:06 2014 From: liam at w3.org (Liam R E Quin) Date: Sat, 25 Jan 2014 00:54:06 -0500 Subject: [xquery-talk] Everything is a sequence ...so .... In-Reply-To: References: Message-ID: <1390629246.25340.71.camel@slave.barefootcomputing.com> On Sat, 2014-01-25 at 05:43 +0000, Ihe Onwuka wrote: > ..are there any drawbacks to always using the general comparison form > > thisThing = ('thatThing') > > rather than > > thisThing eq 'thatThing' > > even when you know that you are dealing with a singleton sequence. I find I can catch a lot of errors by using eq. I can conceive of an implementation in which eq is faster but I doubt by very much, you'd have to measure. I've often been quite surprised at relative speeds of things though. -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml From mike at saxonica.com Sat Jan 25 01:01:35 2014 From: mike at saxonica.com (Michael Kay) Date: Sat, 25 Jan 2014 09:01:35 +0000 Subject: [xquery-talk] Everything is a sequence ...so .... In-Reply-To: References: Message-ID: <9D9ED4E9-B16B-4E13-A5B1-E9E3CC380B21@saxonica.com> The eq operator is easier to optimize because the type conversions it does are much simpler (in particular, exploiting indexes is more difficult). However, because 90% of the time people use "=", optimizers are likely to work hard at it even though it's intrinsically more difficult. But getting into the habit of using "eq" is something I would recommend because of the better diagnostics when you get things wrong. Michael Kay Saxonica On 25 Jan 2014, at 05:43, Ihe Onwuka wrote: > ..are there any drawbacks to always using the general comparison form > > thisThing = ('thatThing') > > rather than > > thisThing eq 'thatThing' > > even when you know that you are dealing with a singleton sequence. > > I am guessing this may be an implementation dependent issue. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From andrew.j.welch at gmail.com Sat Jan 25 01:42:15 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Sat, 25 Jan 2014 09:42:15 +0000 Subject: [xquery-talk] Everything is a sequence ...so .... In-Reply-To: <9D9ED4E9-B16B-4E13-A5B1-E9E3CC380B21@saxonica.com> References: <9D9ED4E9-B16B-4E13-A5B1-E9E3CC380B21@saxonica.com> Message-ID: On 25 January 2014 09:01, Michael Kay wrote: > > The eq operator is easier to optimize because the type conversions it does are much simpler (in particular, exploiting indexes is more difficult). However, because 90% of the time people use "=", optimizers are likely to work hard at it even though it's intrinsically more difficult. > > But getting into the habit of using "eq" is something I would recommend because of the better diagnostics when you get things wrong. The problem I have with eq is the potential for this: (or maybe it's with xs:boolean) There is a thread here: http://markmail.org/thread/htioi45g53pswcv2 -- Andrew Welch http://andrewjwelch.com From ihe.onwuka at gmail.com Sat Jan 25 01:49:53 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sat, 25 Jan 2014 09:49:53 +0000 Subject: [xquery-talk] Everything is a sequence ...so .... In-Reply-To: <9D9ED4E9-B16B-4E13-A5B1-E9E3CC380B21@saxonica.com> References: <9D9ED4E9-B16B-4E13-A5B1-E9E3CC380B21@saxonica.com> Message-ID: On Sat, Jan 25, 2014 at 9:01 AM, Michael Kay wrote: > > The eq operator is easier to optimize because the type conversions it does are much simpler (in particular, exploiting indexes is more difficult). However, because 90% of the time people use "=", optimizers are likely to work hard at it even though it's intrinsically more difficult. > > But getting into the habit of using "eq" is something I would recommend because of the better diagnostics when you get things wrong. > I try, but you can stare an awful long time at someString eq ('stringA','stringB') and not realise what is wrong. Mentally we are not attuned to distinguishing eq from =. I wonder whether it would have been better if eq were = and = were =>, but then I guess you'd have to worry about how to deal with the other comparison operators as well. From liam at w3.org Sat Jan 25 01:58:47 2014 From: liam at w3.org (Liam R E Quin) Date: Sat, 25 Jan 2014 04:58:47 -0500 Subject: [xquery-talk] Everything is a sequence ...so .... In-Reply-To: References: <9D9ED4E9-B16B-4E13-A5B1-E9E3CC380B21@saxonica.com> Message-ID: <1390643927.25340.77.camel@slave.barefootcomputing.com> On Sat, 2014-01-25 at 09:49 +0000, Ihe Onwuka wrote: > you can stare an awful long time at > > someString eq ('stringA','stringB') > > and not realise what is wrong. I don't know, the message Single item expected, ("stringA", "strinB") found. seems a good hint... But I don't think of eq and = as being the same. > I wonder whether it would have been better if eq were = and = were > =>, but then I guess you'd have to worry about how to deal with the > other comparison operators as well. We had to be compatible with XPath 1 at least to that extent. After all, if we were not compatible the Web browsers would never move to XSLT 2... (hmm). -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml From dlee at calldei.com Sat Jan 25 06:23:40 2014 From: dlee at calldei.com (David Lee) Date: Sat, 25 Jan 2014 14:23:40 +0000 Subject: [xquery-talk] Everything is a sequence ...so .... In-Reply-To: <1390643927.25340.77.camel@slave.barefootcomputing.com> References: <9D9ED4E9-B16B-4E13-A5B1-E9E3CC380B21@saxonica.com> <1390643927.25340.77.camel@slave.barefootcomputing.com> Message-ID: <6e102f1f6c4a44d0a78be55c3ecf31eb@BY2PR08MB014.namprd08.prod.outlook.com> If I were writing the language over I would never have '=' do set intersections or whatever the math term for "some item on the left side set is also equal to some item on the right side set" Maybe something like operators "contains" or "has" or "oneof" or something ... but "=" ? That took me a long long long LONG time to get used to. of course now its way fun and I cant imagine it another way :) This one blows me too ... ( eq ) => TRUE !!!! Yes I know why ... now ... but that took me about a decade to notice. -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Liam R E Quin Sent: Saturday, January 25, 2014 4:59 AM To: ihe.onwuka at gmail.com Cc: talk at x-query.com Subject: Re: [xquery-talk] Everything is a sequence ...so .... On Sat, 2014-01-25 at 09:49 +0000, Ihe Onwuka wrote: > you can stare an awful long time at > > someString eq ('stringA','stringB') > > and not realise what is wrong. I don't know, the message Single item expected, ("stringA", "strinB") found. seems a good hint... But I don't think of eq and = as being the same. > I wonder whether it would have been better if eq were = and = were > =>, but then I guess you'd have to worry about how to deal with the > other comparison operators as well. We had to be compatible with XPath 1 at least to that extent. After all, if we were not compatible the Web browsers would never move to XSLT 2... (hmm). -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From liam at w3.org Sat Jan 25 20:39:34 2014 From: liam at w3.org (Liam R E Quin) Date: Sat, 25 Jan 2014 23:39:34 -0500 Subject: [xquery-talk] Everything is a sequence ...so .... In-Reply-To: <6e102f1f6c4a44d0a78be55c3ecf31eb@BY2PR08MB014.namprd08.prod.outlook.com> References: <9D9ED4E9-B16B-4E13-A5B1-E9E3CC380B21@saxonica.com> <1390643927.25340.77.camel@slave.barefootcomputing.com> <6e102f1f6c4a44d0a78be55c3ecf31eb@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <1390711174.25340.105.camel@slave.barefootcomputing.com> On Sat, 2014-01-25 at 14:23 +0000, David Lee wrote: > If I were writing the language over I would never have '=' do set > intersections or whatever the math term for > "some item on the left side set is also equal to some item on the > right side set" "implicit existential quantification". It's done because of multiple elements with the same name, and feels very natural in XPath, but not so natural in XQuery. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml From ihe.onwuka at gmail.com Sat Jan 25 21:53:06 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sun, 26 Jan 2014 05:53:06 +0000 Subject: [xquery-talk] Functional XPath commands In-Reply-To: References: Message-ID: and it came to pass that the innocuous looking conditional in the if statement demands that @firstpage is cast to xs:integer before it will work lest there be complaints of unTypedAtomic (or whatever it said) comparisons with xs:integer. What is the pourquoi of this. Why no type promotion (or is it downcasting) in effect here. What could be simpler than comparing to 0. Verily twas a tough spot, I went through every other conditional in the program first because it looked to me like the least likely suspect. On Fri, Jan 24, 2014 at 1:14 PM, Ihe Onwuka wrote: > So I have just written > > if (@firstpage eq 0) then floor($totalPagesDecimal) else > ceiling($totalPagesDecimal) > > but how close would > > (floor,ceiling)[@firstpage + 1]($totalPagesDecimal) have been > > I'm guessing I would at least have to put some function invoking > paraphenalia around the calls to floor and ceiling (hopefully not). From liam at w3.org Sat Jan 25 23:24:02 2014 From: liam at w3.org (Liam R E Quin) Date: Sun, 26 Jan 2014 02:24:02 -0500 Subject: [xquery-talk] Functional XPath commands In-Reply-To: References: Message-ID: <1390721042.25340.111.camel@slave.barefootcomputing.com> On Sun, 2014-01-26 at 05:53 +0000, Ihe Onwuka wrote: > > Verily twas a tough spot, I went through every other conditional in > the program first because it looked to me like the least likely > suspect. > > if (@firstpage eq 0) then floor($totalPagesDecimal) else > > ceiling($totalPagesDecimal) The XPath engine does not know that @firstpage is an integer - unless it's schema-aware and you supplied a schema, perhaps. if (@firstpage treat as xs:integer eq 0) might be one way round it. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml From msokolov at safaribooksonline.com Sun Jan 26 08:16:28 2014 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Sun, 26 Jan 2014 11:16:28 -0500 Subject: [xquery-talk] Functional XPath commands In-Reply-To: References: Message-ID: <52E534DC.4090009@safaribooksonline.com> If you're a big fan of implicit type casts, you might want to take a look at JavaScript. This movie https://www.destroyallsoftware.com/talks/wat has some pretty funny examples (see, eg [] + [], [] + {}, {} + {}, etc. -- none of them ends up being what you might expect). -Mike On 1/26/14 12:53 AM, Ihe Onwuka wrote: > and it came to pass that the innocuous looking conditional in the if > statement demands that @firstpage is cast to xs:integer before it will > work lest there be complaints of unTypedAtomic (or whatever it said) > comparisons with xs:integer. > > What is the pourquoi of this. Why no type promotion (or is it > downcasting) in effect here. What could be simpler than comparing to > 0. > > Verily twas a tough spot, I went through every other conditional in > the program first because it looked to me like the least likely > suspect. > > On Fri, Jan 24, 2014 at 1:14 PM, Ihe Onwuka wrote: >> So I have just written >> >> if (@firstpage eq 0) then floor($totalPagesDecimal) else >> ceiling($totalPagesDecimal) >> >> but how close would >> >> (floor,ceiling)[@firstpage + 1]($totalPagesDecimal) have been >> >> I'm guessing I would at least have to put some function invoking >> paraphenalia around the calls to floor and ceiling (hopefully not). > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From ihe.onwuka at gmail.com Sun Jan 26 10:31:21 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sun, 26 Jan 2014 18:31:21 +0000 Subject: [xquery-talk] Functional XPath commands In-Reply-To: <52E534DC.4090009@safaribooksonline.com> References: <52E534DC.4090009@safaribooksonline.com> Message-ID: No I'm a fan of type inference suffering from an XSLT hangover. On Sun, Jan 26, 2014 at 4:16 PM, Michael Sokolov wrote: > If you're a big fan of implicit type casts, you might want to take a look at > JavaScript. This movie https://www.destroyallsoftware.com/talks/wat has > some pretty funny examples (see, eg [] + [], [] + {}, {} + {}, etc. -- none > of them ends up being what you might expect). > > -Mike > > > On 1/26/14 12:53 AM, Ihe Onwuka wrote: >> >> and it came to pass that the innocuous looking conditional in the if >> statement demands that @firstpage is cast to xs:integer before it will >> work lest there be complaints of unTypedAtomic (or whatever it said) >> comparisons with xs:integer. >> >> What is the pourquoi of this. Why no type promotion (or is it >> downcasting) in effect here. What could be simpler than comparing to >> 0. >> >> Verily twas a tough spot, I went through every other conditional in >> the program first because it looked to me like the least likely >> suspect. >> >> On Fri, Jan 24, 2014 at 1:14 PM, Ihe Onwuka wrote: >>> >>> So I have just written >>> >>> if (@firstpage eq 0) then floor($totalPagesDecimal) else >>> ceiling($totalPagesDecimal) >>> >>> but how close would >>> >>> (floor,ceiling)[@firstpage + 1]($totalPagesDecimal) have been >>> >>> I'm guessing I would at least have to put some function invoking >>> paraphenalia around the calls to floor and ceiling (hopefully not). >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > From ihe.onwuka at gmail.com Mon Jan 27 03:46:37 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 27 Jan 2014 11:46:37 +0000 Subject: [xquery-talk] What does [.] do. Message-ID: As in ('','8')[.] What is it called and where is it documented From ihe.onwuka at gmail.com Mon Jan 27 03:49:46 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 27 Jan 2014 11:49:46 +0000 Subject: [xquery-talk] What does [.] do. In-Reply-To: References: Message-ID: I get it... it's a filter expression. Like it. On Mon, Jan 27, 2014 at 11:46 AM, Ihe Onwuka wrote: > As in ('','8')[.] > > What is it called and where is it documented From g at 28.io Mon Jan 27 05:59:04 2014 From: g at 28.io (Ghislain Fourny) Date: Mon, 27 Jan 2014 14:59:04 +0100 Subject: [xquery-talk] What does [.] do. In-Reply-To: References: Message-ID: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> Hi Ihe, You are right that it is a filter expression. However, I think [.] is not very common in "real world" code, except maybe for very precise use cases (like filtering out empty strings, etc). Usually you would put either a position or a boolean predicate inside a filter expression -- not just a context item expression. What [.] does, if I am not missing anything, is that it only keeps: 1. Numerics equal to their position in the left-hand-side sequence and 2. Non-numerics that have an Effective Boolean Value of true, like non-empty strings, nodes, the true boolean, etc. Example: (1, 2, 4, 3, 5, "", "foo", , true, false)[.] returns 1 (position matches) 2 (position matches) 5 (position matches) foo (EBV = true) (EBV = true) true (EBV = true) I hope it helps. Kind regards, Ghislain -- Dr. Ghislain Fourny Software Architect 28msec Inc. http://www.28.io/ http://twitter.com/28msec On 27 Jan 2014, at 12:46, Ihe Onwuka wrote: > As in ('','8')[.] > > What is it called and where is it documented > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From mike at saxonica.com Mon Jan 27 06:45:19 2014 From: mike at saxonica.com (Michael Kay) Date: Mon, 27 Jan 2014 14:45:19 +0000 Subject: [xquery-talk] What does [.] do. In-Reply-To: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> References: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> Message-ID: <8860FF79-9AD0-42D0-A2EE-1938E2DE7E11@saxonica.com> On 27 Jan 2014, at 13:59, Ghislain Fourny wrote: > Hi Ihe, > > You are right that it is a filter expression. > > However, I think [.] is not very common in "real world" code, except maybe for very precise use cases (like filtering out empty strings, etc). Usually you would put either a position or a boolean predicate inside a filter expression -- not just a context item expression. > > What [.] does, if I am not missing anything, is that it only keeps: > 1. Numerics equal to their position in the left-hand-side sequence > and > 2. Non-numerics that have an Effective Boolean Value of true, like non-empty strings, nodes, the true boolean, etc. > I mention on p648 of my XSLT /XPath book that the expression some $s in $S satisfies CONDITION is equivalent to exists(for $s in $S return boolean(CONDITION)[.]) though I don't suppose that really counts as a use case. I think the only case I've used in anger is probably count(tokenize($x, ' ')[.]) which eliminates the zero-length tokens that can arise at the start and/or end of the sequence. Michael Kay Saxonica From ihe.onwuka at gmail.com Mon Jan 27 06:55:16 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 27 Jan 2014 14:55:16 +0000 Subject: [xquery-talk] What does [.] do. In-Reply-To: <8860FF79-9AD0-42D0-A2EE-1938E2DE7E11@saxonica.com> References: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> <8860FF79-9AD0-42D0-A2EE-1938E2DE7E11@saxonica.com> Message-ID: I am using one transformation for two different data sources with two different schemas. One site may call a resoure readingMaterial another site may call the same concept a publication, but they are otherwise similar and you may want to treat them as such. (xs:string(readingMaterial),xs:string(publication))[.] when you know they are mutually exclusive in your document but you want to process them in the same way. On Mon, Jan 27, 2014 at 2:45 PM, Michael Kay wrote: > > On 27 Jan 2014, at 13:59, Ghislain Fourny wrote: > >> Hi Ihe, >> >> You are right that it is a filter expression. >> >> However, I think [.] is not very common in "real world" code, except maybe for very precise use cases (like filtering out empty strings, etc). Usually you would put either a position or a boolean predicate inside a filter expression -- not just a context item expression. >> >> What [.] does, if I am not missing anything, is that it only keeps: >> 1. Numerics equal to their position in the left-hand-side sequence >> and >> 2. Non-numerics that have an Effective Boolean Value of true, like non-empty strings, nodes, the true boolean, etc. >> > > I mention on p648 of my XSLT /XPath book that the expression > > some $s in $S satisfies CONDITION > > is equivalent to > > exists(for $s in $S return boolean(CONDITION)[.]) > > though I don't suppose that really counts as a use case. > > I think the only case I've used in anger is probably count(tokenize($x, ' ')[.]) which eliminates the zero-length tokens that can arise at the start and/or end of the sequence. > > Michael Kay > Saxonica > > From msokolov at safaribooksonline.com Mon Jan 27 07:04:38 2014 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Mon, 27 Jan 2014 10:04:38 -0500 Subject: [xquery-talk] What does [.] do. In-Reply-To: References: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> <8860FF79-9AD0-42D0-A2EE-1938E2DE7E11@saxonica.com> Message-ID: <52E67586.3080409@safaribooksonline.com> What I have usually seen in that case is: (xs:string(readingMaterial),xs:string(publication))[1] which allows for prioritization in case there are actually both for some unforeseen reason On 01/27/2014 09:55 AM, Ihe Onwuka wrote: > I am using one transformation for two different data sources with two > different schemas. > > One site may call a resoure readingMaterial another site may call the > same concept a publication, but they are otherwise similar and you may > want to treat them as such. > > (xs:string(readingMaterial),xs:string(publication))[.] > > when you know they are mutually exclusive in your document but you > want to process them in the same way. > > > > On Mon, Jan 27, 2014 at 2:45 PM, Michael Kay wrote: >> On 27 Jan 2014, at 13:59, Ghislain Fourny wrote: >> >>> Hi Ihe, >>> >>> You are right that it is a filter expression. >>> >>> However, I think [.] is not very common in "real world" code, except maybe for very precise use cases (like filtering out empty strings, etc). Usually you would put either a position or a boolean predicate inside a filter expression -- not just a context item expression. >>> >>> What [.] does, if I am not missing anything, is that it only keeps: >>> 1. Numerics equal to their position in the left-hand-side sequence >>> and >>> 2. Non-numerics that have an Effective Boolean Value of true, like non-empty strings, nodes, the true boolean, etc. >>> >> I mention on p648 of my XSLT /XPath book that the expression >> >> some $s in $S satisfies CONDITION >> >> is equivalent to >> >> exists(for $s in $S return boolean(CONDITION)[.]) >> >> though I don't suppose that really counts as a use case. >> >> I think the only case I've used in anger is probably count(tokenize($x, ' ')[.]) which eliminates the zero-length tokens that can arise at the start and/or end of the sequence. >> >> Michael Kay >> Saxonica >> >> > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From davidc at nag.co.uk Mon Jan 27 07:08:23 2014 From: davidc at nag.co.uk (David Carlisle) Date: Mon, 27 Jan 2014 15:08:23 +0000 Subject: [xquery-talk] What does [.] do. In-Reply-To: References: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> <8860FF79-9AD0-42D0-A2EE-1938E2DE7E11@saxonica.com> Message-ID: <52E67667.1030201@nag.co.uk> On 27/01/2014 14:55, Ihe Onwuka wrote: > I am using one transformation for two different data sources with two > different schemas. > > One site may call a resoure readingMaterial another site may call the > same concept a publication, but they are otherwise similar and you may > want to treat them as such. > > (xs:string(readingMaterial),xs:string(publication))[.] > I'd probably write that as (readingMaterial|publication)/string() or if you know that exactly one of them is always there string(readingMaterial|publication) David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From ihe.onwuka at gmail.com Mon Jan 27 07:14:53 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 27 Jan 2014 15:14:53 +0000 Subject: [xquery-talk] What does [.] do. In-Reply-To: <52E67667.1030201@nag.co.uk> References: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> <8860FF79-9AD0-42D0-A2EE-1938E2DE7E11@saxonica.com> <52E67667.1030201@nag.co.uk> Message-ID: On Mon, Jan 27, 2014 at 3:08 PM, David Carlisle wrote: > On 27/01/2014 14:55, Ihe Onwuka wrote: >> >> I am using one transformation for two different data sources with two >> different schemas. >> >> One site may call a resoure readingMaterial another site may call the >> same concept a publication, but they are otherwise similar and you may >> want to treat them as such. >> >> (xs:string(readingMaterial),xs:string(publication))[.] >> > > > > I'd probably write that as > > (readingMaterial|publication)/string() > > or if you know that exactly one of them is always there > > > > string(readingMaterial|publication) > I started with some variation of the union version (without the string) and was getting error messages. I can't remember what they were now and I've had to reboot my machine so can't go back and look. From dlee at calldei.com Mon Jan 27 07:14:39 2014 From: dlee at calldei.com (David Lee) Date: Mon, 27 Jan 2014 15:14:39 +0000 Subject: [xquery-talk] What does [.] do. In-Reply-To: <52E67667.1030201@nag.co.uk> References: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> <8860FF79-9AD0-42D0-A2EE-1938E2DE7E11@saxonica.com> <52E67667.1030201@nag.co.uk> Message-ID: I wouldnt do (readingMaterial|publication)/string() or (xs:string(readingMaterial),xs:string(publication))[.] unless you absolutely knew for sure that only 1 existed. If both exist you will get 2 strings. In the first place you get them in document order, in the second case in the order specified. I would do (xs:string(readingMaterial),xs:string(publication))[1] or just (readingMaterial,publication)[1]/string() which gives me readingMaterial if it exists, and if it doesnt exist then publication. but never both and always in the order of precidence I asked . On 27/01/2014 14:55, Ihe Onwuka wrote: > I am using one transformation for two different data sources with two > different schemas. > > One site may call a resoure readingMaterial another site may call the > same concept a publication, but they are otherwise similar and you may > want to treat them as such. > > (xs:string(readingMaterial),xs:string(publication))[.] > I'd probably write that as (readingMaterial|publication)/string() or if you know that exactly one of them is always there string(readingMaterial|publication) David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From davidc at nag.co.uk Mon Jan 27 07:18:16 2014 From: davidc at nag.co.uk (David Carlisle) Date: Mon, 27 Jan 2014 15:18:16 +0000 Subject: [xquery-talk] What does [.] do. In-Reply-To: References: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> <8860FF79-9AD0-42D0-A2EE-1938E2DE7E11@saxonica.com> <52E67667.1030201@nag.co.uk> Message-ID: <52E678B8.8070607@nag.co.uk> On 27/01/2014 15:14, David Lee wrote: > I wouldnt do > > (readingMaterial|publication)/string() > or > (xs:string(readingMaterial),xs:string(publication))[.] > > unless you absolutely knew for sure that only 1 existed. > If both exist you will get 2 strings. Yes sure, but same is true of the rather more opaque original (xs:string(readingMaterial),xs:string(publication))[.] I was trying to get same result (modulo , | change) :-) David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From ihe.onwuka at gmail.com Mon Jan 27 07:19:58 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 27 Jan 2014 15:19:58 +0000 Subject: [xquery-talk] What does [.] do. In-Reply-To: References: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> <8860FF79-9AD0-42D0-A2EE-1938E2DE7E11@saxonica.com> <52E67667.1030201@nag.co.uk> Message-ID: I don't have a preferred order of precedence and no they shouldn't both be there. So [1] is really saying get me the first string that is not the empty string or the first non-empty node? On Mon, Jan 27, 2014 at 3:14 PM, David Lee wrote: > I wouldnt do > > (readingMaterial|publication)/string() > or > (xs:string(readingMaterial),xs:string(publication))[.] > > unless you absolutely knew for sure that only 1 existed. > If both exist you will get 2 strings. > > In the first place you get them in document order, > in the second case in the order specified. > > I would do > > (xs:string(readingMaterial),xs:string(publication))[1] > or just > (readingMaterial,publication)[1]/string() > > > which gives me readingMaterial if it exists, and if it doesnt exist then publication. > but never both and always in the order of precidence I asked > > . > On 27/01/2014 14:55, Ihe Onwuka wrote: >> I am using one transformation for two different data sources with two >> different schemas. >> >> One site may call a resoure readingMaterial another site may call the >> same concept a publication, but they are otherwise similar and you may >> want to treat them as such. >> >> (xs:string(readingMaterial),xs:string(publication))[.] >> > > > > I'd probably write that as > > (readingMaterial|publication)/string() > > or if you know that exactly one of them is always there > > > > string(readingMaterial|publication) > > > David > > > ________________________________________________________________________ > The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: > Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. > > This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. > ________________________________________________________________________ > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From dlee at calldei.com Mon Jan 27 07:34:48 2014 From: dlee at calldei.com (David Lee) Date: Mon, 27 Jan 2014 15:34:48 +0000 Subject: [xquery-talk] What does [.] do. In-Reply-To: References: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> <8860FF79-9AD0-42D0-A2EE-1938E2DE7E11@saxonica.com> <52E67667.1030201@nag.co.uk> Message-ID: > I don't have a preferred order of precedence and no they shouldn't both be there. The key word is "shouldnt" ... minor code variants can turn that into "even if it ever happens the code wont break" Sometimes thats worth doing ... sometimes you WANT the code to break. > So [1] is really saying get me the first string that is not the empty string or the first non-empty node? Neither. It returns the string value of the first *existant* node. Consider this ( ,text)[1]/string() => "" Same with ( string(),string(text))[1] The string value of an empty node is "" not () Thus the above becomes ( "","text")[1] => "" If you want to skip over empty strings you need to get a bit more fancy -----Original Message----- From: Ihe Onwuka [mailto:ihe.onwuka at gmail.com] Sent: Monday, January 27, 2014 10:20 AM To: David Lee Cc: David Carlisle; talk at x-query.com Subject: Re: [xquery-talk] What does [.] do. I don't have a preferred order of precedence and no they shouldn't both be there. So [1] is really saying get me the first string that is not the empty string or the first non-empty node? On Mon, Jan 27, 2014 at 3:14 PM, David Lee wrote: > I wouldnt do > > (readingMaterial|publication)/string() > or > (xs:string(readingMaterial),xs:string(publication))[.] > > unless you absolutely knew for sure that only 1 existed. > If both exist you will get 2 strings. > > In the first place you get them in document order, in the second case > in the order specified. > > I would do > > (xs:string(readingMaterial),xs:string(publication))[1] > or just > (readingMaterial,publication)[1]/string() > > > which gives me readingMaterial if it exists, and if it doesnt exist then publication. > but never both and always in the order of precidence I asked > > . > On 27/01/2014 14:55, Ihe Onwuka wrote: >> I am using one transformation for two different data sources with two >> different schemas. >> >> One site may call a resoure readingMaterial another site may call the >> same concept a publication, but they are otherwise similar and you >> may want to treat them as such. >> >> (xs:string(readingMaterial),xs:string(publication))[.] >> > > > > I'd probably write that as > > (readingMaterial|publication)/string() > > or if you know that exactly one of them is always there > > > > string(readingMaterial|publication) > > > David > > > ______________________________________________________________________ > __ The Numerical Algorithms Group Ltd is a company registered in > England and Wales with company number 1249803. The registered office is: > Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. > > This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. > ______________________________________________________________________ > __ _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From ihe.onwuka at gmail.com Mon Jan 27 08:07:41 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 27 Jan 2014 16:07:41 +0000 Subject: [xquery-talk] What does [.] do. In-Reply-To: <52E678B8.8070607@nag.co.uk> References: <229FA6E3-A3C2-4CBE-9418-08F6051C5717@28.io> <8860FF79-9AD0-42D0-A2EE-1938E2DE7E11@saxonica.com> <52E67667.1030201@nag.co.uk> <52E678B8.8070607@nag.co.uk> Message-ID: Having given it a bit more than a moments thought I prefer [.] because it makes it explicit a filtering operation is going on . I think any opacity is consequent on the syntax - not the semantic . On Mon, Jan 27, 2014 at 3:18 PM, David Carlisle wrote: > On 27/01/2014 15:14, David Lee wrote: >> >> I wouldnt do >> >> (readingMaterial|publication)/string() >> or >> (xs:string(readingMaterial),xs:string(publication))[.] >> >> unless you absolutely knew for sure that only 1 existed. >> If both exist you will get 2 strings. > > > > Yes sure, but same is true of the rather more opaque original > (xs:string(readingMaterial),xs:string(publication))[.] > I was trying to get same result (modulo , | change) :-) > > > David > > > ________________________________________________________________________ > The Numerical Algorithms Group Ltd is a company registered in England > and Wales with company number 1249803. The registered office is: > Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. > > This e-mail has been scanned for all viruses by Star. The service is > powered by MessageLabs. > ________________________________________________________________________ From STAMMW at de.ibm.com Fri Jan 31 00:12:58 2014 From: STAMMW at de.ibm.com (Hermann Stamm-Wilbrandt) Date: Fri, 31 Jan 2014 09:12:58 +0100 Subject: [xquery-talk] Q: computed element and namespace Message-ID: >From (1): In XPath Version 2.0, the namespace axis is deprecated and need not be supported by a host language. A host language that does not support the namespace axis need not represent namespace bindings in the form of nodes. XQuery (eg. Zorba or DataPower) does not support the namespace axis. can be created by computed element constructors (2) by this: element {"a"}{ ( element {fn:QName("urn:u", "pre:b")}{}, element {fn:QName("urn:u", "pre:c")}{} ) } Is it true, that "equivalent" (not sure whether right term) XML cannot be created by computed element constructors in XQuery? It can be created by XSLT 1.0+EXSLT stylesheet: $ java -jar ~/Desktop/saxon6-5-5/saxon.jar dummy.xml compel.xsl ; echo $ $ cat compel.xsl $ (1) http://www.w3.org/TR/xpath20/#dt-in-scope-namespaces (2) http://www.w3.org/TR/xquery/#id-computedElements Mit besten Gruessen / Best wishes, Hermann Stamm-Wilbrandt Level 3 support for XML Compiler team and Fixpack team lead WebSphere DataPower SOA Appliances https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ https://twitter.com/HermannSW/ http://stamm-wilbrandt.de/GraphvizFiddle/ ---------------------------------------------------------------------- IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz Geschaeftsfuehrung: Dirk Wittkopp Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294 From mike at saxonica.com Fri Jan 31 00:51:50 2014 From: mike at saxonica.com (Michael Kay) Date: Fri, 31 Jan 2014 08:51:50 +0000 Subject: [xquery-talk] Q: computed element and namespace In-Reply-To: References: Message-ID: On 31 Jan 2014, at 08:12, Hermann Stamm-Wilbrandt wrote: > > From (1): > In XPath Version 2.0, the namespace axis is deprecated and need not be > supported by a host language. A host language that does not support the > namespace axis need not represent namespace bindings in the form of nodes. > > XQuery (eg. Zorba or DataPower) does not support the namespace axis. > > > > > can be created by computed element constructors (2) by this: > > element {"a"}{ > ( > element {fn:QName("urn:u", "pre:b")}{}, > element {fn:QName("urn:u", "pre:c")}{} > ) > } > > Is it true, that "equivalent" (not sure whether right term) XML > > > cannot be created by computed element constructors in XQuery? If we're talking about XQuery 1.0, then yes, I believe that there is no way you can create an element with a namespace that is (a) unused on that element, and (b) not known statically. (I might be wrong; I seem to recall David Carlisle coming up with a devious workaround, but it was so devious I don't recall how it works). Query 3.0 introduces dynamic namespace node constructors to solve this problem. This leaves the language in the rather absurd situation that there is a construct to create namespace nodes, but no construct to retrieve them. The XQuery WG was very reluctant to support the namespace axis because many vendors claimed that it was impossible to support it efficiently. Some of those vendors, when told to look at open source implementations like xt and Saxon that had efficient implementations, said that their company policy did not allow them to read open source code. Shame. Michael Kay Saxonica > > > It can be created by XSLT 1.0+EXSLT stylesheet: > > $ java -jar ~/Desktop/saxon6-5-5/saxon.jar dummy.xml compel.xsl ; echo > > $ > $ cat compel.xsl > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:exslt = "http://exslt.org/common" >> > > > > > > > > > > > > > > > > > > > > > > > $ > > > (1) http://www.w3.org/TR/xpath20/#dt-in-scope-namespaces > (2) http://www.w3.org/TR/xquery/#id-computedElements > > Mit besten Gruessen / Best wishes, > > Hermann Stamm-Wilbrandt > Level 3 support for XML Compiler team and Fixpack team lead > WebSphere DataPower SOA Appliances > https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ > https://twitter.com/HermannSW/ > http://stamm-wilbrandt.de/GraphvizFiddle/ > ---------------------------------------------------------------------- > IBM Deutschland Research & Development GmbH > Vorsitzende des Aufsichtsrats: Martina Koederitz > Geschaeftsfuehrung: Dirk Wittkopp > Sitz der Gesellschaft: Boeblingen > Registergericht: Amtsgericht Stuttgart, HRB 243294 > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From wcandillon at gmail.com Fri Jan 31 01:17:19 2014 From: wcandillon at gmail.com (William Candillon) Date: Fri, 31 Jan 2014 10:17:19 +0100 Subject: [xquery-talk] Q: computed element and namespace In-Reply-To: References: Message-ID: In XQuery 3.0 you could write the following: element {"a"}{ ( namespace pre { "urn:u" }, element {fn:QName("pre", "pre:b")}{}, element {fn:QName("pre", "pre:c")}{} ) } http://try.zorba.io/queries/xquery/OEkkPFKllu7moQ5l6eCBTQ1fiBY%3D On Fri, Jan 31, 2014 at 9:51 AM, Michael Kay wrote: > > On 31 Jan 2014, at 08:12, Hermann Stamm-Wilbrandt wrote: > >> >> From (1): >> In XPath Version 2.0, the namespace axis is deprecated and need not be >> supported by a host language. A host language that does not support the >> namespace axis need not represent namespace bindings in the form of nodes. >> >> XQuery (eg. Zorba or DataPower) does not support the namespace axis. >> >> >> >> >> can be created by computed element constructors (2) by this: >> >> element {"a"}{ >> ( >> element {fn:QName("urn:u", "pre:b")}{}, >> element {fn:QName("urn:u", "pre:c")}{} >> ) >> } >> >> Is it true, that "equivalent" (not sure whether right term) XML >> >> >> cannot be created by computed element constructors in XQuery? > > If we're talking about XQuery 1.0, then yes, I believe that there is no way you can create an element with a namespace that is (a) unused on that element, and (b) not known statically. > > (I might be wrong; I seem to recall David Carlisle coming up with a devious workaround, but it was so devious I don't recall how it works). > > Query 3.0 introduces dynamic namespace node constructors to solve this problem. This leaves the language in the rather absurd situation that there is a construct to create namespace nodes, but no construct to retrieve them. > > The XQuery WG was very reluctant to support the namespace axis because many vendors claimed that it was impossible to support it efficiently. Some of those vendors, when told to look at open source implementations like xt and Saxon that had efficient implementations, said that their company policy did not allow them to read open source code. Shame. > > Michael Kay > Saxonica > >> >> >> It can be created by XSLT 1.0+EXSLT stylesheet: >> >> $ java -jar ~/Desktop/saxon6-5-5/saxon.jar dummy.xml compel.xsl ; echo >> >> $ >> $ cat compel.xsl >> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >> xmlns:exslt = "http://exslt.org/common" >>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> $ >> >> >> (1) http://www.w3.org/TR/xpath20/#dt-in-scope-namespaces >> (2) http://www.w3.org/TR/xquery/#id-computedElements >> >> Mit besten Gruessen / Best wishes, >> >> Hermann Stamm-Wilbrandt >> Level 3 support for XML Compiler team and Fixpack team lead >> WebSphere DataPower SOA Appliances >> https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ >> https://twitter.com/HermannSW/ >> http://stamm-wilbrandt.de/GraphvizFiddle/ >> ---------------------------------------------------------------------- >> IBM Deutschland Research & Development GmbH >> Vorsitzende des Aufsichtsrats: Martina Koederitz >> Geschaeftsfuehrung: Dirk Wittkopp >> Sitz der Gesellschaft: Boeblingen >> Registergericht: Amtsgericht Stuttgart, HRB 243294 >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From wcandillon at gmail.com Fri Jan 31 01:21:27 2014 From: wcandillon at gmail.com (William Candillon) Date: Fri, 31 Jan 2014 10:21:27 +0100 Subject: [xquery-talk] function() inside of an element ? In-Reply-To: <184F8894-1B53-436A-A9C1-8542B18168A3@macleanfogg.com> References: <7AC1D93CF590E5458FCE12A130606357246DB923@us09exm01.MacLean-Fogg.com> <4CC0E08B-2673-4D52-B9FD-CC69797B82DA@macleanfogg.com> <4489ACD5-CA61-4511-8020-9AE4EA3F887E@macleanfogg.com> <9b0751d24dd845a8adf449ea531e705f@BY2PR08MB014.namprd08.prod.outlook.com> <184F8894-1B53-436A-A9C1-8542B18168A3@macleanfogg.com> Message-ID: Here's an example with a map extension (JSONiq in this instance): let $obj := { hello: function(){ "Hello World" } } return $obj.hello() http://try.zorba.io/queries/xquery/y5RSvf%2FQpvfNSvB%2Fep%2BE3H2hYcA%3D On Fri, Jan 31, 2014 at 12:23 AM, Misztur, Chris wrote: > Understood, thanks. > > On Jan 30, 2014, at 5:06 PM, "David Lee" wrote: > > yes to all that (except maps which are vendor specific) > > > > declare variable $a := function() { true() } ; > > .. > > > > return $a() > > > > let $x := ( 1 , $a , 2 ) > > return ($x[2])() > > > > but elements no ... sticking a function into an element atomizes the > function itself which is not allowed ... a sad state of affairs (unless you > want to serialize the XML as well XML ... then its great ) > > > > > > From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] > Sent: Thursday, January 30, 2014 5:26 PM > To: David Lee > Cc: talk at x-query.com > Subject: Re: [xquery-talk] function() inside of an element ? > > > > Err the last arguments should be variables. > > > On Jan 30, 2014, at 4:24 PM, "Misztur, Chris" > wrote: > > Better yet, is it possible to store a function in a map whose arguments are > known at runtime. In other words the functions arguments do not reference > any existing arguments at design time. > > > On Jan 30, 2014, at 4:11 PM, "David Lee" wrote: > > No. > > > > > > From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf > Of Misztur, Chris > Sent: Thursday, January 30, 2014 5:07 PM > To: talk at x-query.com > Subject: [xquery-talk] function() inside of an element ? > > > > Is it possible to call the function stored inside of $el? > > > > Let $el := element f { function() { true() } } > > > > > > ________________________________ > > > The contents of this message may be privileged and confidential. Therefore, > if this message has been received in error, please delete it without reading > it. Your receipt of this message is not intended to waive any applicable > privilege. Please do not disseminate this message without the permission of > the author. > > Please consider the environment before printing this e-mail > > > > ________________________________ > > > The contents of this message may be privileged and confidential. Therefore, > if this message has been received in error, please delete it without reading > it. Your receipt of this message is not intended to waive any applicable > privilege. Please do not disseminate this message without the permission of > the author. > > Please consider the environment before printing this e-mail > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > > > > ________________________________ > > > The contents of this message may be privileged and confidential. Therefore, > if this message has been received in error, please delete it without reading > it. Your receipt of this message is not intended to waive any applicable > privilege. Please do not disseminate this message without the permission of > the author. > > Please consider the environment before printing this e-mail > > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, > if this message has been received in error, please delete it without reading > it. Your receipt of this message is not intended to waive any applicable > privilege. Please do not disseminate this message without the permission of > the author. > > Please consider the environment before printing this e-mail > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From STAMMW at de.ibm.com Fri Jan 31 01:37:47 2014 From: STAMMW at de.ibm.com (Hermann Stamm-Wilbrandt) Date: Fri, 31 Jan 2014 10:37:47 +0100 Subject: [xquery-talk] JSONiq extensions to XQuery questions here? Message-ID: Hi, I just joined this email list yesterday after being on xsl-list and xml-dev for quite some years. Searching markmail [1] for JSONiq [0] seems not to result in much. I did find google groups JSONiq forum [2] last November. Because of the much bigger audience here the question is, whether this list is the right place for questions related to JSONiq extensions to XQuery? Currently search [1] on markmail returns 17 hits in com.x-query.talk. On the other hand quite some JSONiq question scripts [3] can be quickly turned into equivalent XQuery (in the browser) scripts [4] ... [0] http://www.jsoniq.org/ [1] http://markmail.org/search/?q=JSONiq [2] https://groups.google.com/forum/#!forum/jsoniq [3] https://groups.google.com/d/msg/jsoniq/_s4zgY_o0do/R2Bnsg9aqx8J [4] http://stamm-wilbrandt.de/xqib/ Mit besten Gruessen / Best wishes, Hermann Stamm-Wilbrandt Level 3 support for XML Compiler team and Fixpack team lead WebSphere DataPower SOA Appliances https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ https://twitter.com/HermannSW/ http://stamm-wilbrandt.de/GraphvizFiddle/ ---------------------------------------------------------------------- IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz Geschaeftsfuehrung: Dirk Wittkopp Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294 From STAMMW at de.ibm.com Fri Jan 31 01:41:53 2014 From: STAMMW at de.ibm.com (Hermann Stamm-Wilbrandt) Date: Fri, 31 Jan 2014 10:41:53 +0100 Subject: [xquery-talk] Q: computed element and namespace In-Reply-To: References: Message-ID: Thanks William! That does not return what was requested, but changing "pre" to "urn:u" two times does: http://try.zorba.io/queries/xquery/BwMzU0SPVdY9X7f5DO42g15Gt94%3D Mit besten Gruessen / Best wishes, Hermann Stamm-Wilbrandt Level 3 support for XML Compiler team and Fixpack team lead WebSphere DataPower SOA Appliances https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ https://twitter.com/HermannSW/ http://stamm-wilbrandt.de/GraphvizFiddle/ ---------------------------------------------------------------------- IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz Geschaeftsfuehrung: Dirk Wittkopp Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294 From: William Candillon To: Michael Kay , Cc: Hermann Stamm-Wilbrandt/Germany/IBM at IBMDE, "talk at x-query.com Talk" Date: 01/31/2014 10:17 AM Subject: Re: [xquery-talk] Q: computed element and namespace In XQuery 3.0 you could write the following: element {"a"}{ ( namespace pre { "urn:u" }, element {fn:QName("pre", "pre:b")}{}, element {fn:QName("pre", "pre:c")}{} ) } http://try.zorba.io/queries/xquery/OEkkPFKllu7moQ5l6eCBTQ1fiBY%3D On Fri, Jan 31, 2014 at 9:51 AM, Michael Kay wrote: > > On 31 Jan 2014, at 08:12, Hermann Stamm-Wilbrandt wrote: > >> >> From (1): >> In XPath Version 2.0, the namespace axis is deprecated and need not be >> supported by a host language. A host language that does not support the >> namespace axis need not represent namespace bindings in the form of nodes. >> >> XQuery (eg. Zorba or DataPower) does not support the namespace axis. >> >> >> >> >> can be created by computed element constructors (2) by this: >> >> element {"a"}{ >> ( >> element {fn:QName("urn:u", "pre:b")}{}, >> element {fn:QName("urn:u", "pre:c")}{} >> ) >> } >> >> Is it true, that "equivalent" (not sure whether right term) XML >> >> >> cannot be created by computed element constructors in XQuery? > > If we're talking about XQuery 1.0, then yes, I believe that there is no way you can create an element with a namespace that is (a) unused on that element, and (b) not known statically. > > (I might be wrong; I seem to recall David Carlisle coming up with a devious workaround, but it was so devious I don't recall how it works). > > Query 3.0 introduces dynamic namespace node constructors to solve this problem. This leaves the language in the rather absurd situation that there is a construct to create namespace nodes, but no construct to retrieve them. > > The XQuery WG was very reluctant to support the namespace axis because many vendors claimed that it was impossible to support it efficiently. Some of those vendors, when told to look at open source implementations like xt and Saxon that had efficient implementations, said that their company policy did not allow them to read open source code. Shame. > > Michael Kay > Saxonica > >> >> >> It can be created by XSLT 1.0+EXSLT stylesheet: >> >> $ java -jar ~/Desktop/saxon6-5-5/saxon.jar dummy.xml compel.xsl ; echo >> >> $ >> $ cat compel.xsl >> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >> xmlns:exslt = "http://exslt.org/common" >>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> $ >> >> >> (1) http://www.w3.org/TR/xpath20/#dt-in-scope-namespaces >> (2) http://www.w3.org/TR/xquery/#id-computedElements >> >> Mit besten Gruessen / Best wishes, >> >> Hermann Stamm-Wilbrandt >> Level 3 support for XML Compiler team and Fixpack team lead >> WebSphere DataPower SOA Appliances >> https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ >> https://twitter.com/HermannSW/ >> http://stamm-wilbrandt.de/GraphvizFiddle/ >> ---------------------------------------------------------------------- >> IBM Deutschland Research & Development GmbH >> Vorsitzende des Aufsichtsrats: Martina Koederitz >> Geschaeftsfuehrung: Dirk Wittkopp >> Sitz der Gesellschaft: Boeblingen >> Registergericht: Amtsgericht Stuttgart, HRB 243294 >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From wcandillon at gmail.com Fri Jan 31 01:43:31 2014 From: wcandillon at gmail.com (William Candillon) Date: Fri, 31 Jan 2014 10:43:31 +0100 Subject: [xquery-talk] Q: computed element and namespace In-Reply-To: References: Message-ID: Oups indeed, thank you! On Fri, Jan 31, 2014 at 10:41 AM, Hermann Stamm-Wilbrandt wrote: > Thanks William! > That does not return what was requested, but changing "pre" to "urn:u" two > times does: > http://try.zorba.io/queries/xquery/BwMzU0SPVdY9X7f5DO42g15Gt94%3D > > > Mit besten Gruessen / Best wishes, > > Hermann Stamm-Wilbrandt > Level 3 support for XML Compiler team and Fixpack team lead > WebSphere DataPower SOA Appliances > https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ > https://twitter.com/HermannSW/ > http://stamm-wilbrandt.de/GraphvizFiddle/ > ---------------------------------------------------------------------- > IBM Deutschland Research & Development GmbH > Vorsitzende des Aufsichtsrats: Martina Koederitz > Geschaeftsfuehrung: Dirk Wittkopp > Sitz der Gesellschaft: Boeblingen > Registergericht: Amtsgericht Stuttgart, HRB 243294 > > > > From: William Candillon > > To: Michael Kay , > > Cc: Hermann Stamm-Wilbrandt/Germany/IBM at IBMDE, "talk at x-query.com Talk" > > Date: 01/31/2014 10:17 AM > > Subject: Re: [xquery-talk] Q: computed element and namespace > > > > > > > In XQuery 3.0 you could write the following: > element {"a"}{ > ( > namespace pre { "urn:u" }, > element {fn:QName("pre", "pre:b")}{}, > element {fn:QName("pre", "pre:c")}{} > ) > } > http://try.zorba.io/queries/xquery/OEkkPFKllu7moQ5l6eCBTQ1fiBY%3D > > On Fri, Jan 31, 2014 at 9:51 AM, Michael Kay wrote: >> >> On 31 Jan 2014, at 08:12, Hermann Stamm-Wilbrandt > wrote: >> >>> >>> From (1): >>> In XPath Version 2.0, the namespace axis is deprecated and need not be >>> supported by a host language. A host language that does not support the >>> namespace axis need not represent namespace bindings in the form of > nodes. >>> >>> XQuery (eg. Zorba or DataPower) does not support the namespace axis. >>> >>> >>> >>> >>> can be created by computed element constructors (2) by this: >>> >>> element {"a"}{ >>> ( >>> element {fn:QName("urn:u", "pre:b")}{}, >>> element {fn:QName("urn:u", "pre:c")}{} >>> ) >>> } >>> >>> Is it true, that "equivalent" (not sure whether right term) XML >>> >>> >>> cannot be created by computed element constructors in XQuery? >> >> If we're talking about XQuery 1.0, then yes, I believe that there is no > way you can create an element with a namespace that is (a) unused on that > element, and (b) not known statically. >> >> (I might be wrong; I seem to recall David Carlisle coming up with a > devious workaround, but it was so devious I don't recall how it works). >> >> Query 3.0 introduces dynamic namespace node constructors to solve this > problem. This leaves the language in the rather absurd situation that there > is a construct to create namespace nodes, but no construct to retrieve > them. >> >> The XQuery WG was very reluctant to support the namespace axis because > many vendors claimed that it was impossible to support it efficiently. Some > of those vendors, when told to look at open source implementations like xt > and Saxon that had efficient implementations, said that their company > policy did not allow them to read open source code. Shame. >> >> Michael Kay >> Saxonica >> >>> >>> >>> It can be created by XSLT 1.0+EXSLT stylesheet: >>> >>> $ java -jar ~/Desktop/saxon6-5-5/saxon.jar dummy.xml compel.xsl ; echo >>> >>> $ >>> $ cat compel.xsl >>> >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >>> xmlns:exslt = "http://exslt.org/common" >>>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> $ >>> >>> >>> (1) http://www.w3.org/TR/xpath20/#dt-in-scope-namespaces >>> (2) http://www.w3.org/TR/xquery/#id-computedElements >>> >>> Mit besten Gruessen / Best wishes, >>> >>> Hermann Stamm-Wilbrandt >>> Level 3 support for XML Compiler team and Fixpack team lead >>> WebSphere DataPower SOA Appliances >>> https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ >>> https://twitter.com/HermannSW/ >>> http://stamm-wilbrandt.de/GraphvizFiddle/ >>> ---------------------------------------------------------------------- >>> IBM Deutschland Research & Development GmbH >>> Vorsitzende des Aufsichtsrats: Martina Koederitz >>> Geschaeftsfuehrung: Dirk Wittkopp >>> Sitz der Gesellschaft: Boeblingen >>> Registergericht: Amtsgericht Stuttgart, HRB 243294 >>> >>> _______________________________________________ >>> talk at x-query.com >>> http://x-query.com/mailman/listinfo/talk >> >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > From ihe.onwuka at gmail.com Fri Jan 31 01:46:51 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Fri, 31 Jan 2014 09:46:51 +0000 Subject: [xquery-talk] JSONiq extensions to XQuery questions here? In-Reply-To: References: Message-ID: the zorba list? https://groups.google.com/forum/#!forum/zorba-users On Fri, Jan 31, 2014 at 9:37 AM, Hermann Stamm-Wilbrandt wrote: > > Hi, > > I just joined this email list yesterday after being on xsl-list and > xml-dev for quite some years. > > Searching markmail [1] for JSONiq [0] seems not to result in much. > I did find google groups JSONiq forum [2] last November. > > Because of the much bigger audience here the question is, whether this list > is the right place for questions related to JSONiq extensions to XQuery? > > > Currently search [1] on markmail returns 17 hits in com.x-query.talk. > > On the other hand quite some JSONiq question scripts [3] can be quickly > turned into equivalent XQuery (in the browser) scripts [4] ... > > > [0] http://www.jsoniq.org/ > [1] http://markmail.org/search/?q=JSONiq > [2] https://groups.google.com/forum/#!forum/jsoniq > [3] https://groups.google.com/d/msg/jsoniq/_s4zgY_o0do/R2Bnsg9aqx8J > [4] http://stamm-wilbrandt.de/xqib/ > > > Mit besten Gruessen / Best wishes, > > Hermann Stamm-Wilbrandt > Level 3 support for XML Compiler team and Fixpack team lead > WebSphere DataPower SOA Appliances > https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ > https://twitter.com/HermannSW/ > http://stamm-wilbrandt.de/GraphvizFiddle/ > ---------------------------------------------------------------------- > IBM Deutschland Research & Development GmbH > Vorsitzende des Aufsichtsrats: Martina Koederitz > Geschaeftsfuehrung: Dirk Wittkopp > Sitz der Gesellschaft: Boeblingen > Registergericht: Amtsgericht Stuttgart, HRB 243294 > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From STAMMW at de.ibm.com Fri Jan 31 02:14:35 2014 From: STAMMW at de.ibm.com (Hermann Stamm-Wilbrandt) Date: Fri, 31 Jan 2014 11:14:35 +0100 Subject: [xquery-talk] JSONiq extensions to XQuery questions here? In-Reply-To: References: Message-ID: That is what I thought first, too. But I have been told that zorba list is open for zorba developers only. And there are 4 JSONiq processors (including DataPower), see "Implementations" tab on http://www.jsoniq.org/ Mit besten Gruessen / Best wishes, Hermann Stamm-Wilbrandt Level 3 support for XML Compiler team and Fixpack team lead WebSphere DataPower SOA Appliances https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ https://twitter.com/HermannSW/ http://stamm-wilbrandt.de/GraphvizFiddle/ ---------------------------------------------------------------------- IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz Geschaeftsfuehrung: Dirk Wittkopp Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294 From: Ihe Onwuka To: Hermann Stamm-Wilbrandt/Germany/IBM at IBMDE, Cc: "talk at x-query.com" Date: 01/31/2014 10:46 AM Subject: Re: [xquery-talk] JSONiq extensions to XQuery questions here? the zorba list? https://groups.google.com/forum/#!forum/zorba-users On Fri, Jan 31, 2014 at 9:37 AM, Hermann Stamm-Wilbrandt wrote: > > Hi, > > I just joined this email list yesterday after being on xsl-list and > xml-dev for quite some years. > > Searching markmail [1] for JSONiq [0] seems not to result in much. > I did find google groups JSONiq forum [2] last November. > > Because of the much bigger audience here the question is, whether this list > is the right place for questions related to JSONiq extensions to XQuery? > > > Currently search [1] on markmail returns 17 hits in com.x-query.talk. > > On the other hand quite some JSONiq question scripts [3] can be quickly > turned into equivalent XQuery (in the browser) scripts [4] ... > > > [0] http://www.jsoniq.org/ > [1] http://markmail.org/search/?q=JSONiq > [2] https://groups.google.com/forum/#!forum/jsoniq > [3] https://groups.google.com/d/msg/jsoniq/_s4zgY_o0do/R2Bnsg9aqx8J > [4] http://stamm-wilbrandt.de/xqib/ > > > Mit besten Gruessen / Best wishes, > > Hermann Stamm-Wilbrandt > Level 3 support for XML Compiler team and Fixpack team lead > WebSphere DataPower SOA Appliances > https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ > https://twitter.com/HermannSW/ > http://stamm-wilbrandt.de/GraphvizFiddle/ > ---------------------------------------------------------------------- > IBM Deutschland Research & Development GmbH > Vorsitzende des Aufsichtsrats: Martina Koederitz > Geschaeftsfuehrung: Dirk Wittkopp > Sitz der Gesellschaft: Boeblingen > Registergericht: Amtsgericht Stuttgart, HRB 243294 > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From ihe.onwuka at gmail.com Fri Jan 31 02:28:08 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Fri, 31 Jan 2014 10:28:08 +0000 Subject: [xquery-talk] JSONiq extensions to XQuery questions here? In-Reply-To: References: Message-ID: I've had a question there answered. On Fri, Jan 31, 2014 at 10:14 AM, Hermann Stamm-Wilbrandt wrote: > That is what I thought first, too. > But I have been told that zorba list is open for zorba developers only. > > And there are 4 JSONiq processors (including DataPower), > see "Implementations" tab on http://www.jsoniq.org/ > > > Mit besten Gruessen / Best wishes, > > Hermann Stamm-Wilbrandt > Level 3 support for XML Compiler team and Fixpack team lead > WebSphere DataPower SOA Appliances > https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ > https://twitter.com/HermannSW/ > http://stamm-wilbrandt.de/GraphvizFiddle/ > ---------------------------------------------------------------------- > IBM Deutschland Research & Development GmbH > Vorsitzende des Aufsichtsrats: Martina Koederitz > Geschaeftsfuehrung: Dirk Wittkopp > Sitz der Gesellschaft: Boeblingen > Registergericht: Amtsgericht Stuttgart, HRB 243294 > > > > From: Ihe Onwuka > > To: Hermann Stamm-Wilbrandt/Germany/IBM at IBMDE, > > Cc: "talk at x-query.com" > > Date: 01/31/2014 10:46 AM > > Subject: Re: [xquery-talk] JSONiq extensions to XQuery questions here? > > > > > > > the zorba list? > > https://groups.google.com/forum/#!forum/zorba-users > > On Fri, Jan 31, 2014 at 9:37 AM, Hermann Stamm-Wilbrandt > wrote: >> >> Hi, >> >> I just joined this email list yesterday after being on xsl-list and >> xml-dev for quite some years. >> >> Searching markmail [1] for JSONiq [0] seems not to result in much. >> I did find google groups JSONiq forum [2] last November. >> >> Because of the much bigger audience here the question is, whether this > list >> is the right place for questions related to JSONiq extensions to XQuery? >> >> >> Currently search [1] on markmail returns 17 hits in com.x-query.talk. >> >> On the other hand quite some JSONiq question scripts [3] can be quickly >> turned into equivalent XQuery (in the browser) scripts [4] ... >> >> >> [0] http://www.jsoniq.org/ >> [1] http://markmail.org/search/?q=JSONiq >> [2] https://groups.google.com/forum/#!forum/jsoniq >> [3] https://groups.google.com/d/msg/jsoniq/_s4zgY_o0do/R2Bnsg9aqx8J >> [4] http://stamm-wilbrandt.de/xqib/ >> >> >> Mit besten Gruessen / Best wishes, >> >> Hermann Stamm-Wilbrandt >> Level 3 support for XML Compiler team and Fixpack team lead >> WebSphere DataPower SOA Appliances >> https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ >> https://twitter.com/HermannSW/ >> http://stamm-wilbrandt.de/GraphvizFiddle/ >> ---------------------------------------------------------------------- >> IBM Deutschland Research & Development GmbH >> Vorsitzende des Aufsichtsrats: Martina Koederitz >> Geschaeftsfuehrung: Dirk Wittkopp >> Sitz der Gesellschaft: Boeblingen >> Registergericht: Amtsgericht Stuttgart, HRB 243294 >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > > > From g at 28.io Fri Jan 31 02:37:13 2014 From: g at 28.io (Ghislain Fourny) Date: Fri, 31 Jan 2014 11:37:13 +0100 Subject: [xquery-talk] JSONiq extensions to XQuery questions here? In-Reply-To: References: Message-ID: <4E12F2A1-6AF5-4B74-AF54-684A96AEB435@28.io> Hi Hermann, Ihe, The zorba-users list is open to everybody who has questions about Zorba. We have a separate list for developers. I hope this helps. Kind regards, Ghislain -- Dr. Ghislain Fourny Software Architect 28msec Inc. http://www.28.io/ http://twitter.com/28msec On 31 Jan 2014, at 11:28, Ihe Onwuka wrote: > I've had a question there answered. > > On Fri, Jan 31, 2014 at 10:14 AM, Hermann Stamm-Wilbrandt > wrote: >> That is what I thought first, too. >> But I have been told that zorba list is open for zorba developers only. >> >> And there are 4 JSONiq processors (including DataPower), >> see "Implementations" tab on http://www.jsoniq.org/ >> >> >> Mit besten Gruessen / Best wishes, >> >> Hermann Stamm-Wilbrandt >> Level 3 support for XML Compiler team and Fixpack team lead >> WebSphere DataPower SOA Appliances >> https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ >> https://twitter.com/HermannSW/ >> http://stamm-wilbrandt.de/GraphvizFiddle/ >> ---------------------------------------------------------------------- >> IBM Deutschland Research & Development GmbH >> Vorsitzende des Aufsichtsrats: Martina Koederitz >> Geschaeftsfuehrung: Dirk Wittkopp >> Sitz der Gesellschaft: Boeblingen >> Registergericht: Amtsgericht Stuttgart, HRB 243294 >> >> >> >> From: Ihe Onwuka >> >> To: Hermann Stamm-Wilbrandt/Germany/IBM at IBMDE, >> >> Cc: "talk at x-query.com" >> >> Date: 01/31/2014 10:46 AM >> >> Subject: Re: [xquery-talk] JSONiq extensions to XQuery questions here? >> >> >> >> >> >> >> the zorba list? >> >> https://groups.google.com/forum/#!forum/zorba-users >> >> On Fri, Jan 31, 2014 at 9:37 AM, Hermann Stamm-Wilbrandt >> wrote: >>> >>> Hi, >>> >>> I just joined this email list yesterday after being on xsl-list and >>> xml-dev for quite some years. >>> >>> Searching markmail [1] for JSONiq [0] seems not to result in much. >>> I did find google groups JSONiq forum [2] last November. >>> >>> Because of the much bigger audience here the question is, whether this >> list >>> is the right place for questions related to JSONiq extensions to XQuery? >>> >>> >>> Currently search [1] on markmail returns 17 hits in com.x-query.talk. >>> >>> On the other hand quite some JSONiq question scripts [3] can be quickly >>> turned into equivalent XQuery (in the browser) scripts [4] ... >>> >>> >>> [0] http://www.jsoniq.org/ >>> [1] http://markmail.org/search/?q=JSONiq >>> [2] https://groups.google.com/forum/#!forum/jsoniq >>> [3] https://groups.google.com/d/msg/jsoniq/_s4zgY_o0do/R2Bnsg9aqx8J >>> [4] http://stamm-wilbrandt.de/xqib/ >>> >>> >>> Mit besten Gruessen / Best wishes, >>> >>> Hermann Stamm-Wilbrandt >>> Level 3 support for XML Compiler team and Fixpack team lead >>> WebSphere DataPower SOA Appliances >>> https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ >>> https://twitter.com/HermannSW/ >>> http://stamm-wilbrandt.de/GraphvizFiddle/ >>> ---------------------------------------------------------------------- >>> IBM Deutschland Research & Development GmbH >>> Vorsitzende des Aufsichtsrats: Martina Koederitz >>> Geschaeftsfuehrung: Dirk Wittkopp >>> Sitz der Gesellschaft: Boeblingen >>> Registergericht: Amtsgericht Stuttgart, HRB 243294 >>> >>> _______________________________________________ >>> talk at x-query.com >>> http://x-query.com/mailman/listinfo/talk >> >> >> >> > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From CMisztur at macleanfogg.com Fri Jan 31 15:11:32 2014 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Fri, 31 Jan 2014 23:11:32 +0000 Subject: [xquery-talk] function() inside of an element ? In-Reply-To: References: <7AC1D93CF590E5458FCE12A130606357246DB923@us09exm01.MacLean-Fogg.com> <4CC0E08B-2673-4D52-B9FD-CC69797B82DA@macleanfogg.com> <4489ACD5-CA61-4511-8020-9AE4EA3F887E@macleanfogg.com> <9b0751d24dd845a8adf449ea531e705f@BY2PR08MB014.namprd08.prod.outlook.com> <184F8894-1B53-436A-A9C1-8542B18168A3@macleanfogg.com>, Message-ID: <26D51DCD-38C0-4A6F-B14E-AF69701073E5@macleanfogg.com> Can the anonymous function take an arbitrary parameter? > On Jan 31, 2014, at 3:21 AM, "William Candillon" wrote: > > Here's an example with a map extension (JSONiq in this instance): > let $obj := { > hello: function(){ > "Hello World" > } > } > return $obj.hello() > > http://try.zorba.io/queries/xquery/y5RSvf%2FQpvfNSvB%2Fep%2BE3H2hYcA%3D > > > On Fri, Jan 31, 2014 at 12:23 AM, Misztur, Chris > wrote: >> Understood, thanks. >> >> On Jan 30, 2014, at 5:06 PM, "David Lee" wrote: >> >> yes to all that (except maps which are vendor specific) >> >> >> >> declare variable $a := function() { true() } ; >> >> .. >> >> >> >> return $a() >> >> >> >> let $x := ( 1 , $a , 2 ) >> >> return ($x[2])() >> >> >> >> but elements no ... sticking a function into an element atomizes the >> function itself which is not allowed ... a sad state of affairs (unless you >> want to serialize the XML as well XML ... then its great ) >> >> >> >> >> >> From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] >> Sent: Thursday, January 30, 2014 5:26 PM >> To: David Lee >> Cc: talk at x-query.com >> Subject: Re: [xquery-talk] function() inside of an element ? >> >> >> >> Err the last arguments should be variables. >> >> >> On Jan 30, 2014, at 4:24 PM, "Misztur, Chris" >> wrote: >> >> Better yet, is it possible to store a function in a map whose arguments are >> known at runtime. In other words the functions arguments do not reference >> any existing arguments at design time. >> >> >> On Jan 30, 2014, at 4:11 PM, "David Lee" wrote: >> >> No. >> >> >> >> >> >> From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf >> Of Misztur, Chris >> Sent: Thursday, January 30, 2014 5:07 PM >> To: talk at x-query.com >> Subject: [xquery-talk] function() inside of an element ? >> >> >> >> Is it possible to call the function stored inside of $el? >> >> >> >> Let $el := element f { function() { true() } } >> >> >> >> >> >> ________________________________ >> >> >> The contents of this message may be privileged and confidential. Therefore, >> if this message has been received in error, please delete it without reading >> it. Your receipt of this message is not intended to waive any applicable >> privilege. Please do not disseminate this message without the permission of >> the author. >> >> Please consider the environment before printing this e-mail >> >> >> >> ________________________________ >> >> >> The contents of this message may be privileged and confidential. Therefore, >> if this message has been received in error, please delete it without reading >> it. Your receipt of this message is not intended to waive any applicable >> privilege. Please do not disseminate this message without the permission of >> the author. >> >> Please consider the environment before printing this e-mail >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk >> >> >> >> ________________________________ >> >> >> The contents of this message may be privileged and confidential. Therefore, >> if this message has been received in error, please delete it without reading >> it. Your receipt of this message is not intended to waive any applicable >> privilege. Please do not disseminate this message without the permission of >> the author. >> >> Please consider the environment before printing this e-mail >> >> >> ________________________________ >> >> The contents of this message may be privileged and confidential. Therefore, >> if this message has been received in error, please delete it without reading >> it. Your receipt of this message is not intended to waive any applicable >> privilege. Please do not disseminate this message without the permission of >> the author. >> >> Please consider the environment before printing this e-mail >> >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From dlee at calldei.com Fri Jan 31 15:15:20 2014 From: dlee at calldei.com (David Lee) Date: Fri, 31 Jan 2014 23:15:20 +0000 Subject: [xquery-talk] function() inside of an element ? In-Reply-To: <26D51DCD-38C0-4A6F-B14E-AF69701073E5@macleanfogg.com> References: <7AC1D93CF590E5458FCE12A130606357246DB923@us09exm01.MacLean-Fogg.com> <4CC0E08B-2673-4D52-B9FD-CC69797B82DA@macleanfogg.com> <4489ACD5-CA61-4511-8020-9AE4EA3F887E@macleanfogg.com> <9b0751d24dd845a8adf449ea531e705f@BY2PR08MB014.namprd08.prod.outlook.com> <184F8894-1B53-436A-A9C1-8542B18168A3@macleanfogg.com>, <26D51DCD-38C0-4A6F-B14E-AF69701073E5@macleanfogg.com> Message-ID: <85d14073b9ec47b59cd2b081f3608072@BY2PR08MB014.namprd08.prod.outlook.com> yes -----Original Message----- From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] Sent: Friday, January 31, 2014 6:12 PM To: William Candillon Cc: David Lee; talk at x-query.com Subject: Re: [xquery-talk] function() inside of an element ? Can the anonymous function take an arbitrary parameter? > On Jan 31, 2014, at 3:21 AM, "William Candillon" wrote: > > Here's an example with a map extension (JSONiq in this instance): > let $obj := { > hello: function(){ > "Hello World" > } > } > return $obj.hello() > > http://try.zorba.io/queries/xquery/y5RSvf%2FQpvfNSvB%2Fep%2BE3H2hYcA%3 > D > > > On Fri, Jan 31, 2014 at 12:23 AM, Misztur, Chris > wrote: >> Understood, thanks. >> >> On Jan 30, 2014, at 5:06 PM, "David Lee" wrote: >> >> yes to all that (except maps which are vendor specific) >> >> >> >> declare variable $a := function() { true() } ; >> >> .. >> >> >> >> return $a() >> >> >> >> let $x := ( 1 , $a , 2 ) >> >> return ($x[2])() >> >> >> >> but elements no ... sticking a function into an element atomizes the >> function itself which is not allowed ... a sad state of affairs >> (unless you want to serialize the XML as well XML ... then its great >> ) >> >> >> >> >> >> From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] >> Sent: Thursday, January 30, 2014 5:26 PM >> To: David Lee >> Cc: talk at x-query.com >> Subject: Re: [xquery-talk] function() inside of an element ? >> >> >> >> Err the last arguments should be variables. >> >> >> On Jan 30, 2014, at 4:24 PM, "Misztur, Chris" >> >> wrote: >> >> Better yet, is it possible to store a function in a map whose >> arguments are known at runtime. In other words the functions >> arguments do not reference any existing arguments at design time. >> >> >> On Jan 30, 2014, at 4:11 PM, "David Lee" wrote: >> >> No. >> >> >> >> >> >> From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On >> Behalf Of Misztur, Chris >> Sent: Thursday, January 30, 2014 5:07 PM >> To: talk at x-query.com >> Subject: [xquery-talk] function() inside of an element ? >> >> >> >> Is it possible to call the function stored inside of $el? >> >> >> >> Let $el := element f { function() { true() } } >> >> >> >> >> >> ________________________________ >> >> >> The contents of this message may be privileged and confidential. >> Therefore, if this message has been received in error, please delete >> it without reading it. Your receipt of this message is not intended >> to waive any applicable privilege. Please do not disseminate this >> message without the permission of the author. >> >> Please consider the environment before printing this e-mail >> >> >> >> ________________________________ >> >> >> The contents of this message may be privileged and confidential. >> Therefore, if this message has been received in error, please delete >> it without reading it. Your receipt of this message is not intended >> to waive any applicable privilege. Please do not disseminate this >> message without the permission of the author. >> >> Please consider the environment before printing this e-mail >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk >> >> >> >> ________________________________ >> >> >> The contents of this message may be privileged and confidential. >> Therefore, if this message has been received in error, please delete >> it without reading it. Your receipt of this message is not intended >> to waive any applicable privilege. Please do not disseminate this >> message without the permission of the author. >> >> Please consider the environment before printing this e-mail >> >> >> ________________________________ >> >> The contents of this message may be privileged and confidential. >> Therefore, if this message has been received in error, please delete >> it without reading it. Your receipt of this message is not intended >> to waive any applicable privilege. Please do not disseminate this >> message without the permission of the author. >> >> Please consider the environment before printing this e-mail >> >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From CMisztur at macleanfogg.com Fri Jan 31 15:55:21 2014 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Fri, 31 Jan 2014 23:55:21 +0000 Subject: [xquery-talk] Sequences Message-ID: Is this a sequence of 7 or 9 items? ( 1, 2, 3, (4,5,6), 7, 8, 9 ) ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From dlee at calldei.com Fri Jan 31 16:04:38 2014 From: dlee at calldei.com (David Lee) Date: Sat, 1 Feb 2014 00:04:38 +0000 Subject: [xquery-talk] Sequences In-Reply-To: References: Message-ID: <9aba523dfb7646079d11d55de4463c53@BY2PR08MB014.namprd08.prod.outlook.com> 9 Now for the fun ... how big is this sequence ( (),((),())) -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Misztur, Chris Sent: Friday, January 31, 2014 6:55 PM To: talk at x-query.com Subject: [xquery-talk] Sequences Is this a sequence of 7 or 9 items? ( 1, 2, 3, (4,5,6), 7, 8, 9 ) ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From CMisztur at macleanfogg.com Fri Jan 31 16:08:05 2014 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Sat, 1 Feb 2014 00:08:05 +0000 Subject: [xquery-talk] Sequences In-Reply-To: <9aba523dfb7646079d11d55de4463c53@BY2PR08MB014.namprd08.prod.outlook.com> References: , <9aba523dfb7646079d11d55de4463c53@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <3C7279BF-E3F6-4C39-B386-F4AEBF06AE7B@macleanfogg.com> 3? > On Jan 31, 2014, at 6:04 PM, "David Lee" wrote: > > 9 > > Now for the fun ... how big is this sequence > ( (),((),())) > > > -----Original Message----- > From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Misztur, Chris > Sent: Friday, January 31, 2014 6:55 PM > To: talk at x-query.com > Subject: [xquery-talk] Sequences > > Is this a sequence of 7 or 9 items? > > ( > 1, > 2, > 3, > (4,5,6), > 7, > 8, > 9 > ) > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From dlee at calldei.com Fri Jan 31 16:10:13 2014 From: dlee at calldei.com (David Lee) Date: Sat, 1 Feb 2014 00:10:13 +0000 Subject: [xquery-talk] Sequences In-Reply-To: <3C7279BF-E3F6-4C39-B386-F4AEBF06AE7B@macleanfogg.com> References: , <9aba523dfb7646079d11d55de4463c53@BY2PR08MB014.namprd08.prod.outlook.com> <3C7279BF-E3F6-4C39-B386-F4AEBF06AE7B@macleanfogg.com> Message-ID: 0 -----Original Message----- From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] Sent: Friday, January 31, 2014 7:08 PM To: David Lee Cc: talk at x-query.com Subject: Re: Sequences 3? > On Jan 31, 2014, at 6:04 PM, "David Lee" wrote: > > 9 > > Now for the fun ... how big is this sequence ( (),((),())) > > > -----Original Message----- > From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Misztur, Chris > Sent: Friday, January 31, 2014 6:55 PM > To: talk at x-query.com > Subject: [xquery-talk] Sequences > > Is this a sequence of 7 or 9 items? > > ( > 1, > 2, > 3, > (4,5,6), > 7, > 8, > 9 > ) > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From wcandillon at gmail.com Fri Jan 31 16:12:51 2014 From: wcandillon at gmail.com (William Candillon) Date: Sat, 1 Feb 2014 01:12:51 +0100 Subject: [xquery-talk] function() inside of an element ? In-Reply-To: <85d14073b9ec47b59cd2b081f3608072@BY2PR08MB014.namprd08.prod.outlook.com> References: <7AC1D93CF590E5458FCE12A130606357246DB923@us09exm01.MacLean-Fogg.com> <4CC0E08B-2673-4D52-B9FD-CC69797B82DA@macleanfogg.com> <4489ACD5-CA61-4511-8020-9AE4EA3F887E@macleanfogg.com> <9b0751d24dd845a8adf449ea531e705f@BY2PR08MB014.namprd08.prod.outlook.com> <184F8894-1B53-436A-A9C1-8542B18168A3@macleanfogg.com> <26D51DCD-38C0-4A6F-B14E-AF69701073E5@macleanfogg.com> <85d14073b9ec47b59cd2b081f3608072@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: Here's an example with a parameter: http://try.zorba.io/queries/xquery/yo61xtKOXtdeQn7PXtBjN%2FywU0g%3D On Sat, Feb 1, 2014 at 12:15 AM, David Lee wrote: > yes > > -----Original Message----- > From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] > Sent: Friday, January 31, 2014 6:12 PM > To: William Candillon > Cc: David Lee; talk at x-query.com > Subject: Re: [xquery-talk] function() inside of an element ? > > Can the anonymous function take an arbitrary parameter? > >> On Jan 31, 2014, at 3:21 AM, "William Candillon" wrote: >> >> Here's an example with a map extension (JSONiq in this instance): >> let $obj := { >> hello: function(){ >> "Hello World" >> } >> } >> return $obj.hello() >> >> http://try.zorba.io/queries/xquery/y5RSvf%2FQpvfNSvB%2Fep%2BE3H2hYcA%3 >> D >> >> >> On Fri, Jan 31, 2014 at 12:23 AM, Misztur, Chris >> wrote: >>> Understood, thanks. >>> >>> On Jan 30, 2014, at 5:06 PM, "David Lee" wrote: >>> >>> yes to all that (except maps which are vendor specific) >>> >>> >>> >>> declare variable $a := function() { true() } ; >>> >>> .. >>> >>> >>> >>> return $a() >>> >>> >>> >>> let $x := ( 1 , $a , 2 ) >>> >>> return ($x[2])() >>> >>> >>> >>> but elements no ... sticking a function into an element atomizes the >>> function itself which is not allowed ... a sad state of affairs >>> (unless you want to serialize the XML as well XML ... then its great >>> ) >>> >>> >>> >>> >>> >>> From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] >>> Sent: Thursday, January 30, 2014 5:26 PM >>> To: David Lee >>> Cc: talk at x-query.com >>> Subject: Re: [xquery-talk] function() inside of an element ? >>> >>> >>> >>> Err the last arguments should be variables. >>> >>> >>> On Jan 30, 2014, at 4:24 PM, "Misztur, Chris" >>> >>> wrote: >>> >>> Better yet, is it possible to store a function in a map whose >>> arguments are known at runtime. In other words the functions >>> arguments do not reference any existing arguments at design time. >>> >>> >>> On Jan 30, 2014, at 4:11 PM, "David Lee" wrote: >>> >>> No. >>> >>> >>> >>> >>> >>> From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On >>> Behalf Of Misztur, Chris >>> Sent: Thursday, January 30, 2014 5:07 PM >>> To: talk at x-query.com >>> Subject: [xquery-talk] function() inside of an element ? >>> >>> >>> >>> Is it possible to call the function stored inside of $el? >>> >>> >>> >>> Let $el := element f { function() { true() } } >>> >>> >>> >>> >>> >>> ________________________________ >>> >>> >>> The contents of this message may be privileged and confidential. >>> Therefore, if this message has been received in error, please delete >>> it without reading it. Your receipt of this message is not intended >>> to waive any applicable privilege. Please do not disseminate this >>> message without the permission of the author. >>> >>> Please consider the environment before printing this e-mail >>> >>> >>> >>> ________________________________ >>> >>> >>> The contents of this message may be privileged and confidential. >>> Therefore, if this message has been received in error, please delete >>> it without reading it. Your receipt of this message is not intended >>> to waive any applicable privilege. Please do not disseminate this >>> message without the permission of the author. >>> >>> Please consider the environment before printing this e-mail >>> >>> _______________________________________________ >>> talk at x-query.com >>> http://x-query.com/mailman/listinfo/talk >>> >>> >>> >>> ________________________________ >>> >>> >>> The contents of this message may be privileged and confidential. >>> Therefore, if this message has been received in error, please delete >>> it without reading it. Your receipt of this message is not intended >>> to waive any applicable privilege. Please do not disseminate this >>> message without the permission of the author. >>> >>> Please consider the environment before printing this e-mail >>> >>> >>> ________________________________ >>> >>> The contents of this message may be privileged and confidential. >>> Therefore, if this message has been received in error, please delete >>> it without reading it. Your receipt of this message is not intended >>> to waive any applicable privilege. Please do not disseminate this >>> message without the permission of the author. >>> >>> Please consider the environment before printing this e-mail >>> >>> >>> _______________________________________________ >>> talk at x-query.com >>> http://x-query.com/mailman/listinfo/talk > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > From CMisztur at macleanfogg.com Fri Jan 31 16:13:40 2014 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Sat, 1 Feb 2014 00:13:40 +0000 Subject: [xquery-talk] Sequences In-Reply-To: <9aba523dfb7646079d11d55de4463c53@BY2PR08MB014.namprd08.prod.outlook.com> References: , <9aba523dfb7646079d11d55de4463c53@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <508024A8-6DCB-40F1-A1FF-4A34952133E1@macleanfogg.com> So can I ever get at $seq[3][2]() ? (1,2,(function(),function()),5,6) > On Jan 31, 2014, at 6:04 PM, "David Lee" wrote: > > 9 > > Now for the fun ... how big is this sequence > ( (),((),())) > > > -----Original Message----- > From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Misztur, Chris > Sent: Friday, January 31, 2014 6:55 PM > To: talk at x-query.com > Subject: [xquery-talk] Sequences > > Is this a sequence of 7 or 9 items? > > ( > 1, > 2, > 3, > (4,5,6), > 7, > 8, > 9 > ) > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From dlee at calldei.com Fri Jan 31 16:16:52 2014 From: dlee at calldei.com (David Lee) Date: Sat, 1 Feb 2014 00:16:52 +0000 Subject: [xquery-talk] Sequences In-Reply-To: <508024A8-6DCB-40F1-A1FF-4A34952133E1@macleanfogg.com> References: , <9aba523dfb7646079d11d55de4463c53@BY2PR08MB014.namprd08.prod.outlook.com> <508024A8-6DCB-40F1-A1FF-4A34952133E1@macleanfogg.com> Message-ID: The piece if information you are missing is that sequences dont nest. They flatten. (1,2,3) == (1,(2,3)) == (1,((2),(3)) ... No such thing as sequences inside a sequence (unlike what you might expect if you thought of them as arrays. So let $a := (1,2,(function(),function()),5,6) == (1,2,function(),function(),5,6) {( assuming you mean a full function declaration )} $a[3] == function() ... $a[3][2] == () -----Original Message----- From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] Sent: Friday, January 31, 2014 7:14 PM To: David Lee Cc: talk at x-query.com Subject: Re: Sequences So can I ever get at $seq[3][2]() ? (1,2,(function(),function()),5,6) > On Jan 31, 2014, at 6:04 PM, "David Lee" wrote: > > 9 > > Now for the fun ... how big is this sequence ( (),((),())) > > > -----Original Message----- > From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Misztur, Chris > Sent: Friday, January 31, 2014 6:55 PM > To: talk at x-query.com > Subject: [xquery-talk] Sequences > > Is this a sequence of 7 or 9 items? > > ( > 1, > 2, > 3, > (4,5,6), > 7, > 8, > 9 > ) > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From CMisztur at macleanfogg.com Fri Jan 31 16:26:54 2014 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Sat, 1 Feb 2014 00:26:54 +0000 Subject: [xquery-talk] function() inside of an element ? In-Reply-To: References: <7AC1D93CF590E5458FCE12A130606357246DB923@us09exm01.MacLean-Fogg.com> <4CC0E08B-2673-4D52-B9FD-CC69797B82DA@macleanfogg.com> <4489ACD5-CA61-4511-8020-9AE4EA3F887E@macleanfogg.com> <9b0751d24dd845a8adf449ea531e705f@BY2PR08MB014.namprd08.prod.outlook.com> <184F8894-1B53-436A-A9C1-8542B18168A3@macleanfogg.com> <26D51DCD-38C0-4A6F-B14E-AF69701073E5@macleanfogg.com> <85d14073b9ec47b59cd2b081f3608072@BY2PR08MB014.namprd08.prod.outlook.com>, Message-ID: <7AC1D93CF590E5458FCE12A130606357246DF6AC@us09exm01.MacLean-Fogg.com> You're right xquery version "3.0"; let $obj := map { "hello" := function($world){"Hello " || $world } } return $obj("hello")("World") ________________________________________ From: William Candillon [wcandillon at gmail.com] Sent: Friday, January 31, 2014 6:12 PM To: David Lee Cc: Misztur, Chris; talk at x-query.com Subject: Re: [xquery-talk] function() inside of an element ? Here's an example with a parameter: http://try.zorba.io/queries/xquery/yo61xtKOXtdeQn7PXtBjN%2FywU0g%3D On Sat, Feb 1, 2014 at 12:15 AM, David Lee wrote: > yes > > -----Original Message----- > From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] > Sent: Friday, January 31, 2014 6:12 PM > To: William Candillon > Cc: David Lee; talk at x-query.com > Subject: Re: [xquery-talk] function() inside of an element ? > > Can the anonymous function take an arbitrary parameter? > >> On Jan 31, 2014, at 3:21 AM, "William Candillon" wrote: >> >> Here's an example with a map extension (JSONiq in this instance): >> let $obj := { >> hello: function(){ >> "Hello World" >> } >> } >> return $obj.hello() >> >> http://try.zorba.io/queries/xquery/y5RSvf%2FQpvfNSvB%2Fep%2BE3H2hYcA%3 >> D >> >> >> On Fri, Jan 31, 2014 at 12:23 AM, Misztur, Chris >> wrote: >>> Understood, thanks. >>> >>> On Jan 30, 2014, at 5:06 PM, "David Lee" wrote: >>> >>> yes to all that (except maps which are vendor specific) >>> >>> >>> >>> declare variable $a := function() { true() } ; >>> >>> .. >>> >>> >>> >>> return $a() >>> >>> >>> >>> let $x := ( 1 , $a , 2 ) >>> >>> return ($x[2])() >>> >>> >>> >>> but elements no ... sticking a function into an element atomizes the >>> function itself which is not allowed ... a sad state of affairs >>> (unless you want to serialize the XML as well XML ... then its great >>> ) >>> >>> >>> >>> >>> >>> From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] >>> Sent: Thursday, January 30, 2014 5:26 PM >>> To: David Lee >>> Cc: talk at x-query.com >>> Subject: Re: [xquery-talk] function() inside of an element ? >>> >>> >>> >>> Err the last arguments should be variables. >>> >>> >>> On Jan 30, 2014, at 4:24 PM, "Misztur, Chris" >>> >>> wrote: >>> >>> Better yet, is it possible to store a function in a map whose >>> arguments are known at runtime. In other words the functions >>> arguments do not reference any existing arguments at design time. >>> >>> >>> On Jan 30, 2014, at 4:11 PM, "David Lee" wrote: >>> >>> No. >>> >>> >>> >>> >>> >>> From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On >>> Behalf Of Misztur, Chris >>> Sent: Thursday, January 30, 2014 5:07 PM >>> To: talk at x-query.com >>> Subject: [xquery-talk] function() inside of an element ? >>> >>> >>> >>> Is it possible to call the function stored inside of $el? >>> >>> >>> >>> Let $el := element f { function() { true() } } >>> >>> >>> >>> >>> >>> ________________________________ >>> >>> >>> The contents of this message may be privileged and confidential. >>> Therefore, if this message has been received in error, please delete >>> it without reading it. Your receipt of this message is not intended >>> to waive any applicable privilege. Please do not disseminate this >>> message without the permission of the author. >>> >>> Please consider the environment before printing this e-mail >>> >>> >>> >>> ________________________________ >>> >>> >>> The contents of this message may be privileged and confidential. >>> Therefore, if this message has been received in error, please delete >>> it without reading it. Your receipt of this message is not intended >>> to waive any applicable privilege. Please do not disseminate this >>> message without the permission of the author. >>> >>> Please consider the environment before printing this e-mail >>> >>> _______________________________________________ >>> talk at x-query.com >>> http://x-query.com/mailman/listinfo/talk >>> >>> >>> >>> ________________________________ >>> >>> >>> The contents of this message may be privileged and confidential. >>> Therefore, if this message has been received in error, please delete >>> it without reading it. Your receipt of this message is not intended >>> to waive any applicable privilege. Please do not disseminate this >>> message without the permission of the author. >>> >>> Please consider the environment before printing this e-mail >>> >>> >>> ________________________________ >>> >>> The contents of this message may be privileged and confidential. >>> Therefore, if this message has been received in error, please delete >>> it without reading it. Your receipt of this message is not intended >>> to waive any applicable privilege. Please do not disseminate this >>> message without the permission of the author. >>> >>> Please consider the environment before printing this e-mail >>> >>> >>> _______________________________________________ >>> talk at x-query.com >>> http://x-query.com/mailman/listinfo/talk > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From CMisztur at macleanfogg.com Fri Jan 31 16:28:17 2014 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Sat, 1 Feb 2014 00:28:17 +0000 Subject: [xquery-talk] Sequences In-Reply-To: References: , <9aba523dfb7646079d11d55de4463c53@BY2PR08MB014.namprd08.prod.outlook.com> <3C7279BF-E3F6-4C39-B386-F4AEBF06AE7B@macleanfogg.com>, Message-ID: <7AC1D93CF590E5458FCE12A130606357246DF6BC@us09exm01.MacLean-Fogg.com> Interesting and this = 1 ( (),((1),())) ________________________________________ From: David Lee [dlee at calldei.com] Sent: Friday, January 31, 2014 6:10 PM To: Misztur, Chris Cc: talk at x-query.com Subject: RE: Sequences 0 -----Original Message----- From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] Sent: Friday, January 31, 2014 7:08 PM To: David Lee Cc: talk at x-query.com Subject: Re: Sequences 3? > On Jan 31, 2014, at 6:04 PM, "David Lee" wrote: > > 9 > > Now for the fun ... how big is this sequence ( (),((),())) > > > -----Original Message----- > From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Misztur, Chris > Sent: Friday, January 31, 2014 6:55 PM > To: talk at x-query.com > Subject: [xquery-talk] Sequences > > Is this a sequence of 7 or 9 items? > > ( > 1, > 2, > 3, > (4,5,6), > 7, > 8, > 9 > ) > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From dlee at calldei.com Fri Jan 31 17:01:47 2014 From: dlee at calldei.com (David Lee) Date: Sat, 1 Feb 2014 01:01:47 +0000 Subject: [xquery-talk] Sequences In-Reply-To: <7AC1D93CF590E5458FCE12A130606357246DF6BC@us09exm01.MacLean-Fogg.com> References: , <9aba523dfb7646079d11d55de4463c53@BY2PR08MB014.namprd08.prod.outlook.com> <3C7279BF-E3F6-4C39-B386-F4AEBF06AE7B@macleanfogg.com>, , <7AC1D93CF590E5458FCE12A130606357246DF6BC@us09exm01.MacLean-Fogg.com> Message-ID: Now your getting it! Sent from my iPad (excuse the terseness) David A Lee dlee at calldei.com > On Jan 31, 2014, at 7:28 PM, "Misztur, Chris" wrote: > > Interesting and this = 1 > > ( (),((1),())) > ________________________________________ > From: David Lee [dlee at calldei.com] > Sent: Friday, January 31, 2014 6:10 PM > To: Misztur, Chris > Cc: talk at x-query.com > Subject: RE: Sequences > > 0 > > -----Original Message----- > From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] > Sent: Friday, January 31, 2014 7:08 PM > To: David Lee > Cc: talk at x-query.com > Subject: Re: Sequences > > 3? > >> On Jan 31, 2014, at 6:04 PM, "David Lee" wrote: >> >> 9 >> >> Now for the fun ... how big is this sequence ( (),((),())) >> >> >> -----Original Message----- >> From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Misztur, Chris >> Sent: Friday, January 31, 2014 6:55 PM >> To: talk at x-query.com >> Subject: [xquery-talk] Sequences >> >> Is this a sequence of 7 or 9 items? >> >> ( >> 1, >> 2, >> 3, >> (4,5,6), >> 7, >> 8, >> 9 >> ) >> >> ________________________________ >> >> The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. >> >> Please consider the environment before printing this e-mail >> >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > From gandhi.mukul at gmail.com Fri Jan 31 23:39:49 2014 From: gandhi.mukul at gmail.com (Mukul Gandhi) Date: Sat, 1 Feb 2014 13:09:49 +0530 Subject: [xquery-talk] Sequences In-Reply-To: References: Message-ID: I think, this is sequence of 7 items. As far as I can recall, the internal sequence (4,5,6) won't be expanded to get the size of outer sequence and would contribute one item to this result. On Sat, Feb 1, 2014 at 5:25 AM, Misztur, Chris wrote: > Is this a sequence of 7 or 9 items? > > ( > 1, > 2, > 3, > (4,5,6), > 7, > 8, > 9 > ) > > ________________________________ > > The contents of this message may be privileged and confidential. > Therefore, if this message has been received in error, please delete it > without reading it. Your receipt of this message is not intended to waive > any applicable privilege. Please do not disseminate this message without > the permission of the author. > > Please consider the environment before printing this e-mail > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -- Regards, Mukul Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: