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
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/
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.
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
" 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
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(
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
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
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
;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
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
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 + .]
>>
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:
://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
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 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
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
. 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
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
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
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
>
>
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
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
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
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
.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)
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
loured by COBOL.
Michael Kay
Saxonica
___
talk@x-query.com
http://x-query.com/mailman/listinfo/talk
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
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
_
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?
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="..
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
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
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
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
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
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
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
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
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
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
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
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)
>
>
>
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
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
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
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
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
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
__
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
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
___
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
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
_
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
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
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:
&
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
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
) 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
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
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
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
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
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
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
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
>
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
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
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
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
;, "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?
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
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
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
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
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
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/&
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
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
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
t", and the \w
category includes all non-spacing diacriticals.
Michael Kay
Saxonica
___
talk@x-query.com
http://x-query.com/mailman/listinfo/talk
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
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
__
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
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
//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
> 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
) 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
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(.))
uery.
We've fixed that in Saxon 9.6.
Michael Kay
Saxonica
___
talk@x-query.com
http://x-query.com/mailman/listinfo/talk
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
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
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.
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
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
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
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
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
ntics of Javascript operators wasn’t.
Michael Kay
Saxonica
___
talk@x-query.com
http://x-query.com/mailman/listinfo/talk
1 - 100 of 243 matches
Mail list logo