Re: [xquery-talk] let's comment out a line in XQuery

2012-12-20 Thread Michael Kay
Or is this a Christmas quiz: invent a query such that removing line 26 will cause this error? Michael Kay Saxonica On 20/12/2012 05:45, jida...@jidanni.org wrote: Geez, all I wanted to do was comment out a line: (: 120.865225,24.181802 :) But now I have to make it (: 120.865225,24.181802 :) or e

Re: [xquery-talk] let's comment out a line in XQuery

2012-12-20 Thread Michael Kay
ong the other children of the element. Michael Kay Saxonica On 20/12/2012 15:39, jida...@jidanni.org wrote: I don't have a Senior Secondary Certificate of Education :-) but here goes anyway. basex: Debian's 7.3-1. $ basex noise0.xq |wc Stopped at line 26, column 46 in /home/jidanni/

Re: [xquery-talk] let's comment out a line in XQuery

2012-12-21 Thread Michael Kay
usually attract much enthusiasm. You might find someone in the WG has grand ideas to use the same syntax for something else, like an empty map or array, and wants to hold it in reserve for that, and on past experience that would probably win the argument.

Re: [xquery-talk] treat as

2013-01-20 Thread Michael Kay
it would return 1 Saxon 9.4.0.3 returns the empty sequence I haven't tried 9.4.0.3, but 9.4.0.6 says: Error on line 3 of test.xq: XPDY0050: Required item type of value in 'treat as' expression is xs:untypedAtomic Query processing failed: Run-time errors were

Re: [xquery-talk] treat as

2013-01-21 Thread Michael Kay
" is an assertion designed so the query author can tell a pessimistic static type checker to get out of the way and mind its own business, it is needed only in systems that do pessimistic static type checking, which are very few and far between. (Galax a

Re: [xquery-talk] Conditional use of fn:error() ?

2013-01-21 Thread Michael Kay
en/else branch unless the condition is true/false. Michael Kay Saxonica On 21/01/2013 11:07, Yoshi Okamoto wrote: Dear list subscribers, I noticed that different XQuery processors (BaseX, Saxon, XMLPrime, Zorba) return different results for the following queries: Query A: fn:error()[false(

Re: [xquery-talk] treat as

2013-01-21 Thread Michael Kay
ry few and far between. (Galax and SQL Server are the only ones that come to mind). Michael Kay Saxonica Do you know of any cases where "treat as" is necessary in XQuery ? Or is it the equivalent of a static assert that otherwise would cause a dynamic error ? It's on

Re: [xquery-talk] treat as

2013-01-21 Thread Michael Kay
known, Saxon rewrites it as ($a treat as node()*)/child::node() which is what you would have to write yourself in a system with pessimistic type checking (either that, or you would add a type declaration to the declaration of variable $a). Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Looking for an example - calling XQuery 3.0 function module from XSLT 3.0

2013-02-04 Thread Michael Kay
need to help you move forward. It's even possible you've hit a bug - you're a little off-piste when you use extensions like this, so the risk of finding bugs is greater. Michael Kay Saxonica On 01/02/2013 15:10, Loren Cahlander wrote: Hello folks, I am playing with the latest versi

Re: [xquery-talk] XQuery 3.0: formatting integers

2013-03-10 Thread Michael Kay
;s Saxon processor is probably the implementation to trust most? No, because the specification has been changed since Saxon 9.4 was released. At this stage of the game, while the specification is still a draft, differences between implementations - especially in edge cases - are to be expec

Re: [xquery-talk] where clause

2013-03-27 Thread Michael Kay
those that reference the context. For example $y/(for $x in //item where $x/@status = . return $x) To translate this into a predicate you need to introduce a variable: $y/(let $z := . return //item[@status = $z]) Michael Kay Saxonica ___ talk@x-que

Re: [xquery-talk] where clause

2013-03-29 Thread Michael Kay
ession is relatively unimportant. Michael Kay Saxonica On 29 Mar 2013, at 07:35, Liam R E Quin wrote: > > On Wed, 2013-03-27 at 13:26 +, deBakker, Bas wrote: >> Wouldn't that be equivalent to >> >>for $a in expr1, $b in expr2, $c in expr3[$a = $b + .] >>

Re: [xquery-talk] Need xquery function for "number of days between two dates"

2013-04-12 Thread Michael Kay
You just use the subtraction operator "-" with operands of type xs:date, this returns a dayTimeDuration, which you can turn into an integer number of days by dividing it by xs:dayTimeDuration('P1D'). Michael Kay Saxonica On 12 Apr 2013, at 18:04, sudheshna iyer wrote:

Re: [xquery-talk] Fuctions and variables in replacement string of fn:replace()

2013-05-01 Thread Michael Kay
://www.saxonica.com/documentation/#!functions/saxon/analyze-string) but in 3.0 the WG took a different direction in its definition of fn:analyze-string(), which is probably easier for ordinary mortals to cope with: http://www.w3.org/TR/xpath-functions-30/#func-analyze-string > Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Is it possible to maintain a list of value in XQuery

2013-05-15 Thread Michael Kay
cy of this code then switch to an XQuery processor with a decent optimizer. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Is it possible to maintain a list of value in XQuery

2013-05-15 Thread Michael Kay
re that $a is a sequence. So the optimizer is making pure guesses based on observed behaviour rather than hard data - and by doing so, is reinforcing that behaviour. It's a black art.) Michael Kay Saxonica On 15 May 2013, at 16:05, David Lee wrote: > In XQuery (neglecting some vendor spe

Re: [xquery-talk] and what I think we should tackle right now

2013-05-21 Thread Michael Kay
orks well for integrating heterogeneous data sources. They've been trying for at least 40 years. My own preferred candidate is the functional data model, because it so minimalist, but it's not exactly a fashionable candidate right now. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Query the attributes

2013-05-23 Thread Michael Kay
. The only XML I can think of that's consistent with your observations is where the id attribute is present with a value of "" (empty string). Michael Kay Saxonica On 23 May 2013, at 09:34, Mailing Lists Mail wrote: > Dear All, > I was trying to query the atribute value usi

Re: [xquery-talk] Query the attributes

2013-05-23 Thread Michael Kay
A well-known gotcha in XQuery, sorry for not spotting it! Michael Kay Saxonica On 23 May 2013, at 10:19, Mailing Lists Mail wrote: > Just updating... > I tried : > { > string($college/@id) > } > > and > > { >$college/@id/string() > } > > B

Re: [xquery-talk] Type 'element(*, xs:untyped)' cannot be cast to type 'xs:QName'.

2013-05-28 Thread Michael Kay
I wonder if the problem is with the function return value rather than with its arguments? What is the body of the function? Michael Kay Saxonica On 28 May 2013, at 07:51, Kunal Chauhan wrote: > I tried to run this query with two processors DataDirect and Saxon. > But under both process

Re: [xquery-talk] value not bound exception while using empty()

2013-06-19 Thread Michael Kay
s not what the spec says. Michael Kay Saxonica On 19 Jun 2013, at 07:34, Kunal Chauhan wrote: > Thanks David, Thanks for your quick response. > It's works. > can you tell me logic behind this ? > > > On Wed, Jun 19, 2013 at 11:44 AM, David Lee wrote: > try > >

Re: [xquery-talk] value not bound exception while using empty()

2013-06-19 Thread Michael Kay
Yes, of course you can bind a value from the application. In XQJ that's done using the bind...() methods of XQDynamicContext. Michael Kay Saxonica On 19 Jun 2013, at 08:58, Kunal Chauhan wrote: > Yes Michael, You are right. > as soon as I run this query through java code where

Re: [xquery-talk] strange behaviour of XQuery

2013-06-20 Thread Michael Kay
In the first query, 1 < 10 is true whether you compare as strings or as numbers. Michael Kay Saxonica On 20 Jun 2013, at 16:05, Kunal Chauhan wrote: > Ken , John you are right. > If we compare any two untyped value in XQuery, it will treated as string. > but Still if we co

Re: [xquery-talk] strange behaviour of XQuery

2013-06-21 Thread Michael Kay
I have to bind XQItem only. And I am getting wrong result. > If you want to compare two values as numbers then you have to convert them to numbers in order to compare them. I can't see why that should be a problem. Michael Kay Saxonica ___ t

Re: [xquery-talk] strange behaviour of XQuery

2013-06-21 Thread Michael Kay
Sorry, I don't understand you project requirements. If you are receiving queries for execution from third parties, then there is no way you can meaningfully execute those queries without knowing what kind of input they expect to operate on. Michael Kay Saxonica On 21 Jun 2013, at

Re: [xquery-talk] about reference of system.core.dll when using Saxon9HE

2013-08-06 Thread Michael Kay
.NET version 2.0, and will get back to you off-list. The answer may well be that you need to upgrade to .NET 3.5. Michael Kay Saxonica On 7 Aug 2013, at 03:13, 廖勇 wrote: > Hi sir, > First of all, thank you for your great work. > Here I have a problem when I use Saxon9HE(version 9.5.0.2)

Re: [xquery-talk] operations on derived numeric type

2013-08-30 Thread Michael Kay
yte(-128). (I suspect that Saxon returns the original value unchanged, including type annotation, if it is positive, and returns a value with type annotation xs:integer if it is negative. That's a permitted and in my view reasonable implementation). Michael Kay Saxonica

Re: [xquery-talk] operations on derived numeric type

2013-08-30 Thread Michael Kay
loured by COBOL. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] operations on derived numeric type

2013-08-31 Thread Michael Kay
t, it doesn't actually prohibit the static context being infinite. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] operations on derived numeric type

2013-09-02 Thread Michael Kay
for practical reasons it's best for casts and constructors to always return the specific type requested. (Otherwise people with "instance of" or "typeswitch" constructions that take an unexpected branch get upset.) Michael Kay Saxonica _

Re: [xquery-talk] context item in module variable

2013-10-13 Thread Michael Kay
lts are submitted to W3C, the result for that test should be documented as "notRun" with a reason. Michael Kay Saxonica On 13 Oct 2013, at 14:07, Benito van der Zander wrote: > Hi, > what is the value of the context item in a variable declaration of an module > in XQuery 1?

Re: [xquery-talk] context item in module variable

2013-10-14 Thread Michael Kay
think this is clearly stated in 1.0. Michael Kay Saxonica > > > > This is the test: > > > > Document containing some nasty cases for > fn:data. > > > http://www.cbcl.co.uk/XQueryTest/complexData"; > file="..

Re: [xquery-talk] context item in module variable

2013-10-14 Thread Michael Kay
t was the intent of the 1.0 spec, but I agree that the spec was not clear on the point. If you raise a bug against the test then the WG will have to make a decision on the question. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] context item in module variable

2013-10-14 Thread Michael Kay
doesn't look at test suite issues every week, especially if they aren't on the current critical path. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] context item in module variable

2013-10-14 Thread Michael Kay
problem to the QT3 test suite, where it is more likely to receive prompt attention; though it could still take a month. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Datetime function needed

2013-10-18 Thread Michael Kay
In XQuery 3.0, use format-date(). In 1.0, you have to do it by hand: extract the components using e.g. month-from-date($d), and format them manually. Michael Kay Saxonica On 18 Oct 2013, at 13:34, sudheshna iyer wrote: > I want to convert result of current-date()(eg: 2006-04-10-05:00) in

Re: [xquery-talk] Group starting with in XQuery?

2013-11-19 Thread Michael Kay
If you're asking about XQuery 1.0, the answer is no, unless you regard the solution using recursion as elegant. In XQuery 3.0 there are "tumbling windows" which give you the capability of XSLT's group-starting-with, and a lot more besides. Michael Kay Saxonica On 19 Nov 2

Re: [xquery-talk] map module for XQUERY ?

2013-11-26 Thread Michael Kay
The specification of map:new and map:entry can be found in the XSLT 3.0 working draft, and it does indeed specify that when there are duplicates, the last one wins. http://www.w3.org/TR/xslt-30/#map-functions Michael Kay Saxonica On 21 Nov 2013, at 07:56, jean-marc Mercier wrote: > @J

Re: [xquery-talk] [xml-dev] OT: Suggestion for new OSS SCC site / tool for xmlsh ? SourceForge has gone to the dark side.

2013-11-26 Thread Michael Kay
cceed if we tried again, but there isn't enough incentive to change for its own sake. Someone tweeted a few weeks ago that we should move off SF because it wasn't cool any more. I responded that coolth wasn't one of our project objectives, and were there any genuine technic

Re: [xquery-talk] map module for XQUERY ?

2013-11-27 Thread Michael Kay
nts to keep things as simple as possible. I think we've done well to resist feature creep on this one. Michael Kay Saxonica [1] As an example of the complexity, how do you compare two maps if they have "different" ordering functions, and how can you tell whether the ordering func

Re: [xquery-talk] map module for XQUERY ?

2013-12-03 Thread Michael Kay
he interpreters I've tried... > Saxon tries quite hard to achieve incremental sequence construction with linear time complexity, but it does depend on your using coding patterns that the optimizer recognizes. Michael Kay Saxonica ___ ta

Re: [xquery-talk] map module for XQUERY ?

2013-12-03 Thread Michael Kay
the world of database query languages where the theory is that optimization is the job of the system, not the of the programmer. This does have the effect that performance characteristics can vary widely across implementations, for example subscripting $seq[N] takes linear time in some im

Re: [xquery-talk] map module for XQUERY ?

2013-12-05 Thread Michael Kay
is to process XML. It may simply be that you are doing things that the vendor in question hasn't thought about much, because they consider other things more important. Michael Kay Saxonica On 5 Dec 2013, at 10:02, jean-marc Mercier wrote: > Hello. > > To end this thread, I wou

Re: [xquery-talk] xquery technology now ready?

2013-12-10 Thread Michael Kay
x.net). Michael Kay Saxonica On 9 Dec 2013, at 23:41, e-letter wrote: > Readers, > > Can xquery be used for the following scenario: > > a "database" (originally from 'w3schools' web site) > > >

Re: [xquery-talk] xquery technology now ready?

2013-12-10 Thread Michael Kay
dy installed on their servers? > It doesn't have to be a web server dedicated to the one application, but you are right that if you choose a bog-standard cheap hosting provider then you are often restricted to the software that they decide to let you use, which will often be a very

Re: [xquery-talk] xquery technology now ready?

2013-12-11 Thread Michael Kay
ady yet and so > sql database + sever script language remains the option. > And presumably you don't think the car's time has come yet, because travelling by bus is so much cheaper. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Validating an attribute value

2013-12-14 Thread Michael Kay
If you want to check that an attribute exists and that its value is non-empty and not all whitespace, use if (normalize-space(@att)) then... Michael Kay Saxonica On 14 Dec 2013, at 02:01, Misztur, Chris wrote: > If I want to make sure that an attribute has a value should I check w

Re: [xquery-talk] flwor expression result

2013-12-19 Thread Michael Kay
If you put an expression inside the content of an element node, it needs to go in curly braces. Otherwise it's just literal element content. Michael Kay Saxonica On 19 Dec 2013, at 18:24, e-letter wrote: > Readers, > > According to the xquery specification , the flwor exp

Re: [xquery-talk] Duke it out between you

2014-01-02 Thread Michael Kay
ed on the rhs of "/" returns the position of the context item among the items selected; it will always be an ascending sequence starting at 1. Michael Kay Saxonica On 2 Jan 2014, at 13:21, Ihe Onwuka wrote: > some content />some content/ > descendant::C[normalize-space(@score

Re: [xquery-talk] Collections - family relationships

2014-01-05 Thread Michael Kay
k 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 __

Re: [xquery-talk] Collections - family relationships

2014-01-05 Thread Michael Kay
ave 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 ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Collections - family relationships

2014-01-05 Thread Michael Kay
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 ___

Re: [xquery-talk] Collections - family relationships

2014-01-06 Thread Michael Kay
In XQuery 3.0 for $review in collection($sp:reviewsColl)//review group by $review/@person where count($review) = 1 return f:render($review) Michael Kay Saxonica On 6 Jan 2014, at 10:58, Ihe Onwuka wrote: > Let me give a bit of background to the use case motivating the question. > &g

Re: [xquery-talk] Collections - family relationships

2014-01-06 Thread Michael Kay
e 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 _

Re: [xquery-talk] Collections - family relationships

2014-01-06 Thread Michael Kay
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 ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] XQuery 3.0 Grouping - Sufficiently baffled by ordering

2014-01-07 Thread Michael Kay
You need to cut out that middle "return". You've written two nested FLWOR expressions, and an "order by" clause on the inner FLWOR expression isn't going to affect the order of the outer FLWOR expression. Michael Kay Saxonica On 7 Jan 2014, at 10:47, Ihe Onwuka

Re: [xquery-talk] XQuery 3.0 Grouping - Sufficiently baffled by ordering

2014-01-07 Thread Michael Kay
Try > { > for $thing in > subsequence(collection($sp:reviewsColl)/descendant::reviews[1]//thing,1,5) > group by $name:=$thing/@name > order by count($thing) descending > return } > Michael Kay Saxonica On 7 Jan 2014, at 11:34, Ihe Onwuka wrote: &

Re: [xquery-talk] XQuery 3.0 Grouping - Sufficiently baffled by ordering

2014-01-07 Thread Michael Kay
ause isn't allowed after an order-by or group-by. I don't remember the reasons for that. Please don't ask me to defend the design. I wanted grouping to work on a sequence of items (like windowing does), not on a stream of tuples, but I was heavily outvoted. Michael Kay Saxonica

Re: [xquery-talk] XQuery 3.0 Grouping - Sufficiently baffled by ordering

2014-01-07 Thread Michael Kay
e "return". That is, they don't mean the same as InitialClause and IntermediateClause in the grammar. I'll raise a bug on this. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Tales of the unexpected version III - Atomization

2014-01-08 Thread Michael Kay
) This construct is specific to XQuery, and therefore outside the scope of my XSLT/XPath book. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Tales of the unexpected version III - Atomization

2014-01-08 Thread Michael Kay
ly. 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 ___ talk@x-query

Re: [xquery-talk] Tales of the unexpected version III - Atomization

2014-01-08 Thread Michael Kay
then it's not clear what a better design would look like. In XSLT 3.0 we have introduced a similar construct (content templates) and decided that these should always be atomized, which we can do because we have the instruction for the alternate behaviour. So at least we're learning from mistakes. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Multiple output via a stream of filters

2014-01-14 Thread Michael Kay
dvance. The normal solution would use "group-by" but this is not streamable. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Collections - family relationships

2014-01-18 Thread Michael Kay
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. > > http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Everything is a sequence ...so ....

2014-01-25 Thread Michael Kay
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

Re: [xquery-talk] What does [.] do.

2014-01-27 Thread Michael Kay
gh 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

Re: [xquery-talk] Q: computed element and namespace

2014-01-31 Thread Michael Kay
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 >

Re: [xquery-talk] Matrix Multiplication (JSONiq)

2014-02-02 Thread Michael Kay
on, which is expensive * Numeric subscripts when addressing XML (as in para[3]) are likely to have O(n) performance rather than constant performance, because the tree structure is likely to be optimized for scanning all the children rather than locating an individual child by its index. Michael

Re: [xquery-talk] Matrix Multiplication (JSONiq)

2014-02-03 Thread Michael Kay
mbers. Michael Kay Saxonica On 3 Feb 2014, at 10:16, jean-marc Mercier wrote: > Michael, you're right, and I do now understand that an efficient > serialization / deserialization of a matrix structure could be more > straightforward using JSON than XML. > However, without cons

Re: [xquery-talk] Matrix Multiplication (JSONiq)

2014-02-03 Thread Michael Kay
On 3 Feb 2014, at 13:09, jean-marc Mercier wrote: > Well, I am sure that these algorithms can be parallelized, using 28.io, or > other vendor solutions. > However, honestly, today, you would have to spend tons of processors, watts, > intelligence, to perform a matrix multiplication over a 400

Re: [xquery-talk] min max and mix

2014-02-10 Thread Michael Kay
That's nothing to with max() and min(), but everything to do with mixed content. The system is designed so that 123.456 has an untyped string value of 123.456 Remember, the M in XML stands for Markup. Markup is an annotation to text that can be removed without changing the meaning. Mi

Re: [xquery-talk] What does [.] do.

2014-02-10 Thread Michael Kay
;, "foo", , true, false)[.] >> >> returns >> >> 1 (position matches) >> 2 (position matches) >> 5 (position matches) >> foo (EBV = true) >> (EBV = true) >> true (EBV = true) >> > > In Zorba it does - but is that right?

Re: [xquery-talk] min max and mix

2014-02-10 Thread Michael Kay
but it's implementation-dependent whether it's a decimal one or a double one. (IIRC, haven't checked the spec). Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] What does [.] do.

2014-02-10 Thread Michael Kay
d meaning to the names true and false, and is warning you that it is doing so. If so you are right, it's not conformant. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Text Markup vs Data Serialization - Was RE: min max and mix

2014-02-10 Thread Michael Kay
a for example married=true, height=1.86, children=["John", "Mary"] * distinguishes whitespace that is present for readability purposes from whitespace that's part of the content * eliminates the artificial distinction between elements and attributes, allowing the sa

Re: [xquery-talk] Text Markup vs Data Serialization - Was RE: min max and mix

2014-02-10 Thread Michael Kay
tter than XML and better than JSON and invent its own syntax, which will do the job sufficiently well that people in other areas start adopting it too. Who knows. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] [xsl] Castable integers

2014-02-21 Thread Michael Kay
Yes, castability is not transitive. Well spotted. You get some pretty strange results with boolean() too, e.g. boolean(string(false())) => true(). Michael Kay Saxonica On 21 Feb 2014, at 16:18, Ihe Onwuka wrote: > 3 castable as xs:integer -> true > > "3" casta

Re: [xquery-talk] simple map at the moment is not so simple

2014-03-04 Thread Michael Kay
Show us the failing expression. I suspect the expression on the RHS of "!" should be in parens. Michael Kay Saxonica On 4 Mar 2014, at 15:13, Ihe Onwuka wrote: > I have something like > > distinct-values(somepath/@x) ! > http:send-request(http://www.me.com/&

Re: [xquery-talk] Typeswitch - scope of variables

2014-03-14 Thread Michael Kay
than these subexpressions] Clearly the case clauses of the typeswitch are not subexpressions of this FLWOR so they are not within the scope of a variable introduced by such a let clause. Michael Kay Saxonica > Yes I can to see if > they are but such an experiment would not adjudicate speci

Re: [xquery-talk] lazy evaluation of sequences

2014-03-14 Thread Michael Kay
result, and in particular, it never needs to evaluate an expression merely in order to discover whether evaluating it throws an error. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Compared to what?

2014-04-02 Thread Michael Kay
with the default collation from the static context. Using fn:deep-equal() on two atomic values is almost the same as using "eq", except that you get false rather than an error if the values are of incomparable types, and you get true if you compare NaN to NaN. Michael Kay Saxonica

Re: [xquery-talk] backticks in regex - tales of the unexpected part II

2014-04-08 Thread Michael Kay
t", and the \w category includes all non-spacing diacriticals. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

[xquery-talk] Random number generation : requirements

2014-05-06 Thread Michael Kay
g the EXSLT random-sequence() function, please share your experience with it. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Random number generation : requirements

2014-05-06 Thread Michael Kay
lve) or defining the semantics of how it should behave if thus annotated (much harder). For example, if f() and g() are non-deterministic functions, how do we say in the spec that in the expression (f(), g()), f should be executed before g? Michael Kay Saxonica __

Re: [xquery-talk] Random number generation : requirements

2014-05-06 Thread Michael Kay
ables are evaluated. Doing this in the spec would be much more problematic. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] [xsl] Re: Random number generation : requirements

2014-05-06 Thread Michael Kay
to do non-determinism. This exercise is about designing a deterministic way to meet the requirement. Michael Kay Saxonica On 6 May 2014, at 23:48, Michael Sokolov wrote: > On 5/6/2014 6:41 PM, Michael Kay m...@saxonica.com wrote: >>> My policy on side effects is: all expressions conta

Re: [xquery-talk] Namespace conflict ?

2014-09-16 Thread Michael Kay
//www.gym.com'. I have to admit my memory of the detail of XQuery Update is very hazy, I haven't done any work in this area for several years, so I'll have to refresh it, but it would be nice first to have confirmation of whether the question is correct as written. Michael K

Re: [xquery-talk] Namespace conflict ?

2014-09-16 Thread Michael Kay
> Is the new namespace really the same as the old, or is that a typo? > Sorry, I need to get new specs. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Namespace conflict ?

2014-09-17 Thread Michael Kay
) pair which doesn't confllct with any existing (prefix, uri) pair. Does that clarify? Michael Kay Saxonica > > declare namespace gym='http://www.mygym.com'; > > let $i:=(doc("FitnessCenter.xml")//gym:Name)[1] > > return rename node $i

Re: [xquery-talk] outer join between 2 sequences

2014-09-28 Thread Michael Kay
Note that maps give you the opportunity to hand-optimize things like this if your product's optimizer doesn't find a way to do it automatically. let $A := a set of numbers let $B := another set of numbers let $map := fold-left($B, map{}, map:put(?, ?, true())) return $A[empty($map(.))

Re: [xquery-talk] xquary update 3.0

2014-10-07 Thread Michael Kay
uery. We've fixed that in Saxon 9.6. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] XQuery 3.1 and the version declaration in a query

2014-10-26 Thread Michael Kay
I raised the issue recently here: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27094 No doubt the next draft will say exactly what should happen. Michael Kay Saxonica m...@saxonica.com +44 (0) 118 946 5893 On 26 Oct 2014, at 18:52, Benito van der Zander wrote: > Hi, > A query can

Re: [xquery-talk] Question / Suggestion : Template mechanisms and operator overloading for XQUERY 3.++ ?

2015-01-09 Thread Michael Kay
You might like to look at how Evan Lenz tackled this idea in Carrot http://www.balisage.net/Proceedings/vol7/html/Lenz01/BalisageVol7-Lenz01.html Michael Kay Saxonica m...@saxonica.com +44 (0) 118 946 5893 On 9 Jan 2015, at 07:51, jean-marc Mercier wrote: > Hello, > > I woul

Re: [xquery-talk] Necessary whitespace

2015-04-27 Thread Michael Kay
uot; as one token is not consistent with the EBNF (it doesn't lead to a valid parse), so it should be tokenized as two tokens. I don't think that has ever been the intent, and I guess section A.2.2 on delimiting and non-delimiting terminals was added to eliminate this interpretation.

Re: [xquery-talk] Serialization question

2015-04-27 Thread Michael Kay
result, so the problem didn't arise there. XQ 3.1 introduces the serialization method "adaptive" which is designed to display something, without failure, regardless what you throw at it. For attributes, it shows name="value" not just the value, which is what you app

Re: [xquery-talk] MarkLogic using JSONiq for processing JSON ?

2015-05-07 Thread Michael Kay
many differences of detail, for example XQ3.1 allows an array to be atomized, so that sum() over an array does "the right thing”. Of course these differences were all very hotly debated over a long period of time, and I wouldn’t even attempt to summarize the arguments. Michael Kay Saxon

Re: [xquery-talk] Open source XQuery processors

2015-05-07 Thread Michael Kay
Are you looking for database implementations of XQuery, or “filestore” implementations? Michael Kay Saxonica m...@saxonica.com +44 (0) 118 946 5893 > On 7 May 2015, at 18:06, Schwartz, Christine > wrote: > > I’m preparing an ALA preconference session for librarians titled “Usi

Re: [xquery-talk] MarkLogic using JSONiq for processing JSON ?

2015-05-08 Thread Michael Kay
and failed: the sequence=item model in XDM is just too deeply embedded. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Query 3.1 vs. JSONiq WAS Re: MarkLogic using JSONiq for processing JSON ?

2015-05-09 Thread Michael Kay
groups don’t really do vision and leadership: they argue about braces and semicolons. > > This can has two possible explanations: pure stupidity and lack of good will. No, I think it’s simply the result of having a variety of perspectives. Standards groups bring people together who have diffe

Re: [xquery-talk] Mistakes made in the design of XQuery 3.1

2015-05-09 Thread Michael Kay
ntics of Javascript operators wasn’t. Michael Kay Saxonica ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

  1   2   3   >