﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>XQuery Talk Mailing List</title><link>http://www.stylusstudio.com/blogs/xquerytalk/</link><description>A mailing list for practical discussion about XQuery: a place to work together to learn a new language, talk about problem solutions, discuss engines and implementations, chat about the latest announcements, and so on.</description><copyright>Copyright 2004-2006 Progress Software Corporation. All Rights Reserved.</copyright><ttl>5</ttl><item><title>  why do you care what other people think ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Jim,

the yearly Digital Humanities Summer School in Oxford has a technical 
and hands-on focus on matters of XML-based text encoding and 
-transformation. They also have a dedicated Linked Data workshop this 
year (July)&#8212;although nothing specifically targeted at xQuery, so 
apologies if off-topic:

http://digital.humanities.ox.ac.uk/dhoxss/2013/workshops.html#humdata

Markus

On 5/20/13 10:08 AM, David Sewell wrote:
&gt;<i> Jim,
</I>&gt;<i>
</I>&gt;<i> The best two websites for general information on DH 
</I>&gt;<i> organizations/events are probably:
</I>&gt;<i>
</I>&gt;<i> http://adho.org/
</I>&gt;<i> http://dh2013.unl.edu/
</I>&gt;<i>
</I>&gt;<i> Also, the people within the DH community who are most interested in 
</I>&gt;<i> XML from a theoretical perspective can usually be found at the 
</I>&gt;<i> Balisage meetings: http://www.balisage.net/.
</I>&gt;<i>
</I>&gt;<i> David
</I>&gt;<i>
</I>&gt;<i> On Mon, 20 May 2013, James Fuller wrote:
</I>&gt;<i>
</I>&gt;&gt;<i> Hello David,
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> On Mon, May 20, 2013 at 3:46 PM, David Sewell &lt;http://x-query.com/mailman/listinfo/talk&gt; 
</I>&gt;&gt;<i> wrote:
</I>&gt;&gt;<i> ...
</I>&gt;&gt;&gt;<i> the oXygen editor/IDE). Even if the community of users is small by
</I>&gt;&gt;&gt;<i> comparison with Javascript or Perl or whatever, the impact of 
</I>&gt;&gt;&gt;<i> projects that
</I>&gt;&gt;&gt;<i> rely on XQuery is, I suspect, much greater than people realize.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Great to confirm Uche's reliable instincts.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Wondering what are the top venues (conferences, training, etc) where
</I>&gt;&gt;<i> digital humanities folk 'live' ?
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> I would also be interested in hearing what kind of problems these
</I>&gt;&gt;<i> folks are trying to solve.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> thx, Jim
</I>&gt;&gt;<i>
</I>&gt;<i>
</I>

-- 
Markus Flatscher, Editorial and Technical Specialist
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville VA 22904, USA
Courier: 211 Emmet Street South, Charlottesville VA 22903, USA
Email: http://x-query.com/mailman/listinfo/talk
Web: http://rotunda.upress.virginia.edu/

</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004105.html</link><pubDate>Mon, 20 May 2013 09:51:20 GMT</pubDate></item><item><title>  why do you care what other people think ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Jim,

the yearly Digital Humanities Summer School in Oxford has a technical 
and hands-on focus on matters of XML-based text encoding and 
-transformation. They also have a dedicated Linked Data workshop this 
year (July)&#8212;although nothing specifically targeted at xQuery, so 
apologies if off-topic:

http://digital.humanities.ox.ac.uk/dhoxss/2013/workshops.html#humdata

Markus

On 5/20/13 10:08 AM, David Sewell wrote:
&gt;<i> Jim,
</I>&gt;<i>
</I>&gt;<i> The best two websites for general information on DH 
</I>&gt;<i> organizations/events are probably:
</I>&gt;<i>
</I>&gt;<i> http://adho.org/
</I>&gt;<i> http://dh2013.unl.edu/
</I>&gt;<i>
</I>&gt;<i> Also, the people within the DH community who are most interested in 
</I>&gt;<i> XML from a theoretical perspective can usually be found at the 
</I>&gt;<i> Balisage meetings: http://www.balisage.net/.
</I>&gt;<i>
</I>&gt;<i> David
</I>&gt;<i>
</I>&gt;<i> On Mon, 20 May 2013, James Fuller wrote:
</I>&gt;<i>
</I>&gt;&gt;<i> Hello David,
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> On Mon, May 20, 2013 at 3:46 PM, David Sewell &lt;http://x-query.com/mailman/listinfo/talk&gt; 
</I>&gt;&gt;<i> wrote:
</I>&gt;&gt;<i> ...
</I>&gt;&gt;&gt;<i> the oXygen editor/IDE). Even if the community of users is small by
</I>&gt;&gt;&gt;<i> comparison with Javascript or Perl or whatever, the impact of 
</I>&gt;&gt;&gt;<i> projects that
</I>&gt;&gt;&gt;<i> rely on XQuery is, I suspect, much greater than people realize.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Great to confirm Uche's reliable instincts.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Wondering what are the top venues (conferences, training, etc) where
</I>&gt;&gt;<i> digital humanities folk 'live' ?
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> I would also be interested in hearing what kind of problems these
</I>&gt;&gt;<i> folks are trying to solve.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> thx, Jim
</I>&gt;&gt;<i>
</I>&gt;<i>
</I>

-- 
Markus Flatscher, Editorial and Technical Specialist
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville VA 22904, USA
Courier: 211 Emmet Street South, Charlottesville VA 22903, USA
Email: http://x-query.com/mailman/listinfo/talk
Web: http://rotunda.upress.virginia.edu/

</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004105.html?utm_source=feedly</link><pubDate>Mon, 20 May 2013 09:51:20 GMT</pubDate></item><item><title>  why do you care what other people think ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Jim,

The best two websites for general information on DH organizations/events are 
probably:

http://adho.org/
http://dh2013.unl.edu/

Also, the people within the DH community who are most interested in XML from a 
theoretical perspective can usually be found at the Balisage meetings: 
http://www.balisage.net/.

David

On Mon, 20 May 2013, James Fuller wrote:

&gt;<i> Hello David,
</I>&gt;<i>
</I>&gt;<i> On Mon, May 20, 2013 at 3:46 PM, David Sewell &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
</I>&gt;<i> ...
</I>&gt;&gt;<i> the oXygen editor/IDE). Even if the community of users is small by
</I>&gt;&gt;<i> comparison with Javascript or Perl or whatever, the impact of projects that
</I>&gt;&gt;<i> rely on XQuery is, I suspect, much greater than people realize.
</I>&gt;<i>
</I>&gt;<i> Great to confirm Uche's reliable instincts.
</I>&gt;<i>
</I>&gt;<i> Wondering what are the top venues (conferences, training, etc) where
</I>&gt;<i> digital humanities folk 'live' ?
</I>&gt;<i>
</I>&gt;<i> I would also be interested in hearing what kind of problems these
</I>&gt;<i> folks are trying to solve.
</I>&gt;<i>
</I>&gt;<i> thx, Jim
</I>&gt;<i>
</I>
-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: http://x-query.com/mailman/listinfo/talk   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
</PRE>




]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004101.html</link><pubDate>Mon, 20 May 2013 07:08:04 GMT</pubDate></item><item><title>  why do you care what other people think ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Jim,

The best two websites for general information on DH organizations/events are 
probably:

http://adho.org/
http://dh2013.unl.edu/

Also, the people within the DH community who are most interested in XML from a 
theoretical perspective can usually be found at the Balisage meetings: 
http://www.balisage.net/.

David

On Mon, 20 May 2013, James Fuller wrote:

&gt;<i> Hello David,
</I>&gt;<i>
</I>&gt;<i> On Mon, May 20, 2013 at 3:46 PM, David Sewell &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
</I>&gt;<i> ...
</I>&gt;&gt;<i> the oXygen editor/IDE). Even if the community of users is small by
</I>&gt;&gt;<i> comparison with Javascript or Perl or whatever, the impact of projects that
</I>&gt;&gt;<i> rely on XQuery is, I suspect, much greater than people realize.
</I>&gt;<i>
</I>&gt;<i> Great to confirm Uche's reliable instincts.
</I>&gt;<i>
</I>&gt;<i> Wondering what are the top venues (conferences, training, etc) where
</I>&gt;<i> digital humanities folk 'live' ?
</I>&gt;<i>
</I>&gt;<i> I would also be interested in hearing what kind of problems these
</I>&gt;<i> folks are trying to solve.
</I>&gt;<i>
</I>&gt;<i> thx, Jim
</I>&gt;<i>
</I>
-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: http://x-query.com/mailman/listinfo/talk   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
</PRE>




]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004101.html?utm_source=feedly</link><pubDate>Mon, 20 May 2013 07:08:04 GMT</pubDate></item><item><title>  why do you care what other people think ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hello David,

On Mon, May 20, 2013 at 3:46 PM, David Sewell &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
...
&gt;<i> the oXygen editor/IDE). Even if the community of users is small by
</I>&gt;<i> comparison with Javascript or Perl or whatever, the impact of projects that
</I>&gt;<i> rely on XQuery is, I suspect, much greater than people realize.
</I>
Great to confirm Uche's reliable instincts.

Wondering what are the top venues (conferences, training, etc) where
digital humanities folk 'live' ?

I would also be interested in hearing what kind of problems these
folks are trying to solve.

thx, Jim
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004100.html</link><pubDate>Mon, 20 May 2013 06:58:37 GMT</pubDate></item><item><title>  why do you care what other people think ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hello David,

On Mon, May 20, 2013 at 3:46 PM, David Sewell &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
...
&gt;<i> the oXygen editor/IDE). Even if the community of users is small by
</I>&gt;<i> comparison with Javascript or Perl or whatever, the impact of projects that
</I>&gt;<i> rely on XQuery is, I suspect, much greater than people realize.
</I>
Great to confirm Uche's reliable instincts.

Wondering what are the top venues (conferences, training, etc) where
digital humanities folk 'live' ?

I would also be interested in hearing what kind of problems these
folks are trying to solve.

thx, Jim
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004100.html?utm_source=feedly</link><pubDate>Mon, 20 May 2013 06:58:37 GMT</pubDate></item><item><title>  why do you care what other people think ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Sat, 18 May 2013, James Fuller wrote:

&gt;<i> Uche Ogbuji reminded us at last XML Prague to reach out to the digital
</I>&gt;<i> humanities folks ... and I think this is an especially relevant group
</I>&gt;<i> of people we should be trying to engage; librarians love this little
</I>&gt;<i> language.
</I>
Speaking as someone in the digital humanities community, I am extremely grateful 
for the work that has been done on XQuery and on the entire suite of XML-related 
W3C technologies (XPath, XSLT, etc.) within the W3C working groups and by 
independent developers. As a self-taught programmer without a computer science 
background, I can't evaluate the theoretical arguments pro or against different 
styles of programming languages; all I know is that in the practical world, it 
is almost inconceivable that the projects I have worked on for the last decade 
could have been achieved as well as they have without XQuery and the tools built 
upon it (notably Saxon, MarkLogic, and the oXygen editor/IDE). Even if the 
community of users is small by comparison with Javascript or Perl or whatever, 
the impact of projects that rely on XQuery is, I suspect, much greater than 
people realize.

David


-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: http://x-query.com/mailman/listinfo/talk   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004099.html</link><pubDate>Mon, 20 May 2013 06:46:57 GMT</pubDate></item><item><title>  why do you care what other people think ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Sat, 18 May 2013, James Fuller wrote:

&gt;<i> Uche Ogbuji reminded us at last XML Prague to reach out to the digital
</I>&gt;<i> humanities folks ... and I think this is an especially relevant group
</I>&gt;<i> of people we should be trying to engage; librarians love this little
</I>&gt;<i> language.
</I>
Speaking as someone in the digital humanities community, I am extremely grateful 
for the work that has been done on XQuery and on the entire suite of XML-related 
W3C technologies (XPath, XSLT, etc.) within the W3C working groups and by 
independent developers. As a self-taught programmer without a computer science 
background, I can't evaluate the theoretical arguments pro or against different 
styles of programming languages; all I know is that in the practical world, it 
is almost inconceivable that the projects I have worked on for the last decade 
could have been achieved as well as they have without XQuery and the tools built 
upon it (notably Saxon, MarkLogic, and the oXygen editor/IDE). Even if the 
community of users is small by comparison with Javascript or Perl or whatever, 
the impact of projects that rely on XQuery is, I suspect, much greater than 
people realize.

David


-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: http://x-query.com/mailman/listinfo/talk   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004099.html?utm_source=feedly</link><pubDate>Mon, 20 May 2013 06:46:57 GMT</pubDate></item><item><title>  why do you care what other people think ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Sat, May 18, 2013 at 2:32 AM, daniela florescu &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> I have to apologize on this mailing list first for completely scaring one of
</I>&gt;<i> potential XQuery's customers a couple of days back.
</I>&gt;<i> (he never answered back... oups... I will always wonder if he solved his
</I>&gt;<i> problem...)
</I>
reach out to him by email and ask ?

&gt;<i> This is not how science works.
</I>
XQuery is a unique, cool, interesting and great programming language,
it combines a query language with the power of a stored proc language
in one = GSD, it plays well with my other favorite tool xslt, XQuery
3.0 'fpness' gives me joy when I program (akin to when I spelunked
deeply in Perl) and joy in programming is a rare and wondrous thing.

Practically speaking, xquery generates career paths and with the
market now recognizing that data led decision making is better then
punditry, things look good for xquery (we should be positive about
that). We are living in a time where all the 'oxygen of choice' is
consumed by javascript ... it means we have to expend more energy to
get the word out about this incredibly productive little language.

With the data revolution going, we have a very good chance to
establish a grass roots foundation, which I think is where our efforts
are best focused versus the 'rocket science' end which I think you are
espousing ... we need materials for training (for students and
teachers), we need to tell students about the potential for a career
programming in xquery.

Uche Ogbuji reminded us at last XML Prague to reach out to the digital
humanities folks ... and I think this is an especially relevant group
of people we should be trying to engage; librarians love this little
language.

Daniela you've probably done more to try and make xquery used and
known within the academic community  (number of papers, advocation,
etc) then anyone; its a real achievement and I hear what you are
saying but I don't fully grok what you are proposing. From one angle,
I think your call for 'more science' could be construed as yet another
variation of the desire for 'wide spread adoption'; the book you read
taught you to ignore other people and yet you want more of these
people to use your favorite tool ?

Confused as to what you are concretely proposing, but interested and
will help 'pull the oar' once I understand.

Jim Fuller
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004098.html</link><pubDate>Fri, 17 May 2013 23:42:10 GMT</pubDate></item><item><title>  why do you care what other people think ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Sat, May 18, 2013 at 2:32 AM, daniela florescu &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> I have to apologize on this mailing list first for completely scaring one of
</I>&gt;<i> potential XQuery's customers a couple of days back.
</I>&gt;<i> (he never answered back... oups... I will always wonder if he solved his
</I>&gt;<i> problem...)
</I>
reach out to him by email and ask ?

&gt;<i> This is not how science works.
</I>
XQuery is a unique, cool, interesting and great programming language,
it combines a query language with the power of a stored proc language
in one = GSD, it plays well with my other favorite tool xslt, XQuery
3.0 'fpness' gives me joy when I program (akin to when I spelunked
deeply in Perl) and joy in programming is a rare and wondrous thing.

Practically speaking, xquery generates career paths and with the
market now recognizing that data led decision making is better then
punditry, things look good for xquery (we should be positive about
that). We are living in a time where all the 'oxygen of choice' is
consumed by javascript ... it means we have to expend more energy to
get the word out about this incredibly productive little language.

With the data revolution going, we have a very good chance to
establish a grass roots foundation, which I think is where our efforts
are best focused versus the 'rocket science' end which I think you are
espousing ... we need materials for training (for students and
teachers), we need to tell students about the potential for a career
programming in xquery.

Uche Ogbuji reminded us at last XML Prague to reach out to the digital
humanities folks ... and I think this is an especially relevant group
of people we should be trying to engage; librarians love this little
language.

Daniela you've probably done more to try and make xquery used and
known within the academic community  (number of papers, advocation,
etc) then anyone; its a real achievement and I hear what you are
saying but I don't fully grok what you are proposing. From one angle,
I think your call for 'more science' could be construed as yet another
variation of the desire for 'wide spread adoption'; the book you read
taught you to ignore other people and yet you want more of these
people to use your favorite tool ?

Confused as to what you are concretely proposing, but interested and
will help 'pull the oar' once I understand.

Jim Fuller
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004098.html?utm_source=feedly</link><pubDate>Fri, 17 May 2013 23:42:10 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 05/16/2013 08:20 AM, David Lee wrote:
&gt;<i> -----------
</I>&gt;<i>
</I>&gt;<i> This is the &quot;Promised Land of Milk and Honey&quot; that I have been told about ...
</I>&gt;<i>
</I>&gt;<i>    
</I>Look at what has been achieved with Java byte compilation, or -- 
Javascript to ASM ! -- who would have expected that in 1995?  Well, not 
me anyway.  I tend to think this has to do with adoption ... the 
interest in Javascript now is overwhelming, and it is embedded in every 
web application in the world, in possibly the most performance-sensitive 
part of it, so more attention gets paid to improving it.  Also it 
started with a low bar, so the improvement has been impressive.  I 
suspect that with a similar amount of incentive, XQuery would get 
optimized to take advantage of processor optimizations.
&gt;<i>   Adding the ability to &quot;open a crack&quot; from the functional to procedural
</I>&gt;<i> allows users to achieve optimizations simply not practical by the optimizer.  Or atleast be able to write code that they can understand.    This is why I am seriously suggesting that  XQuery and XSLT (and MAYBE XPath ... but not so convinced on xpath) be opened up *philosophically* to non-functional paradigms.   Maybe not the whole floodgate, but bits.
</I>&gt;<i>
</I>&gt;<i>    
</I>Part of the reason XQuery hasn't achieved wider acceptance, in my view, 
is the whole functional mindset.  Forget for a moment about 
performance.  People program in what they like to read and write (if 
they have a choice), preferably in a language that makes it easy to 
conceptualize a solution to a problem. People who take the trouble to 
learn how to program functionally generally come to appreciate it, but 
it doesn't seem to be the most natural idiom, and for the many 
programmers, it presents real difficulties.  One might suppose this is 
due to what is learned in school, but Scheme was the teaching language 
in vogue when I was learning, and still we bred a generation of C 
programmers.  Even XSLT I think presents a barrier of this sort, 
although somehow adoption is greater - perhaps because the 
pattern-matching rules engine fits another conceptual model?

Just stating the semi-obvious: not sure what that means for &quot;the future 
of XQuery&quot; or whatever.

-Mike
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004097.html</link><pubDate>Thu, 16 May 2013 05:56:41 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 05/16/2013 08:20 AM, David Lee wrote:
&gt;<i> -----------
</I>&gt;<i>
</I>&gt;<i> This is the &quot;Promised Land of Milk and Honey&quot; that I have been told about ...
</I>&gt;<i>
</I>&gt;<i>    
</I>Look at what has been achieved with Java byte compilation, or -- 
Javascript to ASM ! -- who would have expected that in 1995?  Well, not 
me anyway.  I tend to think this has to do with adoption ... the 
interest in Javascript now is overwhelming, and it is embedded in every 
web application in the world, in possibly the most performance-sensitive 
part of it, so more attention gets paid to improving it.  Also it 
started with a low bar, so the improvement has been impressive.  I 
suspect that with a similar amount of incentive, XQuery would get 
optimized to take advantage of processor optimizations.
&gt;<i>   Adding the ability to &quot;open a crack&quot; from the functional to procedural
</I>&gt;<i> allows users to achieve optimizations simply not practical by the optimizer.  Or atleast be able to write code that they can understand.    This is why I am seriously suggesting that  XQuery and XSLT (and MAYBE XPath ... but not so convinced on xpath) be opened up *philosophically* to non-functional paradigms.   Maybe not the whole floodgate, but bits.
</I>&gt;<i>
</I>&gt;<i>    
</I>Part of the reason XQuery hasn't achieved wider acceptance, in my view, 
is the whole functional mindset.  Forget for a moment about 
performance.  People program in what they like to read and write (if 
they have a choice), preferably in a language that makes it easy to 
conceptualize a solution to a problem. People who take the trouble to 
learn how to program functionally generally come to appreciate it, but 
it doesn't seem to be the most natural idiom, and for the many 
programmers, it presents real difficulties.  One might suppose this is 
due to what is learned in school, but Scheme was the teaching language 
in vogue when I was learning, and still we bred a generation of C 
programmers.  Even XSLT I think presents a barrier of this sort, 
although somehow adoption is greater - perhaps because the 
pattern-matching rules engine fits another conceptual model?

Just stating the semi-obvious: not sure what that means for &quot;the future 
of XQuery&quot; or whatever.

-Mike
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004097.html?utm_source=feedly</link><pubDate>Thu, 16 May 2013 05:56:41 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Stop thinking like you only have one tool in your toolbox!  Would you use a pliers to drive in a screw?  I use many languages and XQuery is one of them.  Each language has its strengths and weaknesses.

Sent from my iPhone

On May 16, 2013, at 7:20 AM, David Lee &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:

&gt;&gt;&gt;<i> Liam
</I>
I'm not sure I'm failing to follow you incorrectly here.
------  Someone is failing somethign :)_

Yes, declarative languages, especially with referential transparency,
are often massively easier to optimize than procedural ones. Or rather,
the computer science and mathematics might be harder in some cases, but
the optimizations can be more far-reaching. The down side is that they
tend to start out slower, so it doesn't always balance out. *BUT* they
are also often more maintainable.
-----------

This is the &quot;Promised Land of Milk and Honey&quot; that I have been told about ...
And I can believe it in some cases.  
What I boldly propose out of ignorance is that in reality its somewhat (mostly?) BS.
Like the class I took in collage about proving computer programs ... it only worked
if your program was about 3 lines or less beyond that it was *effectively* impossible.
I know many kinds of optimizations are possible (and yea have been achieved) with purely functional languages.
Query Optimization of SQL has some very deep proof of this and I suspect that may have been the rational
behind XQuery and XSLT.   But in reality ... at least the reality I have absorbed by attending conferences,
reading papers, talking with implementers, and delving deeply into the guts of real world XQuery and XSLT processors ....
that reality has come up short from the promise.   There are a huge range of *possible* optimizations that
simply never get achieved.    Its *HARD* ... I am not blaming the implementers.    There is Theory  and then there is Engineering.  (and lets not forget time and money).
One example is parallelism.   A purely functional language should be able to be highly paralyzed automatically.
But what we have seen, is that few vendors do this at all, or very little.  
I know from Mr Kay's papers he has had some success,
but largely by introducing vendor (and now some standard) specific &quot;hints&quot; into the language to allow for points where parallism can be recognized  and he himself has stated that reality has not lived up to the ideal.
The comment about XQuery and cache hits I propose is theory not practice ... unless one implements XQuery in machine 
language *directly* (the implementations I have seen are interpretive or late compiled to bytecode ... ), 
then the illusion that xquery statements will actually fit snugly in cachelines is an illusion.   Now if someone does write a direct XQuery to machine code compiler that might be valid ... maybe there is one, would love to see the paper at Balisage.
So what are the languages people write XQuery compilers in *really* ? What I have seen is C, C++ and Java.  I am sure there are more.   And *those* implementations are highly optimized using non-functional techniques.   So in summary I just dont buy the &quot;functional languages inherantly optimize better&quot; angle.   Maybe in theory ... and maybe in some select cases, but not globally in practice.  
Global *mutable* variables are another example.   To avoid them 100% can be very difficult and results in code that in theory should be optimized but in practice is often not. And can be very &quot;ugly&quot; by some standards.
Adding the ability to &quot;open a crack&quot; from the functional to procedural
allows users to achieve optimizations simply not practical by the optimizer.  Or atleast be able to write code that they can understand.    This is why I am seriously suggesting that  XQuery and XSLT (and MAYBE XPath ... but not so convinced on xpath) be opened up *philosophically* to non-functional paradigms.   Maybe not the whole floodgate, but bits.
The bits that vendors have found necessary to introduce ... Yes in theory this lets the cat out of the bag, and the camels nose in the tent and cats will sleep with dogs and the world will end .... But on the other hand maybe just a few carefully chosen idioms that &quot;brake the shackles of pure functional programming&quot;  could be a good thing.  For one maybe it would encourage vendors to switch over from their vendor specific holes and instead use the standard ones thus making XQuery and XSLT more portable do agree with a layered approach.   You dont have to sink the entire ship with this, you can *document* where use of such a bastard might unduly affect the optimizer and let the user decide.   
For Layered Approaches, XQuery scripting is one,  xproc another, xmlsh another.
But I suggest the layer is too high.   I suggest XQuery has grown in use to more complexity then possibly imagined at the beginning.  Whole apps are being written in XQuery alone.   So maybe the layer should be a little deeper *into* the language instead of above of.  ( This is why I am shy of suggesting xpath itself break the mold of purely functional,
it might actually be the layer where pure functional ideology works).

I know from a standards committee perspective this is a nearly impossible task ... so instead I just rant on a mailing list.  Maybe someone will see the view ... or intelligently disagree, or just think about it for a second before abandoning it as the ramblings of an insane apostate  ... or maybe I will just be beat to a pulp.

All in all a good day :)

-David



_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004096.html</link><pubDate>Thu, 16 May 2013 05:37:10 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Stop thinking like you only have one tool in your toolbox!  Would you use a pliers to drive in a screw?  I use many languages and XQuery is one of them.  Each language has its strengths and weaknesses.

Sent from my iPhone

On May 16, 2013, at 7:20 AM, David Lee &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:

&gt;&gt;&gt;<i> Liam
</I>
I'm not sure I'm failing to follow you incorrectly here.
------  Someone is failing somethign :)_

Yes, declarative languages, especially with referential transparency,
are often massively easier to optimize than procedural ones. Or rather,
the computer science and mathematics might be harder in some cases, but
the optimizations can be more far-reaching. The down side is that they
tend to start out slower, so it doesn't always balance out. *BUT* they
are also often more maintainable.
-----------

This is the &quot;Promised Land of Milk and Honey&quot; that I have been told about ...
And I can believe it in some cases.  
What I boldly propose out of ignorance is that in reality its somewhat (mostly?) BS.
Like the class I took in collage about proving computer programs ... it only worked
if your program was about 3 lines or less beyond that it was *effectively* impossible.
I know many kinds of optimizations are possible (and yea have been achieved) with purely functional languages.
Query Optimization of SQL has some very deep proof of this and I suspect that may have been the rational
behind XQuery and XSLT.   But in reality ... at least the reality I have absorbed by attending conferences,
reading papers, talking with implementers, and delving deeply into the guts of real world XQuery and XSLT processors ....
that reality has come up short from the promise.   There are a huge range of *possible* optimizations that
simply never get achieved.    Its *HARD* ... I am not blaming the implementers.    There is Theory  and then there is Engineering.  (and lets not forget time and money).
One example is parallelism.   A purely functional language should be able to be highly paralyzed automatically.
But what we have seen, is that few vendors do this at all, or very little.  
I know from Mr Kay's papers he has had some success,
but largely by introducing vendor (and now some standard) specific &quot;hints&quot; into the language to allow for points where parallism can be recognized  and he himself has stated that reality has not lived up to the ideal.
The comment about XQuery and cache hits I propose is theory not practice ... unless one implements XQuery in machine 
language *directly* (the implementations I have seen are interpretive or late compiled to bytecode ... ), 
then the illusion that xquery statements will actually fit snugly in cachelines is an illusion.   Now if someone does write a direct XQuery to machine code compiler that might be valid ... maybe there is one, would love to see the paper at Balisage.
So what are the languages people write XQuery compilers in *really* ? What I have seen is C, C++ and Java.  I am sure there are more.   And *those* implementations are highly optimized using non-functional techniques.   So in summary I just dont buy the &quot;functional languages inherantly optimize better&quot; angle.   Maybe in theory ... and maybe in some select cases, but not globally in practice.  
Global *mutable* variables are another example.   To avoid them 100% can be very difficult and results in code that in theory should be optimized but in practice is often not. And can be very &quot;ugly&quot; by some standards.
Adding the ability to &quot;open a crack&quot; from the functional to procedural
allows users to achieve optimizations simply not practical by the optimizer.  Or atleast be able to write code that they can understand.    This is why I am seriously suggesting that  XQuery and XSLT (and MAYBE XPath ... but not so convinced on xpath) be opened up *philosophically* to non-functional paradigms.   Maybe not the whole floodgate, but bits.
The bits that vendors have found necessary to introduce ... Yes in theory this lets the cat out of the bag, and the camels nose in the tent and cats will sleep with dogs and the world will end .... But on the other hand maybe just a few carefully chosen idioms that &quot;brake the shackles of pure functional programming&quot;  could be a good thing.  For one maybe it would encourage vendors to switch over from their vendor specific holes and instead use the standard ones thus making XQuery and XSLT more portable do agree with a layered approach.   You dont have to sink the entire ship with this, you can *document* where use of such a bastard might unduly affect the optimizer and let the user decide.   
For Layered Approaches, XQuery scripting is one,  xproc another, xmlsh another.
But I suggest the layer is too high.   I suggest XQuery has grown in use to more complexity then possibly imagined at the beginning.  Whole apps are being written in XQuery alone.   So maybe the layer should be a little deeper *into* the language instead of above of.  ( This is why I am shy of suggesting xpath itself break the mold of purely functional,
it might actually be the layer where pure functional ideology works).

I know from a standards committee perspective this is a nearly impossible task ... so instead I just rant on a mailing list.  Maybe someone will see the view ... or intelligently disagree, or just think about it for a second before abandoning it as the ramblings of an insane apostate  ... or maybe I will just be beat to a pulp.

All in all a good day :)

-David



_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004096.html?utm_source=feedly</link><pubDate>Thu, 16 May 2013 05:37:10 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;&gt;&gt;<i> Liam
</I>
I'm not sure I'm failing to follow you incorrectly here.
------  Someone is failing somethign :)_

Yes, declarative languages, especially with referential transparency,
are often massively easier to optimize than procedural ones. Or rather,
the computer science and mathematics might be harder in some cases, but
the optimizations can be more far-reaching. The down side is that they
tend to start out slower, so it doesn't always balance out. *BUT* they
are also often more maintainable.
-----------

This is the &quot;Promised Land of Milk and Honey&quot; that I have been told about ...
And I can believe it in some cases.  
What I boldly propose out of ignorance is that in reality its somewhat (mostly?) BS.
Like the class I took in collage about proving computer programs ... it only worked
if your program was about 3 lines or less beyond that it was *effectively* impossible.
I know many kinds of optimizations are possible (and yea have been achieved) with purely functional languages.
Query Optimization of SQL has some very deep proof of this and I suspect that may have been the rational
behind XQuery and XSLT.   But in reality ... at least the reality I have absorbed by attending conferences,
reading papers, talking with implementers, and delving deeply into the guts of real world XQuery and XSLT processors ....
that reality has come up short from the promise.   There are a huge range of *possible* optimizations that
simply never get achieved.    Its *HARD* ... I am not blaming the implementers.    There is Theory  and then there is Engineering.  (and lets not forget time and money).
One example is parallelism.   A purely functional language should be able to be highly paralyzed automatically.
But what we have seen, is that few vendors do this at all, or very little.  
 I know from Mr Kay's papers he has had some success,
but largely by introducing vendor (and now some standard) specific &quot;hints&quot; into the language to allow for points where parallism can be recognized  and he himself has stated that reality has not lived up to the ideal.
The comment about XQuery and cache hits I propose is theory not practice ... unless one implements XQuery in machine 
language *directly* (the implementations I have seen are interpretive or late compiled to bytecode ... ), 
then the illusion that xquery statements will actually fit snugly in cachelines is an illusion.   Now if someone does write a direct XQuery to machine code compiler that might be valid ... maybe there is one, would love to see the paper at Balisage.
So what are the languages people write XQuery compilers in *really* ? What I have seen is C, C++ and Java.  I am sure there are more.   And *those* implementations are highly optimized using non-functional techniques.   So in summary I just dont buy the &quot;functional languages inherantly optimize better&quot; angle.   Maybe in theory ... and maybe in some select cases, but not globally in practice.  
Global *mutable* variables are another example.   To avoid them 100% can be very difficult and results in code that in theory should be optimized but in practice is often not. And can be very &quot;ugly&quot; by some standards.
 Adding the ability to &quot;open a crack&quot; from the functional to procedural
allows users to achieve optimizations simply not practical by the optimizer.  Or atleast be able to write code that they can understand.    This is why I am seriously suggesting that  XQuery and XSLT (and MAYBE XPath ... but not so convinced on xpath) be opened up *philosophically* to non-functional paradigms.   Maybe not the whole floodgate, but bits.
The bits that vendors have found necessary to introduce ... Yes in theory this lets the cat out of the bag, and the camels nose in the tent and cats will sleep with dogs and the world will end .... But on the other hand maybe just a few carefully chosen idioms that &quot;brake the shackles of pure functional programming&quot;  could be a good thing.  For one maybe it would encourage vendors to switch over from their vendor specific holes and instead use the standard ones thus making XQuery and XSLT more portable do agree with a layered approach.   You dont have to sink the entire ship with this, you can *document* where use of such a bastard might unduly affect the optimizer and let the user decide.   
For Layered Approaches, XQuery scripting is one,  xproc another, xmlsh another.
But I suggest the layer is too high.   I suggest XQuery has grown in use to more complexity then possibly imagined at the beginning.  Whole apps are being written in XQuery alone.   So maybe the layer should be a little deeper *into* the language instead of above of.  ( This is why I am shy of suggesting xpath itself break the mold of purely functional,
it might actually be the layer where pure functional ideology works).

 I know from a standards committee perspective this is a nearly impossible task ... so instead I just rant on a mailing list.  Maybe someone will see the view ... or intelligently disagree, or just think about it for a second before abandoning it as the ramblings of an insane apostate  ... or maybe I will just be beat to a pulp.

All in all a good day :)

-David



</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004095.html</link><pubDate>Thu, 16 May 2013 05:20:26 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;&gt;&gt;<i> Liam
</I>
I'm not sure I'm failing to follow you incorrectly here.
------  Someone is failing somethign :)_

Yes, declarative languages, especially with referential transparency,
are often massively easier to optimize than procedural ones. Or rather,
the computer science and mathematics might be harder in some cases, but
the optimizations can be more far-reaching. The down side is that they
tend to start out slower, so it doesn't always balance out. *BUT* they
are also often more maintainable.
-----------

This is the &quot;Promised Land of Milk and Honey&quot; that I have been told about ...
And I can believe it in some cases.  
What I boldly propose out of ignorance is that in reality its somewhat (mostly?) BS.
Like the class I took in collage about proving computer programs ... it only worked
if your program was about 3 lines or less beyond that it was *effectively* impossible.
I know many kinds of optimizations are possible (and yea have been achieved) with purely functional languages.
Query Optimization of SQL has some very deep proof of this and I suspect that may have been the rational
behind XQuery and XSLT.   But in reality ... at least the reality I have absorbed by attending conferences,
reading papers, talking with implementers, and delving deeply into the guts of real world XQuery and XSLT processors ....
that reality has come up short from the promise.   There are a huge range of *possible* optimizations that
simply never get achieved.    Its *HARD* ... I am not blaming the implementers.    There is Theory  and then there is Engineering.  (and lets not forget time and money).
One example is parallelism.   A purely functional language should be able to be highly paralyzed automatically.
But what we have seen, is that few vendors do this at all, or very little.  
 I know from Mr Kay's papers he has had some success,
but largely by introducing vendor (and now some standard) specific &quot;hints&quot; into the language to allow for points where parallism can be recognized  and he himself has stated that reality has not lived up to the ideal.
The comment about XQuery and cache hits I propose is theory not practice ... unless one implements XQuery in machine 
language *directly* (the implementations I have seen are interpretive or late compiled to bytecode ... ), 
then the illusion that xquery statements will actually fit snugly in cachelines is an illusion.   Now if someone does write a direct XQuery to machine code compiler that might be valid ... maybe there is one, would love to see the paper at Balisage.
So what are the languages people write XQuery compilers in *really* ? What I have seen is C, C++ and Java.  I am sure there are more.   And *those* implementations are highly optimized using non-functional techniques.   So in summary I just dont buy the &quot;functional languages inherantly optimize better&quot; angle.   Maybe in theory ... and maybe in some select cases, but not globally in practice.  
Global *mutable* variables are another example.   To avoid them 100% can be very difficult and results in code that in theory should be optimized but in practice is often not. And can be very &quot;ugly&quot; by some standards.
 Adding the ability to &quot;open a crack&quot; from the functional to procedural
allows users to achieve optimizations simply not practical by the optimizer.  Or atleast be able to write code that they can understand.    This is why I am seriously suggesting that  XQuery and XSLT (and MAYBE XPath ... but not so convinced on xpath) be opened up *philosophically* to non-functional paradigms.   Maybe not the whole floodgate, but bits.
The bits that vendors have found necessary to introduce ... Yes in theory this lets the cat out of the bag, and the camels nose in the tent and cats will sleep with dogs and the world will end .... But on the other hand maybe just a few carefully chosen idioms that &quot;brake the shackles of pure functional programming&quot;  could be a good thing.  For one maybe it would encourage vendors to switch over from their vendor specific holes and instead use the standard ones thus making XQuery and XSLT more portable do agree with a layered approach.   You dont have to sink the entire ship with this, you can *document* where use of such a bastard might unduly affect the optimizer and let the user decide.   
For Layered Approaches, XQuery scripting is one,  xproc another, xmlsh another.
But I suggest the layer is too high.   I suggest XQuery has grown in use to more complexity then possibly imagined at the beginning.  Whole apps are being written in XQuery alone.   So maybe the layer should be a little deeper *into* the language instead of above of.  ( This is why I am shy of suggesting xpath itself break the mold of purely functional,
it might actually be the layer where pure functional ideology works).

 I know from a standards committee perspective this is a nearly impossible task ... so instead I just rant on a mailing list.  Maybe someone will see the view ... or intelligently disagree, or just think about it for a second before abandoning it as the ramblings of an insane apostate  ... or maybe I will just be beat to a pulp.

All in all a good day :)

-David



</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004095.html?utm_source=feedly</link><pubDate>Thu, 16 May 2013 05:20:26 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;<i> Could you elaborate on the bigger picture? Are you running through a pile of
</I>&gt;<i> data, trying to accumulate information along the way, and want to use that
</I>&gt;<i> afterwards? Or is it something entirely different that you are trying to
</I>&gt;<i> achieve?
</I>
It sounds like they want the equivalent of a TreeSet.... and there are
various ways to achieve that - such as appending to a sequence and
then using distinct-values() on the getter.



-- 
Andrew Welch
http://andrewjwelch.com
</PRE>





]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004094.html</link><pubDate>Thu, 16 May 2013 02:21:34 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;<i> Could you elaborate on the bigger picture? Are you running through a pile of
</I>&gt;<i> data, trying to accumulate information along the way, and want to use that
</I>&gt;<i> afterwards? Or is it something entirely different that you are trying to
</I>&gt;<i> achieve?
</I>
It sounds like they want the equivalent of a TreeSet.... and there are
various ways to achieve that - such as appending to a sequence and
then using distinct-values() on the getter.



-- 
Andrew Welch
http://andrewjwelch.com
</PRE>





]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004094.html?utm_source=feedly</link><pubDate>Thu, 16 May 2013 02:21:34 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
On May 15, 2013, at 9:39 PM, Liam R E Quin wrote:

&gt;<i> On Thu, 2013-05-16 at 00:22 +0000, David Lee wrote:
</I>&gt;&gt;<i> I still am unconvinced that the theory that a purely functional
</I>&gt;&gt;<i> language would enable vastly better optimizations
</I>&gt;&gt;<i> has yet to be realized in the real world and may never be.
</I>&gt;<i> 
</I>&gt;<i> I'm not sure I'm failing to follow you incorrectly here.
</I>&gt;<i> 
</I>&gt;<i> Yes, declarative languages, especially with referential transparency,
</I>&gt;<i> are often massively easier to optimize than procedural ones. Or rather,
</I>&gt;<i> the computer science and mathematics might be harder in some cases, but
</I>&gt;<i> the optimizations can be more far-reaching. The down side is that they
</I>&gt;<i> tend to start out slower, so it doesn't always balance out. *BUT* they
</I>&gt;<i> are also often more maintainable.
</I>
Really !? 100 lines of code are more maintainable then 20 (because this 1:5 is how it looks like when you
need to maintain a structure vs. when you have to FAKE like you don't need to update and  life is good and you are &quot;just copying&quot;
the data)

Really !??

Well, there is experimental evidence that says that bugs are linearly proportional with # lines of code.
(Let alone the nightmare that you put your optimizer through, trying to re-invent stuff that you already know, and you spent hours and days trying to hide.)

Great.


&gt;<i> 
</I>&gt;<i> I started to write an essay on optimization of procedural languages and
</I>&gt;<i> realised it was crazy and stopped.
</I>

Liam,

out of curiosity, other then writing an essay,  when is the last time you wrote a serious compiler/optimizer for either one !?
(Functional and/or procedural language !? And/or any combination of the above !?)

There are plenty of lessons that anyone can learn doing the &quot;dirty&quot; work. Dirty work is anything that is NOT pdf and slideshare.

Other then number of lines of code there is something else that counts.

 It's called experience.


&gt;<i> Maybe we should have a public XQuery optimization wiki, although I don't
</I>&gt;<i> know how many vendors would be able to share their deep and wonderful
</I>&gt;<i> secrets :)
</I>
Yes, such thing would be called a standard benchmark, and historically it triggers people to work on performance and/or publish
(or at least patent :-) their secret sauce.

I asked you for years to trigger W3C to work on this. Never heard back from it.

Thanks
Dana


</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004093.html</link><pubDate>Wed, 15 May 2013 22:39:09 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
On May 15, 2013, at 9:39 PM, Liam R E Quin wrote:

&gt;<i> On Thu, 2013-05-16 at 00:22 +0000, David Lee wrote:
</I>&gt;&gt;<i> I still am unconvinced that the theory that a purely functional
</I>&gt;&gt;<i> language would enable vastly better optimizations
</I>&gt;&gt;<i> has yet to be realized in the real world and may never be.
</I>&gt;<i> 
</I>&gt;<i> I'm not sure I'm failing to follow you incorrectly here.
</I>&gt;<i> 
</I>&gt;<i> Yes, declarative languages, especially with referential transparency,
</I>&gt;<i> are often massively easier to optimize than procedural ones. Or rather,
</I>&gt;<i> the computer science and mathematics might be harder in some cases, but
</I>&gt;<i> the optimizations can be more far-reaching. The down side is that they
</I>&gt;<i> tend to start out slower, so it doesn't always balance out. *BUT* they
</I>&gt;<i> are also often more maintainable.
</I>
Really !? 100 lines of code are more maintainable then 20 (because this 1:5 is how it looks like when you
need to maintain a structure vs. when you have to FAKE like you don't need to update and  life is good and you are &quot;just copying&quot;
the data)

Really !??

Well, there is experimental evidence that says that bugs are linearly proportional with # lines of code.
(Let alone the nightmare that you put your optimizer through, trying to re-invent stuff that you already know, and you spent hours and days trying to hide.)

Great.


&gt;<i> 
</I>&gt;<i> I started to write an essay on optimization of procedural languages and
</I>&gt;<i> realised it was crazy and stopped.
</I>

Liam,

out of curiosity, other then writing an essay,  when is the last time you wrote a serious compiler/optimizer for either one !?
(Functional and/or procedural language !? And/or any combination of the above !?)

There are plenty of lessons that anyone can learn doing the &quot;dirty&quot; work. Dirty work is anything that is NOT pdf and slideshare.

Other then number of lines of code there is something else that counts.

 It's called experience.


&gt;<i> Maybe we should have a public XQuery optimization wiki, although I don't
</I>&gt;<i> know how many vendors would be able to share their deep and wonderful
</I>&gt;<i> secrets :)
</I>
Yes, such thing would be called a standard benchmark, and historically it triggers people to work on performance and/or publish
(or at least patent :-) their secret sauce.

I asked you for years to trigger W3C to work on this. Never heard back from it.

Thanks
Dana


</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004093.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 22:39:09 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Thu, 2013-05-16 at 00:22 +0000, David Lee wrote:
&gt;<i> I still am unconvinced that the theory that a purely functional
</I>&gt;<i> language would enable vastly better optimizations
</I>&gt;<i> has yet to be realized in the real world and may never be.
</I>
I'm not sure I'm failing to follow you incorrectly here.

Yes, declarative languages, especially with referential transparency,
are often massively easier to optimize than procedural ones. Or rather,
the computer science and mathematics might be harder in some cases, but
the optimizations can be more far-reaching. The down side is that they
tend to start out slower, so it doesn't always balance out. *BUT* they
are also often more maintainable.

I started to write an essay on optimization of procedural languages and
realised it was crazy and stopped.

One minor note though, that applies to a great many languages where the
same code is run many times - logging the result of each conditional and
then rewriting the generated code to make the faster branch the more
common is a useful trick that only works in some environments. The speed
difference in a language like C or assembly is because one branch has to
do a jump (goto) to get to the else part, and jumps tend to stall the
CPU pipeline. But even in a language like XQuery you'll tend to get L2
cache performance benefits in such cases. I don't know how significant
they would be, and would be interested in hearing from implementors.

Maybe we should have a public XQuery optimization wiki, although I don't
know how many vendors would be able to share their deep and wonderful
secrets :)

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

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004092.html</link><pubDate>Wed, 15 May 2013 21:39:42 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Thu, 2013-05-16 at 00:22 +0000, David Lee wrote:
&gt;<i> I still am unconvinced that the theory that a purely functional
</I>&gt;<i> language would enable vastly better optimizations
</I>&gt;<i> has yet to be realized in the real world and may never be.
</I>
I'm not sure I'm failing to follow you incorrectly here.

Yes, declarative languages, especially with referential transparency,
are often massively easier to optimize than procedural ones. Or rather,
the computer science and mathematics might be harder in some cases, but
the optimizations can be more far-reaching. The down side is that they
tend to start out slower, so it doesn't always balance out. *BUT* they
are also often more maintainable.

I started to write an essay on optimization of procedural languages and
realised it was crazy and stopped.

One minor note though, that applies to a great many languages where the
same code is run many times - logging the result of each conditional and
then rewriting the generated code to make the faster branch the more
common is a useful trick that only works in some environments. The speed
difference in a language like C or assembly is because one branch has to
do a jump (goto) to get to the else part, and jumps tend to stall the
CPU pipeline. But even in a language like XQuery you'll tend to get L2
cache performance benefits in such cases. I don't know how significant
they would be, and would be interested in hearing from implementors.

Maybe we should have a public XQuery optimization wiki, although I don't
know how many vendors would be able to share their deep and wonderful
secrets :)

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

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004092.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 21:39:42 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>I still am unconvinced that the theory that a purely functional language would enable vastly better optimizations
has yet to be realized in the real world and may never be.   It sounds good, and looks good on paper ... 
And maybe someday a genius will make it so ... and teach us peons how to do it Gods Way.
But in practice using non-functional semantics can produce vastly faster or simplier code sometimes  (or both	)....
Or why would every XQuery vendor put them in ?  They got tired of telling customers they were wrong.
And keeping a straight face ....

			   
Of course this was the same argument for &quot;register&quot; and _asm in C ... and later had the back door &quot;volatile&quot; snuck in where
the assumptions of nothing sneaky happening in the back door were violated .... who knows what &quot;volatile&quot; really means nowadays in a multi-core multi layered cache line system ... The Compiler Knows :)


And yes adding scripting frameworks on top of XQuery is very powerful ... And Good. (why I wrote xmlsh ... ) ...
combining them is a very good mix.  But when your &quot;stuck&quot; with pure XQuery ... or XSLT for that matter no matter how many times the gurus tell you that its for your own good ... it seems more religion then fact ...
Thats my opinion and I'm sticking with it no matter how many facts you want to throw at me :)



----------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.xmlsh.org


-----Original Message-----
From: Liam R E Quin [mailto:http://x-query.com/mailman/listinfo/talk] 
Sent: Wednesday, May 15, 2013 7:25 PM
To: David Lee
Cc: http://x-query.com/mailman/listinfo/talk
Subject: Re:  Is it possible to maintain a list of value in XQuery

On Wed, 2013-05-15 at 23:10 +0000, David Lee wrote:
[...]
&gt;<i> I boldly propose that perhaps as a group we step back and get off our
</I>&gt;<i> high horse and admit that some procedural  aspects to XML processing
</I>&gt;<i> be embraced instead of hidden in the dark corners of &quot;vendor
</I>&gt;<i> implementations&quot;  that every single vendor has had to provide because
</I>&gt;<i> pure functional programming  has simply not lived up to its promise.
</I>
I don't think it's about a high horse. The XQuery WG spent multiple
years trying to wrestle with adding procedural hooks to XQuery. Part of
the difficulty was that it was a group of people who did not share a
common goal. For example, some people thought it would be nice to offer
a sort of bait-and-switch language where the easy stuff was procedural
but anything hard was functional, a sort of gentle slope learning curve
followed by a cliff, instead of a very steep hill at the start. Others
needed synchronization and orchestration.

My own feeling is still that the scripting extensions would work better
as a framework rather like XProc, orchestrating functional chunks of
XQuery (and/or XSLT) at a higher level, with clearly-defined boundaries
for optimization &amp; transactions. One problem with them as written today
is that it's easy to put a semicolon instead of a comma in places where
it's still legal, but has a different meaning, one which has the
side-effect (!) of effectively disabling a lot of optimization.

At any rate we ended up delaying XQuery 3 for a year or more while
working on the scripting extensions, without really coming to a good
consensus.

Maybe the long term answer is XQuery extensions to JavaScript.

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


</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004091.html</link><pubDate>Wed, 15 May 2013 17:22:57 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>I still am unconvinced that the theory that a purely functional language would enable vastly better optimizations
has yet to be realized in the real world and may never be.   It sounds good, and looks good on paper ... 
And maybe someday a genius will make it so ... and teach us peons how to do it Gods Way.
But in practice using non-functional semantics can produce vastly faster or simplier code sometimes  (or both	)....
Or why would every XQuery vendor put them in ?  They got tired of telling customers they were wrong.
And keeping a straight face ....

			   
Of course this was the same argument for &quot;register&quot; and _asm in C ... and later had the back door &quot;volatile&quot; snuck in where
the assumptions of nothing sneaky happening in the back door were violated .... who knows what &quot;volatile&quot; really means nowadays in a multi-core multi layered cache line system ... The Compiler Knows :)


And yes adding scripting frameworks on top of XQuery is very powerful ... And Good. (why I wrote xmlsh ... ) ...
combining them is a very good mix.  But when your &quot;stuck&quot; with pure XQuery ... or XSLT for that matter no matter how many times the gurus tell you that its for your own good ... it seems more religion then fact ...
Thats my opinion and I'm sticking with it no matter how many facts you want to throw at me :)



----------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.xmlsh.org


-----Original Message-----
From: Liam R E Quin [mailto:http://x-query.com/mailman/listinfo/talk] 
Sent: Wednesday, May 15, 2013 7:25 PM
To: David Lee
Cc: http://x-query.com/mailman/listinfo/talk
Subject: Re:  Is it possible to maintain a list of value in XQuery

On Wed, 2013-05-15 at 23:10 +0000, David Lee wrote:
[...]
&gt;<i> I boldly propose that perhaps as a group we step back and get off our
</I>&gt;<i> high horse and admit that some procedural  aspects to XML processing
</I>&gt;<i> be embraced instead of hidden in the dark corners of &quot;vendor
</I>&gt;<i> implementations&quot;  that every single vendor has had to provide because
</I>&gt;<i> pure functional programming  has simply not lived up to its promise.
</I>
I don't think it's about a high horse. The XQuery WG spent multiple
years trying to wrestle with adding procedural hooks to XQuery. Part of
the difficulty was that it was a group of people who did not share a
common goal. For example, some people thought it would be nice to offer
a sort of bait-and-switch language where the easy stuff was procedural
but anything hard was functional, a sort of gentle slope learning curve
followed by a cliff, instead of a very steep hill at the start. Others
needed synchronization and orchestration.

My own feeling is still that the scripting extensions would work better
as a framework rather like XProc, orchestrating functional chunks of
XQuery (and/or XSLT) at a higher level, with clearly-defined boundaries
for optimization &amp; transactions. One problem with them as written today
is that it's easy to put a semicolon instead of a comma in places where
it's still legal, but has a different meaning, one which has the
side-effect (!) of effectively disabling a lot of optimization.

At any rate we ended up delaying XQuery 3 for a year or more while
working on the scripting extensions, without really coming to a good
consensus.

Maybe the long term answer is XQuery extensions to JavaScript.

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


</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004091.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 17:22:57 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Wed, 2013-05-15 at 23:53 +0000, Eric Bloch wrote:
&gt;<i> 
</I>&gt;<i> &gt; 
</I>&gt;<i> &gt; Maybe the long term answer is XQuery extensions to JavaScript.
</I>&gt;<i> &gt; 
</I>&gt;<i> 
</I>&gt;<i> Are you suggesting a resurrection of E4X?
</I>
I wasn't, at least not directly, although E4X isn't as dead as you might
think (e.g. it's in Flash and Acrobat).

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

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004090.html</link><pubDate>Wed, 15 May 2013 17:21:14 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Wed, 2013-05-15 at 23:53 +0000, Eric Bloch wrote:
&gt;<i> 
</I>&gt;<i> &gt; 
</I>&gt;<i> &gt; Maybe the long term answer is XQuery extensions to JavaScript.
</I>&gt;<i> &gt; 
</I>&gt;<i> 
</I>&gt;<i> Are you suggesting a resurrection of E4X?
</I>
I wasn't, at least not directly, although E4X isn't as dead as you might
think (e.g. it's in Flash and Acrobat).

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

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004090.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 17:21:14 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>

&gt;<i> 
</I>&gt;<i> Maybe the long term answer is XQuery extensions to JavaScript.
</I>&gt;<i> 
</I>
Are you suggesting a resurrection of E4X?  




</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004089.html</link><pubDate>Wed, 15 May 2013 16:53:46 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>

&gt;<i> 
</I>&gt;<i> Maybe the long term answer is XQuery extensions to JavaScript.
</I>&gt;<i> 
</I>
Are you suggesting a resurrection of E4X?  




</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004089.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 16:53:46 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Wed, 2013-05-15 at 23:10 +0000, David Lee wrote:
[...]
&gt;<i> I boldly propose that perhaps as a group we step back and get off our
</I>&gt;<i> high horse and admit that some procedural  aspects to XML processing
</I>&gt;<i> be embraced instead of hidden in the dark corners of &quot;vendor
</I>&gt;<i> implementations&quot;  that every single vendor has had to provide because
</I>&gt;<i> pure functional programming  has simply not lived up to its promise.
</I>
I don't think it's about a high horse. The XQuery WG spent multiple
years trying to wrestle with adding procedural hooks to XQuery. Part of
the difficulty was that it was a group of people who did not share a
common goal. For example, some people thought it would be nice to offer
a sort of bait-and-switch language where the easy stuff was procedural
but anything hard was functional, a sort of gentle slope learning curve
followed by a cliff, instead of a very steep hill at the start. Others
needed synchronization and orchestration.

My own feeling is still that the scripting extensions would work better
as a framework rather like XProc, orchestrating functional chunks of
XQuery (and/or XSLT) at a higher level, with clearly-defined boundaries
for optimization &amp; transactions. One problem with them as written today
is that it's easy to put a semicolon instead of a comma in places where
it's still legal, but has a different meaning, one which has the
side-effect (!) of effectively disabling a lot of optimization.

At any rate we ended up delaying XQuery 3 for a year or more while
working on the scripting extensions, without really coming to a good
consensus.

Maybe the long term answer is XQuery extensions to JavaScript.

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

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004088.html</link><pubDate>Wed, 15 May 2013 16:25:25 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Wed, 2013-05-15 at 23:10 +0000, David Lee wrote:
[...]
&gt;<i> I boldly propose that perhaps as a group we step back and get off our
</I>&gt;<i> high horse and admit that some procedural  aspects to XML processing
</I>&gt;<i> be embraced instead of hidden in the dark corners of &quot;vendor
</I>&gt;<i> implementations&quot;  that every single vendor has had to provide because
</I>&gt;<i> pure functional programming  has simply not lived up to its promise.
</I>
I don't think it's about a high horse. The XQuery WG spent multiple
years trying to wrestle with adding procedural hooks to XQuery. Part of
the difficulty was that it was a group of people who did not share a
common goal. For example, some people thought it would be nice to offer
a sort of bait-and-switch language where the easy stuff was procedural
but anything hard was functional, a sort of gentle slope learning curve
followed by a cliff, instead of a very steep hill at the start. Others
needed synchronization and orchestration.

My own feeling is still that the scripting extensions would work better
as a framework rather like XProc, orchestrating functional chunks of
XQuery (and/or XSLT) at a higher level, with clearly-defined boundaries
for optimization &amp; transactions. One problem with them as written today
is that it's easy to put a semicolon instead of a comma in places where
it's still legal, but has a different meaning, one which has the
side-effect (!) of effectively disabling a lot of optimization.

At any rate we ended up delaying XQuery 3 for a year or more while
working on the scripting extensions, without really coming to a good
consensus.

Maybe the long term answer is XQuery extensions to JavaScript.

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

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004088.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 16:25:25 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value	in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
On May 15, 2013, at 1:05 PM, David Lee wrote:

&gt;<i> Wow ... I really hoped our ivory tower was immune from personal attacks.... what's up with today a full moon crossing mars?
</I>
I just said the code is ugly and potentially slow.

I am attacking the coding style, not the author.  (and BTW, given the design of XQuery, there is no way to write it other way, so it's
definitely not the fault of the author. And by the way, a lot of the design of XQuery is my fault... so why would I complain?)

&gt;<i> If *anyone* on this list, or the entire world for that matter, knows about program optimization I would put Mike at the top of the list, higher than anyone I know personally and likely higher than anyone I know via Nth relation.
</I>
I can tell you the world is full of query optimizer experts, that probably know XQuery in and out, and SQL optimization in and out, and 
compiler technology in and out, and functional language compilation, and that you probably never met. 
Not everybody who knows something writes a lot of emails on public mailing lists, that's all.

There is a 30 years old history of optimizing SQL, or compiling functional languages, and lots of people did lots of things, even if you do 
not know about it.

( But I agree that nobody knows XML as well as Mike. I would defer all questions about the details of XML to him....)

&gt;<i> So could we stop that and get back to decency ?  XQuery itself is efficient or not based in the implementation, not the language.
</I>
&gt;<i>  And yes some optimizations are hard, possibly so hard they never get done or only done by &lt;exclude my favorite prrocessor&gt;
</I>&gt;<i> 
</I>
No, I am afraid you do not understand what I am trying to say.

Not that certain optimizations are HARD. Hard you can deal with. You just sit down and do it.

In optimization in general it is IMPOSSIBLE to get it PERFECT (and I have some 25 years of experience with compilers and query optimization, so I think
I know something about it).

An optimization is extremely rarely something that you apply and BOOM, your programs (all of them) are faster. Almost NONE are like this.

There is always a compromise to be made. For some programs that you make faster there are ALWAYS others that you make slower.

This is why optimization is the delicate art of choosing wisely a compromise that would work well IN AVERAGE (whatever that means..).

This is why you need heuristics, for the SPECIAL cases when the user knows better then the compiler -- and there are always cases like this--
and then he/she should have the possibility to say: &quot;Here, I would like my program to be executed THIS way&quot;.

Most of the time you will trust a smart optimizer, but not always.

That's what an assignment is. A heuristic.


&gt;<i> As for the ugliness of XQuery code ... point taken.  XQuery is not always pretty ... but then it has many flavors. 
</I>&gt;<i> I personally find it beautiful.
</I>&gt;<i> 
</I>&gt;<i> I am sure one could come up with prettier code.  Although I myself don't see any ugliness in the code  I wrote,
</I>&gt;<i> and don't see how it would be prettier in a procedural fashion ... or why it matters to the poster ...
</I>&gt;<i> Was subjective beauty part of the prerequisite ?
</I>&gt;<i> 
</I>&gt;<i> And the question was asked about XQuery, not XQuery + (Add feature X We are proud of but isn't XQuery)
</I>&gt;<i> Might as well jump to C or Java or Haskell or &lt;insert your favorite language that isnt XQuery&gt;
</I>
Thanks for liking XQuery ! Given that it looks 90% as the language that bears my design (Quilt, with Jonathan Robie 
and Don Chamberlin) and that it is a functional language because of me (probably), I am certainly taking it as a compliment :-)))

So don't get me wrong, I like it too :-)

It's just that, like any other programming language, is not 100% perfect.

Best
Dana



</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004087.html</link><pubDate>Wed, 15 May 2013 13:32:04 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value	in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
On May 15, 2013, at 1:05 PM, David Lee wrote:

&gt;<i> Wow ... I really hoped our ivory tower was immune from personal attacks.... what's up with today a full moon crossing mars?
</I>
I just said the code is ugly and potentially slow.

I am attacking the coding style, not the author.  (and BTW, given the design of XQuery, there is no way to write it other way, so it's
definitely not the fault of the author. And by the way, a lot of the design of XQuery is my fault... so why would I complain?)

&gt;<i> If *anyone* on this list, or the entire world for that matter, knows about program optimization I would put Mike at the top of the list, higher than anyone I know personally and likely higher than anyone I know via Nth relation.
</I>
I can tell you the world is full of query optimizer experts, that probably know XQuery in and out, and SQL optimization in and out, and 
compiler technology in and out, and functional language compilation, and that you probably never met. 
Not everybody who knows something writes a lot of emails on public mailing lists, that's all.

There is a 30 years old history of optimizing SQL, or compiling functional languages, and lots of people did lots of things, even if you do 
not know about it.

( But I agree that nobody knows XML as well as Mike. I would defer all questions about the details of XML to him....)

&gt;<i> So could we stop that and get back to decency ?  XQuery itself is efficient or not based in the implementation, not the language.
</I>
&gt;<i>  And yes some optimizations are hard, possibly so hard they never get done or only done by &lt;exclude my favorite prrocessor&gt;
</I>&gt;<i> 
</I>
No, I am afraid you do not understand what I am trying to say.

Not that certain optimizations are HARD. Hard you can deal with. You just sit down and do it.

In optimization in general it is IMPOSSIBLE to get it PERFECT (and I have some 25 years of experience with compilers and query optimization, so I think
I know something about it).

An optimization is extremely rarely something that you apply and BOOM, your programs (all of them) are faster. Almost NONE are like this.

There is always a compromise to be made. For some programs that you make faster there are ALWAYS others that you make slower.

This is why optimization is the delicate art of choosing wisely a compromise that would work well IN AVERAGE (whatever that means..).

This is why you need heuristics, for the SPECIAL cases when the user knows better then the compiler -- and there are always cases like this--
and then he/she should have the possibility to say: &quot;Here, I would like my program to be executed THIS way&quot;.

Most of the time you will trust a smart optimizer, but not always.

That's what an assignment is. A heuristic.


&gt;<i> As for the ugliness of XQuery code ... point taken.  XQuery is not always pretty ... but then it has many flavors. 
</I>&gt;<i> I personally find it beautiful.
</I>&gt;<i> 
</I>&gt;<i> I am sure one could come up with prettier code.  Although I myself don't see any ugliness in the code  I wrote,
</I>&gt;<i> and don't see how it would be prettier in a procedural fashion ... or why it matters to the poster ...
</I>&gt;<i> Was subjective beauty part of the prerequisite ?
</I>&gt;<i> 
</I>&gt;<i> And the question was asked about XQuery, not XQuery + (Add feature X We are proud of but isn't XQuery)
</I>&gt;<i> Might as well jump to C or Java or Haskell or &lt;insert your favorite language that isnt XQuery&gt;
</I>
Thanks for liking XQuery ! Given that it looks 90% as the language that bears my design (Quilt, with Jonathan Robie 
and Don Chamberlin) and that it is a functional language because of me (probably), I am certainly taking it as a compliment :-)))

So don't get me wrong, I like it too :-)

It's just that, like any other programming language, is not 100% perfect.

Best
Dana



</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004087.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 13:32:04 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Maps will most probably be added to XQuery 3.1, but there are already
some implementations available (e.g. check out Saxon [1] BaseX [2], or
eXist-db [3]). Note that the exact map syntax is still subject to
change.

[1] http://www.saxonica.com/documentation/index.html#!expressions/xpath30maps
[2] http://docs.basex.org/wiki/Map_Module
[3] http://atomic.exist-db.org/blogs/eXist/XQueryMap
___________________________

On Wed, May 15, 2013 at 9:42 PM, Adam Retter &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Sure they will be in XQuery 3.0
</I>&gt;<i>
</I>&gt;<i> On 15 May 2013 20:38, &quot;David Lee&quot; &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Has maps actually made it into xquery 3?  I thought they were xslt only so
</I>&gt;&gt;<i> far
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Sent from my iPhone
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> On May 15, 2013, at 3:27 PM, &quot;Michael Sokolov&quot;
</I>&gt;&gt;<i> &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> &gt; On 5/15/2013 10:47 AM, Kunal Chauhan wrote:
</I>&gt;&gt;<i> &gt;&gt; Hi,
</I>&gt;&gt;<i> &gt;&gt;
</I>&gt;&gt;<i> &gt;&gt; I want to maintain a list of value.
</I>&gt;&gt;<i> &gt;&gt;
</I>&gt;&gt;<i> &gt;&gt; for eg:
</I>&gt;&gt;<i> &gt;&gt; initially I have blank list and through some process I add values in to
</I>&gt;&gt;<i> &gt;&gt; the list.
</I>&gt;&gt;<i> &gt;&gt;
</I>&gt;&gt;<i> &gt;&gt; like (Apple,Banana,Cherry)
</I>&gt;&gt;<i> &gt;&gt;
</I>&gt;&gt;<i> &gt;&gt; now, when get Apple as an output 2nd time it will check into the list.
</I>&gt;&gt;<i> &gt;&gt; If present than don't add value into the list otherwise add it.
</I>&gt;&gt;<i> &gt;&gt; At last I will return the list.
</I>&gt;&gt;<i> &gt;&gt;
</I>&gt;&gt;<i> &gt;&gt; I don't know whether it's possible or not.
</I>&gt;&gt;<i> &gt;&gt; But this there any work around.
</I>&gt;&gt;<i> &gt; You might want to look into maps, a new feature in XQuery 3.0, which
</I>&gt;&gt;<i> &gt; provide a natural and (probably) efficient way to do this, but whether that
</I>&gt;&gt;<i> &gt; is available to you will depend on which processor you are using.
</I>&gt;&gt;<i> &gt;
</I>&gt;&gt;<i> &gt; -Mike
</I>&gt;&gt;<i> &gt; _______________________________________________
</I>&gt;&gt;<i> &gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> &gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I></PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004086.html</link><pubDate>Wed, 15 May 2013 13:12:08 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Maps will most probably be added to XQuery 3.1, but there are already
some implementations available (e.g. check out Saxon [1] BaseX [2], or
eXist-db [3]). Note that the exact map syntax is still subject to
change.

[1] http://www.saxonica.com/documentation/index.html#!expressions/xpath30maps
[2] http://docs.basex.org/wiki/Map_Module
[3] http://atomic.exist-db.org/blogs/eXist/XQueryMap
___________________________

On Wed, May 15, 2013 at 9:42 PM, Adam Retter &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Sure they will be in XQuery 3.0
</I>&gt;<i>
</I>&gt;<i> On 15 May 2013 20:38, &quot;David Lee&quot; &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Has maps actually made it into xquery 3?  I thought they were xslt only so
</I>&gt;&gt;<i> far
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Sent from my iPhone
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> On May 15, 2013, at 3:27 PM, &quot;Michael Sokolov&quot;
</I>&gt;&gt;<i> &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> &gt; On 5/15/2013 10:47 AM, Kunal Chauhan wrote:
</I>&gt;&gt;<i> &gt;&gt; Hi,
</I>&gt;&gt;<i> &gt;&gt;
</I>&gt;&gt;<i> &gt;&gt; I want to maintain a list of value.
</I>&gt;&gt;<i> &gt;&gt;
</I>&gt;&gt;<i> &gt;&gt; for eg:
</I>&gt;&gt;<i> &gt;&gt; initially I have blank list and through some process I add values in to
</I>&gt;&gt;<i> &gt;&gt; the list.
</I>&gt;&gt;<i> &gt;&gt;
</I>&gt;&gt;<i> &gt;&gt; like (Apple,Banana,Cherry)
</I>&gt;&gt;<i> &gt;&gt;
</I>&gt;&gt;<i> &gt;&gt; now, when get Apple as an output 2nd time it will check into the list.
</I>&gt;&gt;<i> &gt;&gt; If present than don't add value into the list otherwise add it.
</I>&gt;&gt;<i> &gt;&gt; At last I will return the list.
</I>&gt;&gt;<i> &gt;&gt;
</I>&gt;&gt;<i> &gt;&gt; I don't know whether it's possible or not.
</I>&gt;&gt;<i> &gt;&gt; But this there any work around.
</I>&gt;&gt;<i> &gt; You might want to look into maps, a new feature in XQuery 3.0, which
</I>&gt;&gt;<i> &gt; provide a natural and (probably) efficient way to do this, but whether that
</I>&gt;&gt;<i> &gt; is available to you will depend on which processor you are using.
</I>&gt;&gt;<i> &gt;
</I>&gt;&gt;<i> &gt; -Mike
</I>&gt;&gt;<i> &gt; _______________________________________________
</I>&gt;&gt;<i> &gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> &gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I></PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004086.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 13:12:08 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value	in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Wow ... I really hoped our ivory tower was immune from personal attacks.... what's up with today a full moon crossing mars?
If *anyone* on this list, or the entire world for that matter, knows about program optimization I would put Mike at the top of the list, higher than anyone I know personally and likely higher than anyone I know via Nth relation.
So could we stop that and get back to decency ?  XQuery itself is efficient or not based in the implementation, not the language.  And yes some optimizations are hard, possibly so hard they never get done or only done by &lt;exclude my favorite prrocessor&gt;

As for the ugliness of XQuery code ... point taken.  XQuery is not always pretty ... but then it has many flavors. 
I personally find it beautiful.

I am sure one could come up with prettier code.  Although I myself don't see any ugliness in the code  I wrote,
and don't see how it would be prettier in a procedural fashion ... or why it matters to the poster ...
Was subjective beauty part of the prerequisite ?

And the question was asked about XQuery, not XQuery + (Add feature X We are proud of but isn't XQuery)
Might as well jump to C or Java or Haskell or &lt;insert your favorite language that isnt XQuery&gt;


BUT ... if you want an answer to &quot;Could I use another language instead of XQuery but is close enough to get on this list&quot;
I of course recommend xmlsh ... it solves ALL problems and is prettier than any other language.
www.xmlsh.org



 ----------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.xmlsh.org

-----Original Message-----
From: daniela florescu [mailto:http://x-query.com/mailman/listinfo/talk] 
Sent: Wednesday, May 15, 2013 2:24 PM
To: Michael Kay
Cc: http://x-query.com/mailman/listinfo/talk; David Lee; Kunal Chauhan
Subject: Re:  Is it possible to maintain a list of value in XQuery

&gt;<i> 
</I>&gt;<i> No, if you are horrified by the inefficiency of this code then switch to an XQuery processor with a decent optimizer.
</I>
You know, Michael, I would mellow down a little bit if I were you.

Or at least try some benchmarks before hand (I did, and the results might surprise you ).

If you can strongly say such a statement, it either that you never understood how complicate of a problem 
optimization is (how many different cases, how to do a compromise between complexity of program vs. size of the data,
how to make sure that the optimization time stays reasonable, etc, etc,), or you are totally dishonest.

So, I don't know, a more mellow approach would be probably better.

=====

As a matter of fact,  I wasn't even talking about runtime when I wrote that email. (even though it applies to execution time, too).

I was horrified about HOW UGLY that code looked.

As a programmer, I would't like to write that.

Cheers
Dana







</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004085.html</link><pubDate>Wed, 15 May 2013 13:05:53 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value	in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Wow ... I really hoped our ivory tower was immune from personal attacks.... what's up with today a full moon crossing mars?
If *anyone* on this list, or the entire world for that matter, knows about program optimization I would put Mike at the top of the list, higher than anyone I know personally and likely higher than anyone I know via Nth relation.
So could we stop that and get back to decency ?  XQuery itself is efficient or not based in the implementation, not the language.  And yes some optimizations are hard, possibly so hard they never get done or only done by &lt;exclude my favorite prrocessor&gt;

As for the ugliness of XQuery code ... point taken.  XQuery is not always pretty ... but then it has many flavors. 
I personally find it beautiful.

I am sure one could come up with prettier code.  Although I myself don't see any ugliness in the code  I wrote,
and don't see how it would be prettier in a procedural fashion ... or why it matters to the poster ...
Was subjective beauty part of the prerequisite ?

And the question was asked about XQuery, not XQuery + (Add feature X We are proud of but isn't XQuery)
Might as well jump to C or Java or Haskell or &lt;insert your favorite language that isnt XQuery&gt;


BUT ... if you want an answer to &quot;Could I use another language instead of XQuery but is close enough to get on this list&quot;
I of course recommend xmlsh ... it solves ALL problems and is prettier than any other language.
www.xmlsh.org



 ----------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.xmlsh.org

-----Original Message-----
From: daniela florescu [mailto:http://x-query.com/mailman/listinfo/talk] 
Sent: Wednesday, May 15, 2013 2:24 PM
To: Michael Kay
Cc: http://x-query.com/mailman/listinfo/talk; David Lee; Kunal Chauhan
Subject: Re:  Is it possible to maintain a list of value in XQuery

&gt;<i> 
</I>&gt;<i> No, if you are horrified by the inefficiency of this code then switch to an XQuery processor with a decent optimizer.
</I>
You know, Michael, I would mellow down a little bit if I were you.

Or at least try some benchmarks before hand (I did, and the results might surprise you ).

If you can strongly say such a statement, it either that you never understood how complicate of a problem 
optimization is (how many different cases, how to do a compromise between complexity of program vs. size of the data,
how to make sure that the optimization time stays reasonable, etc, etc,), or you are totally dishonest.

So, I don't know, a more mellow approach would be probably better.

=====

As a matter of fact,  I wasn't even talking about runtime when I wrote that email. (even though it applies to execution time, too).

I was horrified about HOW UGLY that code looked.

As a programmer, I would't like to write that.

Cheers
Dana







</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004085.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 13:05:53 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Sure they will be in XQuery 3.0
On 15 May 2013 20:38, &quot;David Lee&quot; &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:

&gt;<i> Has maps actually made it into xquery 3?  I thought they were xslt only so
</I>&gt;<i> far
</I>&gt;<i>
</I>&gt;<i> Sent from my iPhone
</I>&gt;<i>
</I>&gt;<i> On May 15, 2013, at 3:27 PM, &quot;Michael Sokolov&quot; &lt;
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk&gt; wrote:
</I>&gt;<i>
</I>&gt;<i> &gt; On 5/15/2013 10:47 AM, Kunal Chauhan wrote:
</I>&gt;<i> &gt;&gt; Hi,
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; I want to maintain a list of value.
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; for eg:
</I>&gt;<i> &gt;&gt; initially I have blank list and through some process I add values in to
</I>&gt;<i> the list.
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; like (Apple,Banana,Cherry)
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; now, when get Apple as an output 2nd time it will check into the list.
</I>&gt;<i> &gt;&gt; If present than don't add value into the list otherwise add it.
</I>&gt;<i> &gt;&gt; At last I will return the list.
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; I don't know whether it's possible or not.
</I>&gt;<i> &gt;&gt; But this there any work around.
</I>&gt;<i> &gt; You might want to look into maps, a new feature in XQuery 3.0, which
</I>&gt;<i> provide a natural and (probably) efficient way to do this, but whether that
</I>&gt;<i> is available to you will depend on which processor you are using.
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; -Mike
</I>&gt;<i> &gt; _______________________________________________
</I>&gt;<i> &gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> &gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>-------------- next part --------------
An HTML attachment was scrubbed...
URL: &lt;http://x-query.com/pipermail/talk/attachments/20130515/d07aa537/attachment.html&gt;
</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004084.html</link><pubDate>Wed, 15 May 2013 12:42:20 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Sure they will be in XQuery 3.0
On 15 May 2013 20:38, &quot;David Lee&quot; &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:

&gt;<i> Has maps actually made it into xquery 3?  I thought they were xslt only so
</I>&gt;<i> far
</I>&gt;<i>
</I>&gt;<i> Sent from my iPhone
</I>&gt;<i>
</I>&gt;<i> On May 15, 2013, at 3:27 PM, &quot;Michael Sokolov&quot; &lt;
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk&gt; wrote:
</I>&gt;<i>
</I>&gt;<i> &gt; On 5/15/2013 10:47 AM, Kunal Chauhan wrote:
</I>&gt;<i> &gt;&gt; Hi,
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; I want to maintain a list of value.
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; for eg:
</I>&gt;<i> &gt;&gt; initially I have blank list and through some process I add values in to
</I>&gt;<i> the list.
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; like (Apple,Banana,Cherry)
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; now, when get Apple as an output 2nd time it will check into the list.
</I>&gt;<i> &gt;&gt; If present than don't add value into the list otherwise add it.
</I>&gt;<i> &gt;&gt; At last I will return the list.
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; I don't know whether it's possible or not.
</I>&gt;<i> &gt;&gt; But this there any work around.
</I>&gt;<i> &gt; You might want to look into maps, a new feature in XQuery 3.0, which
</I>&gt;<i> provide a natural and (probably) efficient way to do this, but whether that
</I>&gt;<i> is available to you will depend on which processor you are using.
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; -Mike
</I>&gt;<i> &gt; _______________________________________________
</I>&gt;<i> &gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> &gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>-------------- next part --------------
An HTML attachment was scrubbed...
URL: &lt;http://x-query.com/pipermail/talk/attachments/20130515/d07aa537/attachment.html&gt;
</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004084.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 12:42:20 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value	in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Has maps actually made it into xquery 3?  I thought they were xslt only so far

Sent from my iPhone

On May 15, 2013, at 3:27 PM, &quot;Michael Sokolov&quot; &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:

&gt;<i> On 5/15/2013 10:47 AM, Kunal Chauhan wrote:
</I>&gt;&gt;<i> Hi,
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> I want to maintain a list of value.
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> for eg:
</I>&gt;&gt;<i> initially I have blank list and through some process I add values in to the list.
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> like (Apple,Banana,Cherry)
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> now, when get Apple as an output 2nd time it will check into the list.
</I>&gt;&gt;<i> If present than don't add value into the list otherwise add it.
</I>&gt;&gt;<i> At last I will return the list.
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> I don't know whether it's possible or not.
</I>&gt;&gt;<i> But this there any work around.
</I>&gt;<i> You might want to look into maps, a new feature in XQuery 3.0, which provide a natural and (probably) efficient way to do this, but whether that is available to you will depend on which processor you are using.
</I>&gt;<i> 
</I>&gt;<i> -Mike
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004083.html</link><pubDate>Wed, 15 May 2013 12:36:40 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value	in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Has maps actually made it into xquery 3?  I thought they were xslt only so far

Sent from my iPhone

On May 15, 2013, at 3:27 PM, &quot;Michael Sokolov&quot; &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:

&gt;<i> On 5/15/2013 10:47 AM, Kunal Chauhan wrote:
</I>&gt;&gt;<i> Hi,
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> I want to maintain a list of value.
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> for eg:
</I>&gt;&gt;<i> initially I have blank list and through some process I add values in to the list.
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> like (Apple,Banana,Cherry)
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> now, when get Apple as an output 2nd time it will check into the list.
</I>&gt;&gt;<i> If present than don't add value into the list otherwise add it.
</I>&gt;&gt;<i> At last I will return the list.
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> I don't know whether it's possible or not.
</I>&gt;&gt;<i> But this there any work around.
</I>&gt;<i> You might want to look into maps, a new feature in XQuery 3.0, which provide a natural and (probably) efficient way to do this, but whether that is available to you will depend on which processor you are using.
</I>&gt;<i> 
</I>&gt;<i> -Mike
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004083.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 12:36:40 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 5/15/2013 10:47 AM, Kunal Chauhan wrote:
&gt;<i> Hi,
</I>&gt;<i>
</I>&gt;<i> I want to maintain a list of value.
</I>&gt;<i>
</I>&gt;<i> for eg:
</I>&gt;<i> initially I have blank list and through some process I add values in 
</I>&gt;<i> to the list.
</I>&gt;<i>
</I>&gt;<i> like (Apple,Banana,Cherry)
</I>&gt;<i>
</I>&gt;<i> now, when get Apple as an output 2nd time it will check into the list.
</I>&gt;<i> If present than don't add value into the list otherwise add it.
</I>&gt;<i> At last I will return the list.
</I>&gt;<i>
</I>&gt;<i> I don't know whether it's possible or not.
</I>&gt;<i> But this there any work around.
</I>You might want to look into maps, a new feature in XQuery 3.0, which 
provide a natural and (probably) efficient way to do this, but whether 
that is available to you will depend on which processor you are using.

-Mike
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004082.html</link><pubDate>Wed, 15 May 2013 12:26:22 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 5/15/2013 10:47 AM, Kunal Chauhan wrote:
&gt;<i> Hi,
</I>&gt;<i>
</I>&gt;<i> I want to maintain a list of value.
</I>&gt;<i>
</I>&gt;<i> for eg:
</I>&gt;<i> initially I have blank list and through some process I add values in 
</I>&gt;<i> to the list.
</I>&gt;<i>
</I>&gt;<i> like (Apple,Banana,Cherry)
</I>&gt;<i>
</I>&gt;<i> now, when get Apple as an output 2nd time it will check into the list.
</I>&gt;<i> If present than don't add value into the list otherwise add it.
</I>&gt;<i> At last I will return the list.
</I>&gt;<i>
</I>&gt;<i> I don't know whether it's possible or not.
</I>&gt;<i> But this there any work around.
</I>You might want to look into maps, a new feature in XQuery 3.0, which 
provide a natural and (probably) efficient way to do this, but whether 
that is available to you will depend on which processor you are using.

-Mike
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004082.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 12:26:22 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value	in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;<i> 
</I>&gt;<i> No, if you are horrified by the inefficiency of this code then switch to an XQuery processor with a decent optimizer.
</I>
You know, Michael, I would mellow down a little bit if I were you.

Or at least try some benchmarks before hand (I did, and the results might surprise you ).

If you can strongly say such a statement, it either that you never understood how complicate of a problem 
optimization is (how many different cases, how to do a compromise between complexity of program vs. size of the data,
how to make sure that the optimization time stays reasonable, etc, etc,), or you are totally dishonest.

So, I don't know, a more mellow approach would be probably better.

=====

As a matter of fact,  I wasn't even talking about runtime when I wrote that email. (even though it applies to execution time, too).

I was horrified about HOW UGLY that code looked.

As a programmer, I would't like to write that.

Cheers
Dana







</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004081.html</link><pubDate>Wed, 15 May 2013 11:23:42 GMT</pubDate></item><item><title>  Is it possible to maintain a list of value	in	XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;<i> 
</I>&gt;<i> No, if you are horrified by the inefficiency of this code then switch to an XQuery processor with a decent optimizer.
</I>
You know, Michael, I would mellow down a little bit if I were you.

Or at least try some benchmarks before hand (I did, and the results might surprise you ).

If you can strongly say such a statement, it either that you never understood how complicate of a problem 
optimization is (how many different cases, how to do a compromise between complexity of program vs. size of the data,
how to make sure that the optimization time stays reasonable, etc, etc,), or you are totally dishonest.

So, I don't know, a more mellow approach would be probably better.

=====

As a matter of fact,  I wasn't even talking about runtime when I wrote that email. (even though it applies to execution time, too).

I was horrified about HOW UGLY that code looked.

As a programmer, I would't like to write that.

Cheers
Dana







</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004081.html?utm_source=feedly</link><pubDate>Wed, 15 May 2013 11:23:42 GMT</pubDate></item><item><title>  Fuctions and variables in replacement string of fn:replace()
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Thanks, Michael, for the clarification. I'm aware that fn:analyze-string is 
(with XPath 3.0) the right tool for this kind of job, I was just confused about 
the extent to which fn:replace() was capable of being a poor-man's equivalent. 
The answer then is &quot;not much&quot;.

David

On Wed, 1 May 2013, Michael Kay wrote:

&gt;<i>
</I>&gt;<i> On 1 May 2013, at 04:14, Liam R E Quin wrote:
</I>&gt;<i>
</I>&gt;&gt;<i> On Tue, 2013-04-30 at 23:01 -0400, David Sewell wrote:
</I>&gt;&gt;&gt;<i> When using fn:replace(), is it kosher or illegal to construct the
</I>&gt;&gt;&gt;<i> replacement string dynamically using a function?
</I>&gt;<i>
</I>&gt;<i> Yes. XQuery is an orthogonal language, any expression can be replaced by a different expression that returns the same value.
</I>&gt;<i>
</I>&gt;&gt;&gt;<i> In some cases this
</I>&gt;&gt;&gt;<i> seems to work (tested in Saxon and MarkLogic):
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> xquery version &quot;1.0&quot;;
</I>&gt;&gt;&gt;<i> let $string := &quot;Now, let's SEND OUT for QUICHE!!&quot;
</I>&gt;&gt;&gt;<i> let $match := &quot;[A-Z][A-Z]+&quot;
</I>&gt;&gt;&gt;<i> return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
</I>&gt;&gt;&gt;<i> ==&gt; Now, let's SENDSEND OUTOUT for QUICHEQUICHE!!
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> but in other cases it doesn't. For example, lower-case(&quot;$0&quot;) has no
</I>&gt;&gt;&gt;<i> effect.
</I>&gt;<i>
</I>&gt;<i> It should have no effect. It's the same as replace($string, $match, '$0') which replaces every string that matches $match with itself.
</I>&gt;<i>
</I>&gt;&gt;&gt;<i> And substring(&quot;$0&quot;, 1, 1) throws an error.
</I>&gt;<i>
</I>&gt;<i> Because '$' is not a valid replacement string.
</I>&gt;<i>
</I>&gt;<i> OK, I think I've understood what you wanted (maybe!). You didn't want to construct the replacement string using a function, you wanted to apply a function to the matching substrings found by the matching operation: you want a higher-order replace(). Saxon has such a thing in the form of saxon:analyze-string (see http://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
</I>&gt;&gt;<i>
</I>&gt;<i> Michael Kay
</I>&gt;<i> Saxonica
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>
-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: http://x-query.com/mailman/listinfo/talk   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004080.html</link><pubDate>Wed, 01 May 2013 06:43:00 GMT</pubDate></item><item><title>  Fuctions and variables in replacement string of fn:replace()
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Thanks, Michael, for the clarification. I'm aware that fn:analyze-string is 
(with XPath 3.0) the right tool for this kind of job, I was just confused about 
the extent to which fn:replace() was capable of being a poor-man's equivalent. 
The answer then is &quot;not much&quot;.

David

On Wed, 1 May 2013, Michael Kay wrote:

&gt;<i>
</I>&gt;<i> On 1 May 2013, at 04:14, Liam R E Quin wrote:
</I>&gt;<i>
</I>&gt;&gt;<i> On Tue, 2013-04-30 at 23:01 -0400, David Sewell wrote:
</I>&gt;&gt;&gt;<i> When using fn:replace(), is it kosher or illegal to construct the
</I>&gt;&gt;&gt;<i> replacement string dynamically using a function?
</I>&gt;<i>
</I>&gt;<i> Yes. XQuery is an orthogonal language, any expression can be replaced by a different expression that returns the same value.
</I>&gt;<i>
</I>&gt;&gt;&gt;<i> In some cases this
</I>&gt;&gt;&gt;<i> seems to work (tested in Saxon and MarkLogic):
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> xquery version &quot;1.0&quot;;
</I>&gt;&gt;&gt;<i> let $string := &quot;Now, let's SEND OUT for QUICHE!!&quot;
</I>&gt;&gt;&gt;<i> let $match := &quot;[A-Z][A-Z]+&quot;
</I>&gt;&gt;&gt;<i> return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
</I>&gt;&gt;&gt;<i> ==&gt; Now, let's SENDSEND OUTOUT for QUICHEQUICHE!!
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> but in other cases it doesn't. For example, lower-case(&quot;$0&quot;) has no
</I>&gt;&gt;&gt;<i> effect.
</I>&gt;<i>
</I>&gt;<i> It should have no effect. It's the same as replace($string, $match, '$0') which replaces every string that matches $match with itself.
</I>&gt;<i>
</I>&gt;&gt;&gt;<i> And substring(&quot;$0&quot;, 1, 1) throws an error.
</I>&gt;<i>
</I>&gt;<i> Because '$' is not a valid replacement string.
</I>&gt;<i>
</I>&gt;<i> OK, I think I've understood what you wanted (maybe!). You didn't want to construct the replacement string using a function, you wanted to apply a function to the matching substrings found by the matching operation: you want a higher-order replace(). Saxon has such a thing in the form of saxon:analyze-string (see http://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
</I>&gt;&gt;<i>
</I>&gt;<i> Michael Kay
</I>&gt;<i> Saxonica
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>
-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: http://x-query.com/mailman/listinfo/talk   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004080.html?utm_source=feedly</link><pubDate>Wed, 01 May 2013 06:43:00 GMT</pubDate></item><item><title>  Fuctions and variables in replacement string of	fn:replace()
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Or switch to xsl:analyze-string..

;-)

&gt;<i> -----Oorspronkelijk bericht-----
</I>&gt;<i> Van: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk]
</I>&gt;<i> Namens Michael Kay
</I>&gt;<i> Verzonden: woensdag 1 mei 2013 10:02
</I>&gt;<i> Aan: http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> CC: XQuery Talk; David Sewell
</I>&gt;<i> Onderwerp: Re:  Fuctions and variables in replacement
</I>string
&gt;<i> of fn:replace()
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> On 1 May 2013, at 04:14, Liam R E Quin wrote:
</I>&gt;<i>
</I>&gt;<i> &gt; On Tue, 2013-04-30 at 23:01 -0400, David Sewell wrote:
</I>&gt;<i> &gt;&gt; When using fn:replace(), is it kosher or illegal to construct the
</I>&gt;<i> &gt;&gt; replacement string dynamically using a function?
</I>&gt;<i>
</I>&gt;<i> Yes. XQuery is an orthogonal language, any expression can be replaced by
</I>a
&gt;<i> different expression that returns the same value.
</I>&gt;<i>
</I>&gt;<i> &gt;&gt; In some cases this
</I>&gt;<i> &gt;&gt; seems to work (tested in Saxon and MarkLogic):
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; xquery version &quot;1.0&quot;;
</I>&gt;<i> &gt;&gt; let $string := &quot;Now, let's SEND OUT for QUICHE!!&quot;
</I>&gt;<i> &gt;&gt; let $match := &quot;[A-Z][A-Z]+&quot;
</I>&gt;<i> &gt;&gt; return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
</I>&gt;<i> &gt;&gt; ==&gt; Now, let's SENDSEND OUTOUT for QUICHEQUICHE!!
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; but in other cases it doesn't. For example, lower-case(&quot;$0&quot;) has no
</I>&gt;<i> &gt;&gt; effect.
</I>&gt;<i>
</I>&gt;<i> It should have no effect. It's the same as replace($string, $match,
</I>'$0')
&gt;<i> which replaces every string that matches $match with itself.
</I>&gt;<i>
</I>&gt;<i> &gt;&gt; And substring(&quot;$0&quot;, 1, 1) throws an error.
</I>&gt;<i>
</I>&gt;<i> Because '$' is not a valid replacement string.
</I>&gt;<i>
</I>&gt;<i> OK, I think I've understood what you wanted (maybe!). You didn't want to
</I>&gt;<i> construct the replacement string using a function, you wanted to apply a
</I>&gt;<i> function to the matching substrings found by the matching operation: you
</I>&gt;<i> want a higher-order replace(). Saxon has such a thing in the form of
</I>&gt;<i> saxon:analyze-string (see
</I>&gt;<i> http://www.saxonica.com/documentation/#!functions/saxon/analyze-
</I>&gt;<i> string) but in 3.0 the WG took a different direction in its definition
</I>of
&gt;<i> fn:analyze-string(), which is probably easier for ordinary mortals to
</I>cope
&gt;<i> with: http://www.w3.org/TR/xpath-functions-30/#func-analyze-string
</I>&gt;<i> &gt;
</I>&gt;<i> Michael Kay
</I>&gt;<i> Saxonica
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I></PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004079.html</link><pubDate>Wed, 01 May 2013 01:32:38 GMT</pubDate></item><item><title>  Fuctions and variables in replacement string of	fn:replace()
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Or switch to xsl:analyze-string..

;-)

&gt;<i> -----Oorspronkelijk bericht-----
</I>&gt;<i> Van: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk]
</I>&gt;<i> Namens Michael Kay
</I>&gt;<i> Verzonden: woensdag 1 mei 2013 10:02
</I>&gt;<i> Aan: http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> CC: XQuery Talk; David Sewell
</I>&gt;<i> Onderwerp: Re:  Fuctions and variables in replacement
</I>string
&gt;<i> of fn:replace()
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> On 1 May 2013, at 04:14, Liam R E Quin wrote:
</I>&gt;<i>
</I>&gt;<i> &gt; On Tue, 2013-04-30 at 23:01 -0400, David Sewell wrote:
</I>&gt;<i> &gt;&gt; When using fn:replace(), is it kosher or illegal to construct the
</I>&gt;<i> &gt;&gt; replacement string dynamically using a function?
</I>&gt;<i>
</I>&gt;<i> Yes. XQuery is an orthogonal language, any expression can be replaced by
</I>a
&gt;<i> different expression that returns the same value.
</I>&gt;<i>
</I>&gt;<i> &gt;&gt; In some cases this
</I>&gt;<i> &gt;&gt; seems to work (tested in Saxon and MarkLogic):
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; xquery version &quot;1.0&quot;;
</I>&gt;<i> &gt;&gt; let $string := &quot;Now, let's SEND OUT for QUICHE!!&quot;
</I>&gt;<i> &gt;&gt; let $match := &quot;[A-Z][A-Z]+&quot;
</I>&gt;<i> &gt;&gt; return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
</I>&gt;<i> &gt;&gt; ==&gt; Now, let's SENDSEND OUTOUT for QUICHEQUICHE!!
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; but in other cases it doesn't. For example, lower-case(&quot;$0&quot;) has no
</I>&gt;<i> &gt;&gt; effect.
</I>&gt;<i>
</I>&gt;<i> It should have no effect. It's the same as replace($string, $match,
</I>'$0')
&gt;<i> which replaces every string that matches $match with itself.
</I>&gt;<i>
</I>&gt;<i> &gt;&gt; And substring(&quot;$0&quot;, 1, 1) throws an error.
</I>&gt;<i>
</I>&gt;<i> Because '$' is not a valid replacement string.
</I>&gt;<i>
</I>&gt;<i> OK, I think I've understood what you wanted (maybe!). You didn't want to
</I>&gt;<i> construct the replacement string using a function, you wanted to apply a
</I>&gt;<i> function to the matching substrings found by the matching operation: you
</I>&gt;<i> want a higher-order replace(). Saxon has such a thing in the form of
</I>&gt;<i> saxon:analyze-string (see
</I>&gt;<i> http://www.saxonica.com/documentation/#!functions/saxon/analyze-
</I>&gt;<i> string) but in 3.0 the WG took a different direction in its definition
</I>of
&gt;<i> fn:analyze-string(), which is probably easier for ordinary mortals to
</I>cope
&gt;<i> with: http://www.w3.org/TR/xpath-functions-30/#func-analyze-string
</I>&gt;<i> &gt;
</I>&gt;<i> Michael Kay
</I>&gt;<i> Saxonica
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I></PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004079.html?utm_source=feedly</link><pubDate>Wed, 01 May 2013 01:32:38 GMT</pubDate></item><item><title>  Fuctions and variables in replacement string of	fn:replace()
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
On 1 May 2013, at 04:14, Liam R E Quin wrote:

&gt;<i> On Tue, 2013-04-30 at 23:01 -0400, David Sewell wrote:
</I>&gt;&gt;<i> When using fn:replace(), is it kosher or illegal to construct the
</I>&gt;&gt;<i> replacement string dynamically using a function?
</I>
Yes. XQuery is an orthogonal language, any expression can be replaced by a different expression that returns the same value.

&gt;&gt;<i> In some cases this
</I>&gt;&gt;<i> seems to work (tested in Saxon and MarkLogic):
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> xquery version &quot;1.0&quot;;
</I>&gt;&gt;<i> let $string := &quot;Now, let's SEND OUT for QUICHE!!&quot;
</I>&gt;&gt;<i> let $match := &quot;[A-Z][A-Z]+&quot;
</I>&gt;&gt;<i> return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
</I>&gt;&gt;<i> ==&gt; Now, let's SENDSEND OUTOUT for QUICHEQUICHE!!
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> but in other cases it doesn't. For example, lower-case(&quot;$0&quot;) has no
</I>&gt;&gt;<i> effect.
</I>
It should have no effect. It's the same as replace($string, $match, '$0') which replaces every string that matches $match with itself.

&gt;&gt;<i> And substring(&quot;$0&quot;, 1, 1) throws an error.
</I>
Because '$' is not a valid replacement string.

OK, I think I've understood what you wanted (maybe!). You didn't want to construct the replacement string using a function, you wanted to apply a function to the matching substrings found by the matching operation: you want a higher-order replace(). Saxon has such a thing in the form of saxon:analyze-string (see http://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
&gt;<i> 
</I>Michael Kay
Saxonica


</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004078.html</link><pubDate>Wed, 01 May 2013 01:02:07 GMT</pubDate></item><item><title>  Fuctions and variables in replacement string of	fn:replace()
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
On 1 May 2013, at 04:14, Liam R E Quin wrote:

&gt;<i> On Tue, 2013-04-30 at 23:01 -0400, David Sewell wrote:
</I>&gt;&gt;<i> When using fn:replace(), is it kosher or illegal to construct the
</I>&gt;&gt;<i> replacement string dynamically using a function?
</I>
Yes. XQuery is an orthogonal language, any expression can be replaced by a different expression that returns the same value.

&gt;&gt;<i> In some cases this
</I>&gt;&gt;<i> seems to work (tested in Saxon and MarkLogic):
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> xquery version &quot;1.0&quot;;
</I>&gt;&gt;<i> let $string := &quot;Now, let's SEND OUT for QUICHE!!&quot;
</I>&gt;&gt;<i> let $match := &quot;[A-Z][A-Z]+&quot;
</I>&gt;&gt;<i> return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
</I>&gt;&gt;<i> ==&gt; Now, let's SENDSEND OUTOUT for QUICHEQUICHE!!
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> but in other cases it doesn't. For example, lower-case(&quot;$0&quot;) has no
</I>&gt;&gt;<i> effect.
</I>
It should have no effect. It's the same as replace($string, $match, '$0') which replaces every string that matches $match with itself.

&gt;&gt;<i> And substring(&quot;$0&quot;, 1, 1) throws an error.
</I>
Because '$' is not a valid replacement string.

OK, I think I've understood what you wanted (maybe!). You didn't want to construct the replacement string using a function, you wanted to apply a function to the matching substrings found by the matching operation: you want a higher-order replace(). Saxon has such a thing in the form of saxon:analyze-string (see http://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
&gt;<i> 
</I>Michael Kay
Saxonica


</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201305/004078.html?utm_source=feedly</link><pubDate>Wed, 01 May 2013 01:02:07 GMT</pubDate></item><item><title>  Fuctions and variables in replacement string of fn:replace()
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Tue, 2013-04-30 at 23:01 -0400, David Sewell wrote:
&gt;<i> When using fn:replace(), is it kosher or illegal to construct the
</I>&gt;<i> replacement string dynamically using a function? In some cases this
</I>&gt;<i> seems to work (tested in Saxon and MarkLogic):
</I>&gt;<i> 
</I>&gt;<i> xquery version &quot;1.0&quot;;
</I>&gt;<i> let $string := &quot;Now, let's SEND OUT for QUICHE!!&quot;
</I>&gt;<i> let $match := &quot;[A-Z][A-Z]+&quot;
</I>&gt;<i> return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
</I>&gt;<i> ==&gt; Now, let's SENDSEND OUTOUT for QUICHEQUICHE!!
</I>&gt;<i> 
</I>&gt;<i> but in other cases it doesn't. For example, lower-case(&quot;$0&quot;) has no
</I>&gt;<i> effect. And substring(&quot;$0&quot;, 1, 1) throws an error.
</I>
In your first example,
return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
the replace function gets called with 3 arguments:
    replace(
      &quot;Now, let's SEND OUT for QUICHE!!&quot;,
      &quot;[A-Z][A-Z]+&quot;,
      &quot;$0$0&quot;
    )

Now, replace() treats $0 as whatever matched - it is not a variable
reference, even though it looks like one. Th $ sign is special to
replace().

However, lower-case(&quot;$0&quot;) will return &quot;$0&quot; since neither $ nor 0 is an
upper case letter.

substring(&quot;$0&quot;, 1, 1) ought to return a $ sign, and if you use that as
an argument to replace(0 you'll get an error, because replace() wants
dollar signs to be followed by digits.

Hope that helps.

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

</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004077.html</link><pubDate>Tue, 30 Apr 2013 20:14:27 GMT</pubDate></item><item><title>  Fuctions and variables in replacement string of fn:replace()
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Tue, 2013-04-30 at 23:01 -0400, David Sewell wrote:
&gt;<i> When using fn:replace(), is it kosher or illegal to construct the
</I>&gt;<i> replacement string dynamically using a function? In some cases this
</I>&gt;<i> seems to work (tested in Saxon and MarkLogic):
</I>&gt;<i> 
</I>&gt;<i> xquery version &quot;1.0&quot;;
</I>&gt;<i> let $string := &quot;Now, let's SEND OUT for QUICHE!!&quot;
</I>&gt;<i> let $match := &quot;[A-Z][A-Z]+&quot;
</I>&gt;<i> return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
</I>&gt;<i> ==&gt; Now, let's SENDSEND OUTOUT for QUICHEQUICHE!!
</I>&gt;<i> 
</I>&gt;<i> but in other cases it doesn't. For example, lower-case(&quot;$0&quot;) has no
</I>&gt;<i> effect. And substring(&quot;$0&quot;, 1, 1) throws an error.
</I>
In your first example,
return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
the replace function gets called with 3 arguments:
    replace(
      &quot;Now, let's SEND OUT for QUICHE!!&quot;,
      &quot;[A-Z][A-Z]+&quot;,
      &quot;$0$0&quot;
    )

Now, replace() treats $0 as whatever matched - it is not a variable
reference, even though it looks like one. Th $ sign is special to
replace().

However, lower-case(&quot;$0&quot;) will return &quot;$0&quot; since neither $ nor 0 is an
upper case letter.

substring(&quot;$0&quot;, 1, 1) ought to return a $ sign, and if you use that as
an argument to replace(0 you'll get an error, because replace() wants
dollar signs to be followed by digits.

Hope that helps.

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

</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004077.html?utm_source=feedly</link><pubDate>Tue, 30 Apr 2013 20:14:27 GMT</pubDate></item><item><title>  Fuctions and variables in replacement string of	fn:replace()
   </title><description><![CDATA[<!--beginarticle-->
<PRE>When using fn:replace(), is it kosher or illegal to construct the
replacement string dynamically using a function? In some cases this
seems to work (tested in Saxon and MarkLogic):

xquery version &quot;1.0&quot;;
let $string := &quot;Now, let's SEND OUT for QUICHE!!&quot;
let $match := &quot;[A-Z][A-Z]+&quot;
return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
==&gt; Now, let's SENDSEND OUTOUT for QUICHEQUICHE!!

but in other cases it doesn't. For example, lower-case(&quot;$0&quot;) has no
effect. And substring(&quot;$0&quot;, 1, 1) throws an error.

DS

-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: http://x-query.com/mailman/listinfo/talk   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004076.html</link><pubDate>Tue, 30 Apr 2013 20:01:01 GMT</pubDate></item><item><title>  Fuctions and variables in replacement string of	fn:replace()
   </title><description><![CDATA[<!--beginarticle-->
<PRE>When using fn:replace(), is it kosher or illegal to construct the
replacement string dynamically using a function? In some cases this
seems to work (tested in Saxon and MarkLogic):

xquery version &quot;1.0&quot;;
let $string := &quot;Now, let's SEND OUT for QUICHE!!&quot;
let $match := &quot;[A-Z][A-Z]+&quot;
return replace($string, $match, concat(&quot;$0&quot;,&quot;$0&quot;))
==&gt; Now, let's SENDSEND OUTOUT for QUICHEQUICHE!!

but in other cases it doesn't. For example, lower-case(&quot;$0&quot;) has no
effect. And substring(&quot;$0&quot;, 1, 1) throws an error.

DS

-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: http://x-query.com/mailman/listinfo/talk   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004076.html?utm_source=feedly</link><pubDate>Tue, 30 Apr 2013 20:01:01 GMT</pubDate></item><item><title>  Xquery and API documentation
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi Jakob,

I also recently saw Swagger and was very impressed and was considering
doing something with it at some point.

The XQuery 3.0 annotations for defining a REST API are known as RESTXQ.

If the platform you are using supports RESTXQ and introspection, then
you could probably quite easily write a small XQuery script to find
the annotated functions and create the JSON file for Swagger. If your
on eXist you could probably even write the function as a RESTXQ
function, making the api-doc a REST API function too :-)
Another option would be if you have RESTXQ support but no
introspection, to use rest:resource-functions() function to get the
details of the annotated functions and then create JSON from that.

Cheers Adam.



On 24 April 2013 13:40, Jakob Fix &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Hi,
</I>&gt;<i>
</I>&gt;<i> I'm looking for ways to generate API documentation from our Xquery code. Of
</I>&gt;<i> course, there is Xqdoc, but I'm looking to get something that is a) a bit
</I>&gt;<i> better-looking and more importantly, b) usable by the developer who wants to
</I>&gt;<i> try out the API.
</I>&gt;<i>
</I>&gt;<i> I've been looking at Swagger [1] which seems to do what I want. It expects a
</I>&gt;<i> JSON file that would need to be generated from the Xquery code. I think I
</I>&gt;<i> remember Adam Retter giving a talk on how to use 3.0 annotations for
</I>&gt;<i> defining the API in Prague a couple of years ago.
</I>&gt;<i>
</I>&gt;<i> Are there already efforts underway to get something like this going?
</I>&gt;<i>
</I>&gt;<i> I would be most interested,
</I>&gt;<i> Jakob.
</I>&gt;<i>
</I>&gt;<i> [1] https://developers.helloreverb.com/swagger/
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>


-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004075.html</link><pubDate>Wed, 24 Apr 2013 06:21:51 GMT</pubDate></item><item><title>  Xquery and API documentation
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi Jakob,

I also recently saw Swagger and was very impressed and was considering
doing something with it at some point.

The XQuery 3.0 annotations for defining a REST API are known as RESTXQ.

If the platform you are using supports RESTXQ and introspection, then
you could probably quite easily write a small XQuery script to find
the annotated functions and create the JSON file for Swagger. If your
on eXist you could probably even write the function as a RESTXQ
function, making the api-doc a REST API function too :-)
Another option would be if you have RESTXQ support but no
introspection, to use rest:resource-functions() function to get the
details of the annotated functions and then create JSON from that.

Cheers Adam.



On 24 April 2013 13:40, Jakob Fix &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Hi,
</I>&gt;<i>
</I>&gt;<i> I'm looking for ways to generate API documentation from our Xquery code. Of
</I>&gt;<i> course, there is Xqdoc, but I'm looking to get something that is a) a bit
</I>&gt;<i> better-looking and more importantly, b) usable by the developer who wants to
</I>&gt;<i> try out the API.
</I>&gt;<i>
</I>&gt;<i> I've been looking at Swagger [1] which seems to do what I want. It expects a
</I>&gt;<i> JSON file that would need to be generated from the Xquery code. I think I
</I>&gt;<i> remember Adam Retter giving a talk on how to use 3.0 annotations for
</I>&gt;<i> defining the API in Prague a couple of years ago.
</I>&gt;<i>
</I>&gt;<i> Are there already efforts underway to get something like this going?
</I>&gt;<i>
</I>&gt;<i> I would be most interested,
</I>&gt;<i> Jakob.
</I>&gt;<i>
</I>&gt;<i> [1] https://developers.helloreverb.com/swagger/
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>


-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004075.html?utm_source=feedly</link><pubDate>Wed, 24 Apr 2013 06:21:51 GMT</pubDate></item><item><title>  Xquery and API documentation
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Try xquerydoc, which can extract XQDoc comments and style them in HTML and markdown. It's written in pure XQuery 1.0, with a small amount of XProc to drive the initial execution.

https://github.com/xquery/xquerydoc

John

On 24 Apr 2013, at 13:40, Jakob Fix &lt;http://x-query.com/mailman/listinfo/talk&gt;
 wrote:

&gt;<i> Hi,
</I>&gt;<i> 
</I>&gt;<i> I'm looking for ways to generate API documentation from our Xquery code. Of course, there is Xqdoc, but I'm looking to get something that is a) a bit better-looking and more importantly, b) usable by the developer who wants to try out the API.
</I>&gt;<i> 
</I>&gt;<i> I've been looking at Swagger [1] which seems to do what I want. It expects a JSON file that would need to be generated from the Xquery code. I think I remember Adam Retter giving a talk on how to use 3.0 annotations for defining the API in Prague a couple of years ago.
</I>&gt;<i> 
</I>&gt;<i> Are there already efforts underway to get something like this going?
</I>&gt;<i> 
</I>&gt;<i> I would be most interested,
</I>&gt;<i> Jakob.
</I>&gt;<i> 
</I>&gt;<i> [1] https://developers.helloreverb.com/swagger/
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004074.html</link><pubDate>Wed, 24 Apr 2013 05:57:55 GMT</pubDate></item><item><title>  Xquery and API documentation
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Try xquerydoc, which can extract XQDoc comments and style them in HTML and markdown. It's written in pure XQuery 1.0, with a small amount of XProc to drive the initial execution.

https://github.com/xquery/xquerydoc

John

On 24 Apr 2013, at 13:40, Jakob Fix &lt;http://x-query.com/mailman/listinfo/talk&gt;
 wrote:

&gt;<i> Hi,
</I>&gt;<i> 
</I>&gt;<i> I'm looking for ways to generate API documentation from our Xquery code. Of course, there is Xqdoc, but I'm looking to get something that is a) a bit better-looking and more importantly, b) usable by the developer who wants to try out the API.
</I>&gt;<i> 
</I>&gt;<i> I've been looking at Swagger [1] which seems to do what I want. It expects a JSON file that would need to be generated from the Xquery code. I think I remember Adam Retter giving a talk on how to use 3.0 annotations for defining the API in Prague a couple of years ago.
</I>&gt;<i> 
</I>&gt;<i> Are there already efforts underway to get something like this going?
</I>&gt;<i> 
</I>&gt;<i> I would be most interested,
</I>&gt;<i> Jakob.
</I>&gt;<i> 
</I>&gt;<i> [1] https://developers.helloreverb.com/swagger/
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004074.html?utm_source=feedly</link><pubDate>Wed, 24 Apr 2013 05:57:55 GMT</pubDate></item><item><title>  Need xquery function for &amp;quot;number of days between two dates&amp;quot;
   </title><description><![CDATA[<!--beginarticle-->
<PRE>sudheshna iyer wrote:

&gt;<i> I need a xquery function which takes two dates and return number of days
</I>&gt;<i> that lapsed between these two dates. Input to this function can be a 2
</I>&gt;<i> strings of type &quot;mm/dd/yyyy 00:00:00&quot;.
</I>&gt;<i>
</I>&gt;<i> Can any of you have a function handy to do this?
</I>
Well there is an xs:dateTime data type supporting this:

days-from-duration(current-dateTime() - xs:dateTime('2013-01-01T00:00:00'))



You would first need to convert your date time format to the xs:dateTime 
format of yyyy-mm-ddThh:mm:ss respectively construct xs:dateTime values 
from your format.
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004073.html</link><pubDate>Fri, 12 Apr 2013 10:25:01 GMT</pubDate></item><item><title>  Need xquery function for &amp;quot;number of days between two dates&amp;quot;
   </title><description><![CDATA[<!--beginarticle-->
<PRE>sudheshna iyer wrote:

&gt;<i> I need a xquery function which takes two dates and return number of days
</I>&gt;<i> that lapsed between these two dates. Input to this function can be a 2
</I>&gt;<i> strings of type &quot;mm/dd/yyyy 00:00:00&quot;.
</I>&gt;<i>
</I>&gt;<i> Can any of you have a function handy to do this?
</I>
Well there is an xs:dateTime data type supporting this:

days-from-duration(current-dateTime() - xs:dateTime('2013-01-01T00:00:00'))



You would first need to convert your date time format to the xs:dateTime 
format of yyyy-mm-ddThh:mm:ss respectively construct xs:dateTime values 
from your format.
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004073.html?utm_source=feedly</link><pubDate>Fri, 12 Apr 2013 10:25:01 GMT</pubDate></item><item><title>  XQuery Update vs. Perl
   </title><description><![CDATA[<!--beginarticle-->
<PRE>OK, I figured out how to do most of it:
copy $c := doc(&quot;zaokeng.kml&quot;)
modify (
  for $d in $c//*:Point
  return insert node (
  &lt;extrude&gt;1&lt;/extrude&gt;,
  &lt;altitudeMode&gt;relativeToGround&lt;/altitudeMode&gt;
		)  before $d/*:coordinates
)
return $c

As far as inserting things into the text of a node,
well as you can see in
http://www.mail-archive.com/basex-talk%40mailman.uni-konstanz.de/msg02434.html
if I let basex's doc() get its hands on it my significant whitespace
gets zapped anyway...
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004072.html</link><pubDate>Thu, 04 Apr 2013 20:12:40 GMT</pubDate></item><item><title>  XQuery Update vs. Perl
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Gentlemen, though I read
http://docs.basex.org/wiki/XQuery_Update
http://docs.oracle.com/cd/E17276_01/html/gsg_xml/cxx/modifydocument.html
it seems nothing can beat
#!/usr/bin/perl
while(&lt;&gt;){
    s!&lt;Point&gt;!$&amp;&lt;extrude&gt;1&lt;/extrude&gt;&lt;altitudeMode&gt;relativeToGround&lt;/altitudeMode&gt;!;
    print;
}
for simply inserting nodes ___and getting the whole modified document
back, and not just the modified Point nodes___.

How can I do
$ perl above_program.pl &lt; input &gt; output
but instead e.g., with basex etc.?

P.S., I also want to change all the
	  120.8663222,24.1810570
	  120.8666897,24.1811994
	  120.8661032,24.1812131
to
	  120.8663222,24.1810570,10
	  120.8666897,24.1811994,10
	  120.8661032,24.1812131,10
I bet it is 1000 times easier with perl.

To see the source I want to modify, do
$ wget http://jidanni.org/location/zaokeng.kmz
$ unzip zaokeng.kmz
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004071.html</link><pubDate>Thu, 04 Apr 2013 04:04:41 GMT</pubDate></item><item><title>  First draft of the Web Application spec
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&#160; Hi,

&#160; I thought you might be interested in the following announce, as
it is about a spec for writing XQuery main modules and libraries
(among other technologies) to implement server-side response to
HTTP requests.

&#160; Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


&#160; Hi,

&#160; I am very pleased to announce the first public draft of the
&quot;Web Application&quot; spec from the W3C EXPath CG.&#160; It is available
at:

&#160;&#160;&#160; http://expath.org/spec/webapp

&#160; The goal is to define a general purpose binding to HTTP, on the
server side.&#160; The spec defines how components are passed the HTTP
request information, how they return the HTTP response to send
back, and how requests are dispatched to which components.

&#160; Components can be XSLT, XQuery and/or XProc components.&#160; The
can be used to serve resources (or web pages), to create filters,
and to implement specific error handlers.

&#160; Servlex is an open-source implementation of this specification.
See the following links for more information on the EXPath
initiative, on the W3C EXPath CG, and on Servlex:

&#160;&#160;&#160; http://expath.org/
&#160;&#160;&#160; http://w3.org/community/expath/
&#160;&#160;&#160; http://github.com/fgeorges/servlex

&#160; Comments welcome!

&#160; Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004070.html</link><pubDate>Wed, 03 Apr 2013 10:54:01 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>MS&gt; IIRC he's all het up about {} ...
Yes something like that.
Anyway there's no point in discussing it again.
I just want to say &quot;doctors have proven that the most one can remember
is (: and :).&quot;
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004069.html</link><pubDate>Tue, 02 Apr 2013 10:28:19 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>XQuery comments are (: trivial :)

Where exactly they work is complicated ... until you understand XQuery then its trivial. 


----------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.xmlsh.org

-----Original Message-----
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf Of Michael Sokolov
Sent: Tuesday, April 02, 2013 2:23 PM
To: Florent Georges
Cc: http://x-query.com/mailman/listinfo/talk; http://x-query.com/mailman/listinfo/talk
Subject: Re:  let's comment out a line in XQuery

On 04/02/2013 01:34 PM, Florent Georges wrote:
&gt;<i> http://x-query.com/mailman/listinfo/talk wrote:
</I>&gt;<i>
</I>&gt;<i>    
</I>&gt;&gt;<i> there is no way for me to remember the xquery complex full
</I>&gt;&gt;<i> comment syntax for more than one month.
</I>&gt;&gt;<i>      
</I>&gt;<i>    The &quot;smiley syntax&quot;, complex?  Really?
</I>&gt;<i>
</I>&gt;<i>    
</I>IIRC he's all het up about {} not being syntactically valid, preventing 
{(: $expression :)}.

-- 
Michael Sokolov
Senior Architect
Safari Books Online

_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004068.html</link><pubDate>Tue, 02 Apr 2013 10:27:12 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 04/02/2013 01:34 PM, Florent Georges wrote:
&gt;<i> http://x-query.com/mailman/listinfo/talk wrote:
</I>&gt;<i>
</I>&gt;<i>    
</I>&gt;&gt;<i> there is no way for me to remember the xquery complex full
</I>&gt;&gt;<i> comment syntax for more than one month.
</I>&gt;&gt;<i>      
</I>&gt;<i>    The &quot;smiley syntax&quot;, complex?  Really?
</I>&gt;<i>
</I>&gt;<i>    
</I>IIRC he's all het up about {} not being syntactically valid, preventing 
{(: $expression :)}.

-- 
Michael Sokolov
Senior Architect
Safari Books Online

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004067.html</link><pubDate>Tue, 02 Apr 2013 10:23:24 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>http://x-query.com/mailman/listinfo/talk wrote:

&gt;<i> there is no way for me to remember the xquery complex full
</I>&gt;<i> comment syntax for more than one month.
</I>
&#160; The &quot;smiley syntax&quot;, complex?&#160; Really?

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004066.html</link><pubDate>Tue, 02 Apr 2013 09:34:13 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>I'm back, and it's proven!: there is no way for me to remember the
xquery complex full comment syntax for more than one month. Solution.
put comments into a separate file. OK.
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201304/004065.html</link><pubDate>Mon, 01 Apr 2013 21:20:04 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>It's not just the WHERE clause, of course: ORDER BY and GROUP BY also affect the strategy.

In XQuery 1.0 nearly every FLWOR expression could be rewritten as an expression on sequences of items (rather than tuples). The only exception was a rather weird and rare case involving ORDER BY where the order of tuples couldn't be reduced to an ordering of items in the input sequences. Saxon reduced everything to sequence operations, handling this special case with a bit of custom code that essentially wrapped the tuple as a map-like item.

In XQuery 3.0 there are many more FLWOR expressions that can't be rewritten in terms of operations on item sequences, and native support for tuple streams in the run-time engine becomes almost unavoidable. Once you have that support, there's not necessarily any benefit in eliminating the WHERE clauses (though Saxon still attempts to do so, mainly to take advantage of the other optimisations available for filter expressions). The important thing is to promote each conjunctive term of the WHERE clause up the pipeline to the earliest place where it can be evaluated; whether it is then turned into a filter expression is relatively unimportant.

Michael Kay
Saxonica


On 29 Mar 2013, at 07:35, Liam R E Quin wrote:

&gt;<i> 
</I>&gt;<i> On Wed, 2013-03-27 at 13:26 +0000, deBakker, Bas wrote:
</I>&gt;&gt;<i> Wouldn't that be equivalent to
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i>    for $a in expr1, $b in expr2, $c in expr3[$a = $b + .]
</I>&gt;&gt;<i>    return $a
</I>&gt;<i> 
</I>&gt;<i> I notice that BaseX does exactly that rewrite.
</I>&gt;<i> 
</I>&gt;<i> In SQL with a WHERE clause some of the values may be NULL, but that
</I>&gt;<i> can't occur in XQuery today; if it could, there might be tuples without
</I>&gt;<i> a value for $c, in which case the rewrite wouldn't work.
</I>&gt;<i> 
</I>&gt;<i> A smart optimizer with knowledge of the input could rewrite at runtime
</I>&gt;<i> to put the [predicate] on the expression likely to have the fewest
</I>&gt;<i> nodes, or could rewrite to say, for $a in expr1[. ge min($b) + min($c)];
</I>&gt;<i> this sort of rewrite can turn a theoretically O(n^3) operation into O(n)
</I>&gt;<i> in practice.
</I>&gt;<i> 
</I>&gt;<i> I think the answer is, use &quot;where&quot; when it makes the query more
</I>&gt;<i> readable, or if there are positional or grouping clauses. Some
</I>&gt;<i> implementatins do more optimizatoins than others, though, so sometimes
</I>&gt;<i> readability ends up second to speed.
</I>&gt;<i> 
</I>&gt;<i> Liam
</I>&gt;<i> 
</I>&gt;<i> -- 
</I>&gt;<i> Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
</I>&gt;<i> Pictures from old books: http://fromoldbooks.org/
</I>&gt;<i> Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004064.html</link><pubDate>Thu, 28 Mar 2013 23:54:06 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
On Wed, 2013-03-27 at 13:26 +0000, deBakker, Bas wrote:
&gt;<i> Wouldn't that be equivalent to
</I>&gt;<i> 
</I>&gt;<i>     for $a in expr1, $b in expr2, $c in expr3[$a = $b + .]
</I>&gt;<i>     return $a
</I>
I notice that BaseX does exactly that rewrite.

In SQL with a WHERE clause some of the values may be NULL, but that
can't occur in XQuery today; if it could, there might be tuples without
a value for $c, in which case the rewrite wouldn't work.

A smart optimizer with knowledge of the input could rewrite at runtime
to put the [predicate] on the expression likely to have the fewest
nodes, or could rewrite to say, for $a in expr1[. ge min($b) + min($c)];
this sort of rewrite can turn a theoretically O(n^3) operation into O(n)
in practice.

I think the answer is, use &quot;where&quot; when it makes the query more
readable, or if there are positional or grouping clauses. Some
implementatins do more optimizatoins than others, though, so sometimes
readability ends up second to speed.

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

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004063.html</link><pubDate>Thu, 28 Mar 2013 23:35:38 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>I see - nice!  Still trying to wrap my head around it to generalize, but 
I see your point.

-Mike

On 03/28/2013 02:22 PM, daniela florescu wrote:
&gt;<i> Not in the general case of such pattern -- because of cardinality.
</I>&gt;<i> (I told you XQuery is twisted :-)
</I>&gt;<i>
</I>&gt;<i> Imagine that the function would have looked like this instead of the one I wrote:
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> declare function foo($x)
</I>&gt;<i> {
</I>&gt;<i>     if ($x/@a) then ($x, $x) else&lt;b/&gt;
</I>&gt;<i> };
</I>&gt;<i>
</I>&gt;<i> then count(...) of the total result  is different  !
</I>&gt;<i>
</I>&gt;<i> :-)
</I>&gt;<i>
</I>&gt;<i> Dana
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>    
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>        
</I>&gt;&gt;<i> Yes, that is twisted for sure.  But isn't it also equivalent to:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> for $x in Blah1
</I>&gt;&gt;<i> for $y in Blah2
</I>&gt;&gt;<i> for $z in foo($y)[. is .]
</I>&gt;&gt;<i> return $x
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> ?
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> not that that really makes any difference, in some sense, but given the problem as stated, I don't think a where clause is required
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> -- 
</I>&gt;&gt;<i> Michael Sokolov
</I>&gt;&gt;<i> Senior Architect
</I>&gt;&gt;<i> Safari Books Online
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i>      
</I>&gt;<i>    
</I>

-- 
Michael Sokolov
Senior Architect
Safari Books Online

</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004062.html</link><pubDate>Thu, 28 Mar 2013 11:08:13 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Not in the general case of such pattern -- because of cardinality.
(I told you XQuery is twisted :-)

Imagine that the function would have looked like this instead of the one I wrote:


declare function foo($x) 
{
   if ($x/@a) then ($x, $x) else &lt;b/&gt;
};

then count(...) of the total result  is different  !

:<i>-)
</I>
Dana



&gt;&gt;<i> 
</I>&gt;&gt;<i>   
</I>&gt;<i> Yes, that is twisted for sure.  But isn't it also equivalent to:
</I>&gt;<i> 
</I>&gt;<i> for $x in Blah1
</I>&gt;<i> for $y in Blah2
</I>&gt;<i> for $z in foo($y)[. is .]
</I>&gt;<i> return $x
</I>&gt;<i> 
</I>&gt;<i> ?
</I>&gt;<i> 
</I>&gt;<i> not that that really makes any difference, in some sense, but given the problem as stated, I don't think a where clause is required
</I>&gt;<i> 
</I>&gt;<i> -- 
</I>&gt;<i> Michael Sokolov
</I>&gt;<i> Senior Architect
</I>&gt;<i> Safari Books Online
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>




]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004061.html</link><pubDate>Thu, 28 Mar 2013 10:22:08 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 03/28/2013 12:23 PM, daniela florescu wrote:
&gt;<i> Michael,
</I>&gt;<i>
</I>&gt;<i> in addition to the queries I already gave you with count and groupby, here is another one in
</I>&gt;<i> pure XQuery  1.0  that cannot be reduced
</I>&gt;<i>
</I>&gt;<i> declare function foo($x)
</I>&gt;<i> {
</I>&gt;<i>      if ($x/@a) then $x else&lt;b/&gt;
</I>&gt;<i> };
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> for $x in Blah1
</I>&gt;<i> for $y in Blah2
</I>&gt;<i> let $z := foo($y)
</I>&gt;<i> where $z is $z
</I>&gt;<i> return $x
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> (variable $z cannot be unfolded because of the generation of new nodes, and then the where cannot be move up because
</I>&gt;<i> of the let)
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Sorry, I felt like being twisted minded this morning :-)
</I>&gt;<i>
</I>&gt;<i> XQuery is wicked :-)
</I>&gt;<i>    
</I>Yes, that is twisted for sure.  But isn't it also equivalent to:

for $x in Blah1
for $y in Blah2
for $z in foo($y)[. is .]
return $x

?

not that that really makes any difference, in some sense, but given the 
problem as stated, I don't think a where clause is required

-- 
Michael Sokolov
Senior Architect
Safari Books Online

</PRE>




]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004060.html</link><pubDate>Thu, 28 Mar 2013 10:15:20 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Michael,

in addition to the queries I already gave you with count and groupby, here is another one in 
pure XQuery  1.0  that cannot be reduced

declare function foo($x) 
{
    if ($x/@a) then $x else &lt;b/&gt;
};


for $x in Blah1
for $y in Blah2
let $z := foo($y)
where $z is $z
return $x


(variable $z cannot be unfolded because of the generation of new nodes, and then the where cannot be move up because
of the let)


Sorry, I felt like being twisted minded this morning :-)

XQuery is wicked :-)

Best
Dana


On Mar 27, 2013, at 7:10 PM, Michael Sokolov wrote:

&gt;<i> (forwarding Daniela's message)
</I>&gt;<i> 
</I>&gt;<i> Michael,
</I>&gt;<i> 
</I>&gt;<i> I think the ones with grouby and a where after the groupby are impossible to rewrite
</I>&gt;<i> in general (remember this from my optimizing SQL days). In this case the WHERE is the good old
</I>&gt;<i> HAVING clause of SQL.
</I>&gt;<i> 
</I>&gt;<i> Something along the lines of
</I>&gt;<i> 
</I>&gt;<i> for $x in blah
</I>&gt;<i> for $y in blah
</I>&gt;<i> group by $z:= $x/a, $t:= $y/b
</I>&gt;<i> where $z+$t &gt;25
</I>&gt;<i> return $z
</I>&gt;<i> 
</I>&gt;<i> I am putting an informal syntax, obviously.
</I>&gt;<i> 
</I>&gt;<i> Another case is when the COUNT clause exists. You cannot move the where up and down in the tuple stream in
</I>&gt;<i> such a case.
</I>&gt;<i> 
</I>&gt;<i> for $x in Blah1
</I>&gt;<i> for $y in Blah2
</I>&gt;<i> count $i
</I>&gt;<i> where $x/a eq $y/b
</I>&gt;<i> return something using $i
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> HTH
</I>&gt;<i> Dana
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> On Mar 27, 2013, at 5:31 AM, Michael Sokolov wrote:
</I>&gt;<i> 
</I>&gt;&gt;<i> I'm trying to come up with examples in which &quot;where&quot; clauses cannot be rewritten as XPath predicates.  So far, the ones I have all involve an &quot;at&quot; counter.  Are there others?
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> --
</I>&gt;&gt;<i> Michael Sokolov
</I>&gt;&gt;<i> Senior Architect
</I>&gt;&gt;<i> Safari Books Online
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>




]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004059.html</link><pubDate>Thu, 28 Mar 2013 08:23:02 GMT</pubDate></item><item><title>  [ANN] Pascal XQuery 1 engine now with JSONiq
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi,

there is now a new release of my Pascal-based XQuery engine which adds 
JSONiq support.
(not JSONiq Update through, but there is an old global variable 
extension, which can be
used to update some (but not all) object properties without involving 
snapshots )
The XQuery part supports everything of XQuery 1 except xml schemas, and 
static type checking,
with some extensions like pattern matching, global variables or a XPath 
2-restricted mode.

     Main library page:http://www.benibela.de/sources_en.html#internettools

     Online XQuery tester: 
http://videlibri.sourceforge.net/cgi-bin/xidelcgi?extract-kind=xquery

     Command Line Tool: http://videlibri.sourceforge.net/xidel.html

     XQTS Results: 
http://www.benibela.de/documentation/internettools/internettoolsxqts.html

     (skipping invalid inputs)


Benito

</PRE>







]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004058.html</link><pubDate>Thu, 28 Mar 2013 04:15:50 GMT</pubDate></item><item><title>  Fwd: Re:  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>(forwarding Daniela's message)

Michael,

I think the ones with grouby and a where after the groupby are impossible to rewrite
in general (remember this from my optimizing SQL days). In this case the WHERE is the good old
HAVING clause of SQL.

Something along the lines of

for $x in blah
for $y in blah
group by $z:= $x/a, $t:= $y/b
where $z+$t &gt;25
return $z

I am putting an informal syntax, obviously.

Another case is when the COUNT clause exists. You cannot move the where up and down in the tuple stream in
such a case.

for $x in Blah1
for $y in Blah2
count $i
where $x/a eq $y/b
return something using $i


HTH
Dana


On Mar 27, 2013, at 5:31 AM, Michael Sokolov wrote:

&gt;<i> I'm trying to come up with examples in which &quot;where&quot; clauses cannot be rewritten as XPath predicates.  So far, the ones I have all involve an &quot;at&quot; counter.  Are there others?
</I>&gt;<i>
</I>&gt;<i> --
</I>&gt;<i> Michael Sokolov
</I>&gt;<i> Senior Architect
</I>&gt;<i> Safari Books Online
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>


</PRE>





]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004057.html</link><pubDate>Wed, 27 Mar 2013 18:10:35 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 3/27/13 8:31 AM, Michael Sokolov wrote:
&gt;<i> I'm trying to come up with examples in which &quot;where&quot; clauses cannot be 
</I>&gt;<i> rewritten as XPath predicates.  So far, the ones I have all involve an 
</I>&gt;<i> &quot;at&quot; counter.  Are there others?
</I>&gt;<i>
</I>OK - thanks, Ken, Michael, Daniela - I'll just summarize: in XQuery 1.0 
(I didn't say, but that's my current target) the only examples we have 
are those with &quot;at&quot; - Bas and Michael demonstrated that most expressions 
can be rewritten, including Ken's, even if with some difficulty.  
Daniela's examples (group by, count) are from XQuery 3.0 - they look 
irreducible.

Thanks again

-Mike Sokolov
</PRE>




]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004056.html</link><pubDate>Wed, 27 Mar 2013 17:09:58 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
On 27/03/2013 12:31, Michael Sokolov wrote:
&gt;<i> I'm trying to come up with examples in which &quot;where&quot; clauses cannot be 
</I>&gt;<i> rewritten as XPath predicates.  So far, the ones I have all involve an 
</I>&gt;<i> &quot;at&quot; counter.  Are there others?
</I>&gt;<i>
</I>The ones that are trickiest to rewrite are 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


</PRE>




]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004055.html</link><pubDate>Wed, 27 Mar 2013 14:43:28 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>At 2013-03-27 13:26 +0000, deBakker, Bas wrote:
&gt;<i>Wouldn't that be equivalent to
</I>&gt;<i>
</I>&gt;<i>     for $a in expr1, $b in expr2, $c in expr3[$a = $b + .]
</I>&gt;<i>     return $a
</I>
Thank you, Bas, yes I grant that your expression is equivalent to mine.

I failed to acknowledge that tuples are only created when there is a 
binding value for every member of the tuple.

I appreciate the clarification.

. . . . . . . . Ken

&gt;<i>Bas
</I>&gt;<i>
</I>&gt;<i>-----Original Message-----
</I>&gt;<i>From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On 
</I>&gt;<i>Behalf Of G. Ken Holman
</I>&gt;<i>Sent: Wednesday, March 27, 2013 14:19
</I>&gt;<i>To: http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>Subject: Re:  where clause
</I>&gt;<i>
</I>&gt;<i>At 2013-03-27 08:31 -0400, Michael Sokolov wrote:
</I>&gt;<i> &gt;I'm trying to come up with examples in which &quot;where&quot; clauses cannot be
</I>&gt;<i> &gt;rewritten as XPath predicates.  So far, the ones I have all involve an
</I>&gt;<i> &gt;&quot;at&quot; counter.  Are there others?
</I>&gt;<i>
</I>&gt;<i>I can see no difference off hand when creating 1-tuples, as a 
</I>&gt;<i>1-tuple is essentially just a sequence.
</I>&gt;<i>
</I>&gt;<i>However, when creating n-tuples (either with the &quot;at&quot; keyword as you 
</I>&gt;<i>say or with other bound variables in your expression), the where 
</I>&gt;<i>clause acts on the tuple, not just on a set of values.  Here is a 
</I>&gt;<i>3-tuple expression example:
</I>&gt;<i>
</I>&gt;<i>     for $a in expr1, $b in expr2, $c in expr3
</I>&gt;<i>     where $a=$b+$c
</I>&gt;<i>     return $a
</I>&gt;<i>
</I>&gt;<i>I hope this is helpful.
</I>&gt;<i>
</I>&gt;<i>. . . . . . . . Ken
</I>


--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
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/m/ |
G. Ken Holman                   mailto:http://x-query.com/mailman/listinfo/talk |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |

</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004054.html</link><pubDate>Wed, 27 Mar 2013 07:01:31 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Wouldn't that be equivalent to

    for $a in expr1, $b in expr2, $c in expr3[$a = $b + .]
    return $a

Bas

-----Original Message-----
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf Of G. Ken Holman
Sent: Wednesday, March 27, 2013 14:19
To: http://x-query.com/mailman/listinfo/talk
Subject: Re:  where clause

At 2013-03-27 08:31 -0400, Michael Sokolov wrote:
&gt;<i>I'm trying to come up with examples in which &quot;where&quot; clauses cannot be 
</I>&gt;<i>rewritten as XPath predicates.  So far, the ones I have all involve an 
</I>&gt;<i>&quot;at&quot; counter.  Are there others?
</I>
I can see no difference off hand when creating 1-tuples, as a 1-tuple is essentially just a sequence.

However, when creating n-tuples (either with the &quot;at&quot; keyword as you say or with other bound variables in your expression), the where clause acts on the tuple, not just on a set of values.  Here is a 3-tuple expression example:

    for $a in expr1, $b in expr2, $c in expr3
    where $a=$b+$c
    return $a

I hope this is helpful.

. . . . . . . . Ken


--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 | 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:http://x-query.com/mailman/listinfo/talk |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |

_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk


</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004053.html</link><pubDate>Wed, 27 Mar 2013 05:26:52 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>At 2013-03-27 08:31 -0400, Michael Sokolov wrote:
&gt;<i>I'm trying to come up with examples in which &quot;where&quot; clauses cannot 
</I>&gt;<i>be rewritten as XPath predicates.  So far, the ones I have all 
</I>&gt;<i>involve an &quot;at&quot; counter.  Are there others?
</I>
I can see no difference off hand when creating 1-tuples, as a 1-tuple 
is essentially just a sequence.

However, when creating n-tuples (either with the &quot;at&quot; keyword as you 
say or with other bound variables in your expression), the where 
clause acts on the tuple, not just on a set of values.  Here is a 
3-tuple expression example:

    for $a in expr1, $b in expr2, $c in expr3
    where $a=$b+$c
    return $a

I hope this is helpful.

. . . . . . . . Ken


--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
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:http://x-query.com/mailman/listinfo/talk |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004052.html</link><pubDate>Wed, 27 Mar 2013 05:18:41 GMT</pubDate></item><item><title>  where clause
   </title><description><![CDATA[<!--beginarticle-->
<PRE>I'm trying to come up with examples in which &quot;where&quot; clauses cannot be 
rewritten as XPath predicates.  So far, the ones I have all involve an 
&quot;at&quot; counter.  Are there others?

-- 
Michael Sokolov
Senior Architect
Safari Books Online

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004051.html</link><pubDate>Wed, 27 Mar 2013 04:31:40 GMT</pubDate></item><item><title>  XQuery 3.0 test suite - Call for implementations of XQuery 3
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Liam,

thanks for the reminder! We are working on the finalization of XQuery
3.0, and we will submit our results as soon as we are approximating
100%.

Yoshi OKAMOTO san: our implementation of format-integer() still needs
to be adjusted to the latest version of the specification. I can just
confirm that many results of this function will be somewhat
unexpected.

Best,
Christian
___________________________

&gt;<i> The XQuery 3.0 specification is currently a W3C &quot;Candidate
</I>&gt;<i> Recommendation&quot;, meaning we (W3C) are waiting to know that it can be
</I>&gt;<i> implemented by multiple people such that people can move queries from
</I>&gt;<i> one implementation to another reasonably easily.
</I>&gt;<i>
</I>&gt;<i> If you have made an XQuery 3 implementation, please run the test suite
</I>&gt;<i> at [1] and send us the results. We can publish them anonymously if you
</I>&gt;<i> prefer (email me directly for instructions).
</I>&gt;<i>
</I>&gt;<i> Thank you for helping XQuery 3.0 move forward, and helping with this
</I>&gt;<i> work!
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> [1] http://dev.w3.org/2011/QT3-test-suite/
</I>&gt;<i>
</I>&gt;<i> --
</I>&gt;<i> Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
</I>&gt;<i> Pictures from old books: http://fromoldbooks.org/
</I>&gt;<i> Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I></PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004050.html</link><pubDate>Sun, 10 Mar 2013 11:01:57 GMT</pubDate></item><item><title>  XQuery 3.0: formatting integers
   </title><description><![CDATA[<!--beginarticle-->
<PRE>There has been quite a bit of tightening up of the format-integer 
specification over successive drafts. The Candidate Recommendation says 
this:

If the primary format token contains at least one Unicode digit then it 
is taken as a decimal digit pattern, and in this case it must match the 
regular expression ^((\p{Nd}|#|[^\p{N}\p{L}])+?)$. If it contains a 
digit but does not match this pattern, a dynamic error is raised 
[err:FODF1310].

which makes it pretty clear that in your example, the picture is an 
error (because it contains a &quot;.&quot;).

 &gt;I assume that 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 expected.

Michael Kay
Saxonica


</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004049.html</link><pubDate>Sun, 10 Mar 2013 10:08:22 GMT</pubDate></item><item><title>  XQuery 3.0 test suite - Call for implementations of	XQuery 3
   </title><description><![CDATA[<!--beginarticle-->
<PRE>The XQuery 3.0 specification is currently a W3C &quot;Candidate
Recommendation&quot;, meaning we (W3C) are waiting to know that it can be
implemented by multiple people such that people can move queries from
one implementation to another reasonably easily.

If you have made an XQuery 3 implementation, please run the test suite
at [1] and send us the results. We can publish them anonymously if you
prefer (email me directly for instructions).

Thank you for helping XQuery 3.0 move forward, and helping with this
work!


[1] http://dev.w3.org/2011/QT3-test-suite/

-- 
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

</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004048.html</link><pubDate>Sun, 10 Mar 2013 09:23:42 GMT</pubDate></item><item><title>  XQuery 3.0: formatting integers (2)
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Sun, 2013-03-10 at 16:43 +0000, Yoshi Okamoto wrote:
&gt;<i> Dear readers (2),
</I>&gt;<i> 
</I>&gt;<i> my impression is that it may be too early to test fn:format-integer(),
</I>&gt;<i> because the returned values of all implementations I have tested so
</I>&gt;<i> far seem to remain unpredictable.
</I>
It might mean that our test suite needs to be improved in this area, and
we'd really welcome contributions,,,

For moving XQuery 3.0 to a W3C Recommendation, we need to show good
interoperability.  There's a test suite at
http://dev.w3.org/2011/QT3-test-suite/ which includes a link to a page
about submitting test cases.

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

</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004047.html</link><pubDate>Sun, 10 Mar 2013 09:11:19 GMT</pubDate></item><item><title>  XQuery 3.0: formatting integers (2)
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Dear readers (2),

my impression is that it may be too early to test fn:format-integer(), because the returned values of all implementations I have tested so far seem to remain unpredictable. Indeed, I believe I have managed to bring the tested implementations together in all possible combinations! Two other examples that I want to present:


Query 1:

&#160; format-integer(-1, '1;o')

The results are:

* xMLPrime: -1st
* Saxon, BaseX, Zorba: error



I believe that XMLPrime's result is correct (?).


Query 2:

&#160; format-integer(-1, '1o')

The results are:

* xMLPrime, Saxon: -1
* BaseX, Zorba: -1st


Here, I would have expected an error, because, following the specification, the string contains no semicolon, and '1o' does not match the pattern '^((\p{Nd}|#|[^\p{N}\p{L}])+?)$'. But I am afraid I may be so wrong?

Yoshi OKAMOTO

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004046.html</link><pubDate>Sun, 10 Mar 2013 08:43:51 GMT</pubDate></item><item><title>  XQuery 3.0: formatting integers
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Dear readers,


I have a question regarding the new fn:format-integer() function of XQuery. I noticed that the implementations I tried give me different results for various queries. This is one example:

&#160; format-integer(-1, '#####12.3')


The results are:

* Saxon: -0.0.1
* BaseX, XMLPrime: -00.1

* Zorba: -1

Does someone know what is the correct result? I spent about one hour in the Functions and Operators 3.0 specification to finally confess that I did not manage to sort out the relevant details. This is the text I read:

&#160; http://www.w3.org/TR/xpath-functions-30/#func-format-integer

Maybe someone in the community is faster than me? Maybe someone even know the answer by heart? Maybe I should try more implementations? I assume that Michael Kay's Saxon processor is probably the implementation to trust most?

Thank you for reading this, and thank your for sharing your time,

Best regards
Yoshi OKAMOTO

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201303/004045.html</link><pubDate>Sun, 10 Mar 2013 07:31:52 GMT</pubDate></item><item><title>  [ANN] BaseX 7.6: The XMLPrague Edition
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi all,

we are excited to announce Version 7.6 of BaseX, which provides some
fresh new features that will further
boost your productivity:

DATABASE LOCKING:
- updates on different databases can now be executed in parallel and
  won't lock your read-only queries anymore:
  http://docs.basex.org/wiki/Transaction_Management

XQUERY:
- when errors are raised, the full stack trace is now returned
- the EXPath Geo Module, Fetch Module and HTML Module have been added:
  http://docs.basex.org/wiki/Module_Library
- the Validation, XSLT, Database and Profiling Module have been updated

GUI:
- error messages are now clickable and linked with the text editor
- trace/profiling output is redirected to the info view in realtime

Have fun with our new release! It is available at:

  http://basex.org/products/download/

Looking forward to your feedback, and seeing some of you in Prague,

Christian
BaseX Team, 2013
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201302/004044.html</link><pubDate>Tue, 05 Feb 2013 13:24:12 GMT</pubDate></item><item><title>  Looking for an example - calling XQuery 3.0 function module from XSLT 3.0
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Here's a very simple test case from my test suite (though it uses XSLT 
2.0 and XQuery 1.0):

test.xsl

&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; 
version=&quot;2.0&quot;
xmlns:saxon=&quot;http://saxon.sf.net/&quot; xmlns:qf=&quot;library.uri&quot;&gt;

&lt;xsl:template match=&quot;/&quot;&gt;
&lt;out&gt;
   &lt;xsl:value-of select=&quot;qf:distinct-countries(.)&quot;/&gt;
&lt;/out&gt;
&lt;/xsl:template&gt;

&lt;saxon:import-query href=&quot;test.xq&quot; namespace=&quot;library.uri&quot;/&gt;

&lt;/xsl:stylesheet&gt;

test.xq:

xquery version &quot;1.0&quot;;
module namespace qf = &quot;library.uri&quot;;
declare function qf:distinct-countries($root as document-node()) as 
xs:string* {
   distinct-values($root//city/@country)
};

One word of advice, I would advise avoiding use of global variables in 
the query library. There are some unresolved bugs relating to use of 
global variables in separately compiled query libraries.

I would also suggest, if you're having problems, it's best to say what 
you are doing and how it is failing. That way, it's easier to see where 
you are stuck and what information you 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:
&gt;<i> Hello folks,
</I>&gt;<i>
</I>&gt;<i> I am playing with the latest version of Saxon from Saxonica and am looking for an example of calling a function from an XQuery 3.0 function module from XSLT 3.0.  Has anyone out there done this yet?
</I>&gt;<i>
</I>&gt;<i> Thanks,
</I>&gt;<i> Loren
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201302/004043.html</link><pubDate>Mon, 04 Feb 2013 01:23:15 GMT</pubDate></item><item><title>  Looking for an example - calling XQuery 3.0 function	module from XSLT 3.0
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hello folks,

I am playing with the latest version of Saxon from Saxonica and am looking for an example of calling a function from an XQuery 3.0 function module from XSLT 3.0.  Has anyone out there done this yet?

Thanks,
Loren



</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201302/004042.html</link><pubDate>Fri, 01 Feb 2013 07:10:09 GMT</pubDate></item><item><title>  XQuery file naming conventions (xq, xqy, xql, xqm, xquery, etc.)
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Maybe its Xquery Update... whatever that would mean standalone?!?

On 22 January 2013 23:21, Joe Wicentowski &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Hi all,
</I>&gt;<i>
</I>&gt;<i> I just noticed a new one: .xu.  This extension appears in oXygen's
</I>&gt;<i> File &gt; Save dialog in Windows when you are saving an XQuery file:
</I>&gt;<i>
</I>&gt;<i>   Save as type: XQUERY, XQ, XQL, XQM, XQY, XU
</I>&gt;<i>
</I>&gt;<i> Hadn't seen that one before.  What could it mean?  XUpdate?  But
</I>&gt;<i> XUpdate isn't XQuery...
</I>&gt;<i>
</I>&gt;<i> Maybe we should adopt it so that we can pronounce our files'
</I>&gt;<i> extensions as &quot;dot zoo&quot;!
</I>&gt;<i>
</I>&gt;<i> Joe
</I>&gt;<i>
</I>&gt;<i> On Fri, Jan 11, 2013 at 4:55 PM, Joe Wicentowski &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
</I>&gt;&gt;<i> Thanks to all for your responses!  There's merit in all of the
</I>&gt;&gt;<i> approaches that were shared.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> I'm sympathetic to the idea that we shouldn't have to use file
</I>&gt;&gt;<i> extensions to distinguish between library and main modules.  Maybe
</I>&gt;&gt;<i> &quot;.xq&quot; (or &quot;.xquery&quot;) across the board makes sense.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> One thing does bug me about the &quot;module&quot; terminology in the spec.  If
</I>&gt;&gt;<i> the spec distinguishes between &quot;library&quot; and &quot;main&quot; modules, why do
</I>&gt;&gt;<i> *only* library modules begin with the &quot;module namespace&quot; construction?
</I>&gt;&gt;<i>  Shouldn't *all* modules begin with &quot;module namespace ...&quot;?  Or if
</I>&gt;&gt;<i> that's overkill, shouldn't it be &quot;library module namespace ...&quot;
</I>&gt;&gt;<i> instead (as opposed to &quot;main module namespace ...&quot;)?
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> In retrospect, I think this &quot;module namespace...&quot; construction is
</I>&gt;&gt;<i> responsible for many of us thinking that a module *is* a library
</I>&gt;&gt;<i> module.  I never thought of library vs. main modules.  I always
</I>&gt;&gt;<i> thought of &quot;modules&quot; vs. &quot;scripts.&quot;  If I'd been there on the
</I>&gt;&gt;<i> committee, I think I would've advocated doing away with &quot;module&quot;
</I>&gt;&gt;<i> altogether, and instead promoting &quot;library&quot; and &quot;script&quot;.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> But we've got library and main module, and I guess that's okay.  And
</I>&gt;&gt;<i> using file extensions to distinguish between the two, or only using a
</I>&gt;&gt;<i> single extension for all xquery files, are both okay too.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Have a good weekend, all
</I>&gt;&gt;<i> Joe
</I>


-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004041.html</link><pubDate>Tue, 22 Jan 2013 15:35:50 GMT</pubDate></item><item><title>  XQuery file naming conventions (xq, xqy, xql, xqm, xquery, etc.)
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi all,

I just noticed a new one: .xu.  This extension appears in oXygen's
File &gt; Save dialog in Windows when you are saving an XQuery file:

  Save as type: XQUERY, XQ, XQL, XQM, XQY, XU

Hadn't seen that one before.  What could it mean?  XUpdate?  But
XUpdate isn't XQuery...

Maybe we should adopt it so that we can pronounce our files'
extensions as &quot;dot zoo&quot;!

Joe

On Fri, Jan 11, 2013 at 4:55 PM, Joe Wicentowski &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Thanks to all for your responses!  There's merit in all of the
</I>&gt;<i> approaches that were shared.
</I>&gt;<i>
</I>&gt;<i> I'm sympathetic to the idea that we shouldn't have to use file
</I>&gt;<i> extensions to distinguish between library and main modules.  Maybe
</I>&gt;<i> &quot;.xq&quot; (or &quot;.xquery&quot;) across the board makes sense.
</I>&gt;<i>
</I>&gt;<i> One thing does bug me about the &quot;module&quot; terminology in the spec.  If
</I>&gt;<i> the spec distinguishes between &quot;library&quot; and &quot;main&quot; modules, why do
</I>&gt;<i> *only* library modules begin with the &quot;module namespace&quot; construction?
</I>&gt;<i>  Shouldn't *all* modules begin with &quot;module namespace ...&quot;?  Or if
</I>&gt;<i> that's overkill, shouldn't it be &quot;library module namespace ...&quot;
</I>&gt;<i> instead (as opposed to &quot;main module namespace ...&quot;)?
</I>&gt;<i>
</I>&gt;<i> In retrospect, I think this &quot;module namespace...&quot; construction is
</I>&gt;<i> responsible for many of us thinking that a module *is* a library
</I>&gt;<i> module.  I never thought of library vs. main modules.  I always
</I>&gt;<i> thought of &quot;modules&quot; vs. &quot;scripts.&quot;  If I'd been there on the
</I>&gt;<i> committee, I think I would've advocated doing away with &quot;module&quot;
</I>&gt;<i> altogether, and instead promoting &quot;library&quot; and &quot;script&quot;.
</I>&gt;<i>
</I>&gt;<i> But we've got library and main module, and I guess that's okay.  And
</I>&gt;<i> using file extensions to distinguish between the two, or only using a
</I>&gt;<i> single extension for all xquery files, are both okay too.
</I>&gt;<i>
</I>&gt;<i> Have a good weekend, all
</I>&gt;<i> Joe
</I></PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004040.html</link><pubDate>Tue, 22 Jan 2013 15:21:24 GMT</pubDate></item><item><title>  treat as
   </title><description><![CDATA[<!--beginarticle-->
<PRE>David - I've run across them in a somewhat obscure context, I guess.  
I've written an XQuery processor that rewrites queries originally parsed 
by Saxon, basically serializing them in the process.  All I can tell you 
is that Saxon generates an internal expression (ItemChecker) that is 
documented as corresponding to &quot;treat as&quot; in some cases where there was 
no &quot;treat as&quot; in the original supplied expression.
&gt;<i>
</I>&gt;<i> I think this happens, eg, if you declare a variable with a certain 
</I>&gt;<i> type (so the type will be checked dynamically when the assignment is 
</I>&gt;<i> done), but later references to the variable's value can be wrapped in 
</I>&gt;<i> a &quot;treat as&quot; so that the compiler can assume that the variable has the 
</I>&gt;<i> declared type and perform suitable automatic type inferencing.  But 
</I>&gt;<i> that's just a guess :)
</I>&gt;<i>
</I>&gt;<i> -Mike
</I>&quot;treat as&quot; is basically a dynamic type check. Saxon does optimistic 
static typing, which basically means that it automatically inserts 
&quot;treat as&quot; expressions into the expression tree whenever it finds a 
construct that isn't statically type safe. So if you write

$a/child::node()

and the type of $a isn't statically 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
</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004039.html</link><pubDate>Mon, 21 Jan 2013 10:59:26 GMT</pubDate></item><item><title>  Conditional use of fn:error() ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Dear Michael Kay,


this was a quick and excellent reply, which answered all my open questions.


Best regards

Yoshi OKAMOTO





----- Original Message -----
From: Michael Kay &lt;http://x-query.com/mailman/listinfo/talk&gt;
To: http://x-query.com/mailman/listinfo/talk
Cc: 
Sent: Monday, January 21, 2013 12:24 PM
Subject: Re:  Conditional use of fn:error() ?


For all these queries, implementations have the option whether to 
evaluate the base expression (error()) before or after evaluating the 
predicate. If the value of a predicate doesn't depend on the focus, 
rewriting A[B] as &quot;if (B) then A else ()&quot; is a good thing to do, so many 
processors will do it.

The only reliable way to generate an error conditionally is to use 
if/then/else (or typeswitch):

if (contains('http:...', 'details')) then error() else ...

There are specific rules for conditional expressions that prevent 
optimizers evaluating the then/else branch unless the condition is 
true/false.

Michael Kay
Saxonica

On 21/01/2013 11:07, Yoshi Okamoto wrote:
&gt;<i> Dear list subscribers,
</I>&gt;<i>
</I>&gt;<i> I noticed that different XQuery processors (BaseX,
</I>&gt;<i> Saxon, XMLPrime, Zorba) return different results for the following queries:
</I>&gt;<i>
</I>&gt;<i> Query A:
</I>&gt;<i>&#160; &#160; fn:error()[false()]
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Query B:
</I>&gt;<i>&#160; &#160; error(())[contains('http://....', 'details')]
</I>&gt;<i> Query C:
</I>&gt;<i>&#160; &#160; let $url := &lt;url&gt;...&lt;/url&gt;
</I>&gt;<i>&#160; &#160; where contains($url, 'details')
</I>&gt;<i>&#160; &#160; return error(())
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> All except for XMLPrime return an empty sequence.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Query D:
</I>&gt;<i>&#160; &#160; let $url := &lt;url&gt;...&lt;/url&gt;
</I>&gt;<i>&#160; &#160; return error(())[contains($url, 'details')]
</I>&gt;<i>
</I>&gt;<i> All except for Zorba return an error.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> My original intention was to raise an error whenever a certain condition is true. My questions would be:
</I>&gt;<i>
</I>&gt;<i> - what are the correct results for Query A-D?
</I>&gt;<i>
</I>&gt;<i> - XMLPrime is the implementation that always raises an error. If this behavior should be correct, how would I proceed to only raise errors under a certain condition?
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Thank you for your attention and patience.
</I>&gt;<i>
</I>&gt;<i> Best regards
</I>&gt;<i> Yoshi OKAMOTO
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>
_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk


</PRE>




]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004038.html</link><pubDate>Mon, 21 Jan 2013 03:45:56 GMT</pubDate></item><item><title>  Conditional use of fn:error() ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
For all these queries, implementations have the option whether to 
evaluate the base expression (error()) before or after evaluating the 
predicate. If the value of a predicate doesn't depend on the focus, 
rewriting A[B] as &quot;if (B) then A else ()&quot; is a good thing to do, so many 
processors will do it.

The only reliable way to generate an error conditionally is to use 
if/then/else (or typeswitch):

if (contains('http:...', 'details')) then error() else ...

There are specific rules for conditional expressions that prevent 
optimizers evaluating the then/else branch unless the condition is 
true/false.

Michael Kay
Saxonica

On 21/01/2013 11:07, Yoshi Okamoto wrote:
&gt;<i> Dear list subscribers,
</I>&gt;<i>
</I>&gt;<i> I noticed that different XQuery processors (BaseX,
</I>&gt;<i> Saxon, XMLPrime, Zorba) return different results for the following queries:
</I>&gt;<i>
</I>&gt;<i> Query A:
</I>&gt;<i>    fn:error()[false()]
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Query B:
</I>&gt;<i>    error(())[contains('http://....', 'details')]
</I>&gt;<i> Query C:
</I>&gt;<i>    let $url := &lt;url&gt;...&lt;/url&gt;
</I>&gt;<i>    where contains($url, 'details')
</I>&gt;<i>    return error(())
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> All except for XMLPrime return an empty sequence.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Query D:
</I>&gt;<i>    let $url := &lt;url&gt;...&lt;/url&gt;
</I>&gt;<i>    return error(())[contains($url, 'details')]
</I>&gt;<i>
</I>&gt;<i> All except for Zorba return an error.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> My original intention was to raise an error whenever a certain condition is true. My questions would be:
</I>&gt;<i>
</I>&gt;<i> - what are the correct results for Query A-D?
</I>&gt;<i>
</I>&gt;<i> - XMLPrime is the implementation that always raises an error. If this behavior should be correct, how would I proceed to only raise errors under a certain condition?
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Thank you for your attention and patience.
</I>&gt;<i>
</I>&gt;<i> Best regards
</I>&gt;<i> Yoshi OKAMOTO
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>
</PRE>




]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004037.html</link><pubDate>Mon, 21 Jan 2013 03:24:09 GMT</pubDate></item><item><title>  Conditional use of fn:error() ?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Dear list subscribers,

I noticed that different XQuery processors (BaseX, 
Saxon, XMLPrime, Zorba) return different results for the following queries:

Query A:
&#160; fn:error()[false()]


Query B:
&#160; error(())[contains('http://....', 'details')]&#160;
Query C:
&#160; let $url := &lt;url&gt;...&lt;/url&gt;
&#160; where contains($url, 'details')
&#160; return error(())


All except for XMLPrime return an empty sequence.


Query D:
&#160; let $url := &lt;url&gt;...&lt;/url&gt;
&#160; return error(())[contains($url, 'details')]&#160;

All except for Zorba return an error.


My original intention was to raise an error whenever a certain condition is true. My questions would be:

- what are the correct results for Query A-D?

- XMLPrime is the implementation that always raises an error. If this behavior should be correct, how would I proceed to only raise errors under a certain condition?


Thank you for your attention and patience.

Best regards
Yoshi OKAMOTO

</PRE>




]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004036.html</link><pubDate>Mon, 21 Jan 2013 03:07:36 GMT</pubDate></item><item><title>  XQuery file naming conventions (xq, xqy, xql, xqm, xquery, etc.)
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Thanks to all for your responses!  There's merit in all of the
approaches that were shared.

I'm sympathetic to the idea that we shouldn't have to use file
extensions to distinguish between library and main modules.  Maybe
&quot;.xq&quot; (or &quot;.xquery&quot;) across the board makes sense.

One thing does bug me about the &quot;module&quot; terminology in the spec.  If
the spec distinguishes between &quot;library&quot; and &quot;main&quot; modules, why do
*only* library modules begin with the &quot;module namespace&quot; construction?
 Shouldn't *all* modules begin with &quot;module namespace ...&quot;?  Or if
that's overkill, shouldn't it be &quot;library module namespace ...&quot;
instead (as opposed to &quot;main module namespace ...&quot;)?

In retrospect, I think this &quot;module namespace...&quot; construction is
responsible for many of us thinking that a module *is* a library
module.  I never thought of library vs. main modules.  I always
thought of &quot;modules&quot; vs. &quot;scripts.&quot;  If I'd been there on the
committee, I think I would've advocated doing away with &quot;module&quot;
altogether, and instead promoting &quot;library&quot; and &quot;script&quot;.

But we've got library and main module, and I guess that's okay.  And
using file extensions to distinguish between the two, or only using a
single extension for all xquery files, are both okay too.

Have a good weekend, all
Joe
</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004035.html</link><pubDate>Fri, 11 Jan 2013 13:55:33 GMT</pubDate></item><item><title>  XQuery file naming conventions (xq, xqy, xql, xqm, xquery, etc.)
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;&gt;<i>However, I would note that David's suggestion to use .x could be
</I>&gt;&gt;<i>problematic. As .x is already used for DirectX model files.
</I>
FYI: this was a &quot;Reductio ad Absurdum&quot; joke ...

Back in &quot;The Old Days&quot; on mainframe type systems files had actual &quot;types&quot; independent from their extension - if any.  Unix in its ideal simplicity got rid of that.
And instead used file extensions ... and magic numbers.  
 &quot;See no types up my sleeves ! &quot; 
-David




</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004034.html</link><pubDate>Tue, 08 Jan 2013 04:29:59 GMT</pubDate></item><item><title>  XQuery file naming conventions (xq, xqy, xql, xqm, xquery, etc.)
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Joe,

I currently do the opposite to you, I adopted this because some eXist
folks were doing it before me.

i.e. .xql for main modules (XQuery Language) and .xqm for library
modules (XQuery Module).

However now I think about it, it does not make as much sense as your
proposal of reversing it.

I think as David says, we first have to think about whether there
should be a distinction in the naming between main modules and library
modules.
However, I would note that David's suggestion to use .x could be
problematic. As .x is already used for DirectX model files.

On 7 January 2013 21:33, Joe Wicentowski &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Hi all,
</I>&gt;<i>
</I>&gt;<i> There is quite a profusion of file extensions for XQuery: .xq, .xqy,
</I>&gt;<i> .xql, .xqm, and .xquery.  Perhaps this profusion has happened the spec
</I>&gt;<i> doesn't say anything about the file extensions.  This has opened up
</I>&gt;<i> the choice to each implementation and each community/project.  I'd be
</I>&gt;<i> interested to know which communities use which file naming
</I>&gt;<i> conventions, and if there is any consensus?  What do you use, and why?
</I>&gt;<i>
</I>&gt;<i> My experience: When I first started learning XQuery I used .xq for
</I>&gt;<i> everything -- I guess because it's short.  oXygen uses .xquery as its
</I>&gt;<i> default file extension for XQuery files but recognizes all of the
</I>&gt;<i> above as XQuery files.  The MarkLogic community seems to use .xqy.
</I>&gt;<i> When I started to write library modules I started to use .xqm, with
</I>&gt;<i> the 'm' indicating module.  I saw yet others in the eXist-db community
</I>&gt;<i> using .xql, though it allows all of the above.  Github doesn't
</I>&gt;<i> currently recognize .xql or .xqm as XQuery [1].  Diversity is fine,
</I>&gt;<i> but the downside is that newcomers are certainly confused, and anytime
</I>&gt;<i> we share code there is no reliable way to know whether a file is a
</I>&gt;<i> library or main module without opening it up.
</I>&gt;<i>
</I>&gt;<i> The spec does make a distinction that seems to apply to XQuery files.
</I>&gt;<i> It states that there are two kinds of modules: *library* modules and
</I>&gt;<i> *main* modules.  The distinction is that library modules contain only
</I>&gt;<i> functions, whereas main modules contain a single main routine (though
</I>&gt;<i> can also contain function declarations).  (See these two terms defined
</I>&gt;<i> in the spec at http://www.w3.org/TR/xquery/#dt-library-module and
</I>&gt;<i> http://www.w3.org/TR/xquery/#dt-main-module.)
</I>&gt;<i>
</I>&gt;<i> It seems to me that any good XQuery file naming convention should
</I>&gt;<i> reflect this distinction between *library* and *main* modules.
</I>&gt;<i>
</I>&gt;<i> After thinking about this, I think .xql and .xqm make good candidates
</I>&gt;<i> for a file naming convention, since they mnemonically reflect the
</I>&gt;<i> distinction between library (L) and main (M).  Where does that leave
</I>&gt;<i> .xq, .xqy, or .xquery?  I guess they're acceptable alternatives to .xq
</I>&gt;<i> for main modules, but in my own new projects I think I'm going to go
</I>&gt;<i> with .xql and .xqm.
</I>&gt;<i>
</I>&gt;<i> What practices do you use?  What do you think?  Does your
</I>&gt;<i> implementation/community document your practice?
</I>&gt;<i>
</I>&gt;<i> Joe
</I>&gt;<i>
</I>&gt;<i> [1] https://github.com/github/linguist/blob/master/lib/linguist/languages.yml.
</I>&gt;<i>  I've submitted a pull request to add .xql and .xqm,
</I>&gt;<i> https://github.com/github/linguist/pull/338.
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>


-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004033.html</link><pubDate>Tue, 08 Jan 2013 01:19:49 GMT</pubDate></item><item><title>  XQuery file naming conventions (xq, xqy, xql, xqm, xquery, etc.)
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi Joe,

in BaseX, .xq is used for main modules and .xqm for library modules
(including RESTXQ modules). The main motivation for this was similar
to yours: .xq is short, there was some need to distinguish between
main and library modules, and there was no convention what would be
the best choice.

The current solution seems quite intuitive to most of our users, but I
agree that your convention makes some sense, and is closer to the
terminology of the XQuery spec.

Best,
Christian
___________________________

On Mon, Jan 7, 2013 at 10:33 PM, Joe Wicentowski &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Hi all,
</I>&gt;<i>
</I>&gt;<i> There is quite a profusion of file extensions for XQuery: .xq, .xqy,
</I>&gt;<i> .xql, .xqm, and .xquery.  Perhaps this profusion has happened the spec
</I>&gt;<i> doesn't say anything about the file extensions.  This has opened up
</I>&gt;<i> the choice to each implementation and each community/project.  I'd be
</I>&gt;<i> interested to know which communities use which file naming
</I>&gt;<i> conventions, and if there is any consensus?  What do you use, and why?
</I>&gt;<i>
</I>&gt;<i> My experience: When I first started learning XQuery I used .xq for
</I>&gt;<i> everything -- I guess because it's short.  oXygen uses .xquery as its
</I>&gt;<i> default file extension for XQuery files but recognizes all of the
</I>&gt;<i> above as XQuery files.  The MarkLogic community seems to use .xqy.
</I>&gt;<i> When I started to write library modules I started to use .xqm, with
</I>&gt;<i> the 'm' indicating module.  I saw yet others in the eXist-db community
</I>&gt;<i> using .xql, though it allows all of the above.  Github doesn't
</I>&gt;<i> currently recognize .xql or .xqm as XQuery [1].  Diversity is fine,
</I>&gt;<i> but the downside is that newcomers are certainly confused, and anytime
</I>&gt;<i> we share code there is no reliable way to know whether a file is a
</I>&gt;<i> library or main module without opening it up.
</I>&gt;<i>
</I>&gt;<i> The spec does make a distinction that seems to apply to XQuery files.
</I>&gt;<i> It states that there are two kinds of modules: *library* modules and
</I>&gt;<i> *main* modules.  The distinction is that library modules contain only
</I>&gt;<i> functions, whereas main modules contain a single main routine (though
</I>&gt;<i> can also contain function declarations).  (See these two terms defined
</I>&gt;<i> in the spec at http://www.w3.org/TR/xquery/#dt-library-module and
</I>&gt;<i> http://www.w3.org/TR/xquery/#dt-main-module.)
</I>&gt;<i>
</I>&gt;<i> It seems to me that any good XQuery file naming convention should
</I>&gt;<i> reflect this distinction between *library* and *main* modules.
</I>&gt;<i>
</I>&gt;<i> After thinking about this, I think .xql and .xqm make good candidates
</I>&gt;<i> for a file naming convention, since they mnemonically reflect the
</I>&gt;<i> distinction between library (L) and main (M).  Where does that leave
</I>&gt;<i> .xq, .xqy, or .xquery?  I guess they're acceptable alternatives to .xq
</I>&gt;<i> for main modules, but in my own new projects I think I'm going to go
</I>&gt;<i> with .xql and .xqm.
</I>&gt;<i>
</I>&gt;<i> What practices do you use?  What do you think?  Does your
</I>&gt;<i> implementation/community document your practice?
</I>&gt;<i>
</I>&gt;<i> Joe
</I>&gt;<i>
</I>&gt;<i> [1] https://github.com/github/linguist/blob/master/lib/linguist/languages.yml.
</I>&gt;<i>  I've submitted a pull request to add .xql and .xqm,
</I>&gt;<i> https://github.com/github/linguist/pull/338.
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I></PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004032.html</link><pubDate>Mon, 07 Jan 2013 13:49:44 GMT</pubDate></item><item><title>  XQuery file naming conventions (xq, xqy, xql, xqm, xquery, etc.)
   </title><description><![CDATA[<!--beginarticle-->
<PRE>My opinion.
First, just like C and Java etc ... I dont see a need to seperate Libraries and Modules and Mains with extensions.
The extension (should, IMHO) apply to the source language not to the use its applied.
 
A single extension should do, and its main job is to load the right editor (for GUI systems ),and for non-gui systems 
is useful for simply telling apart languages like .xslt and .xquery
Hey what do people use for .xslt ?  .xsl ? .xs ?  How about just .x and let the first line dictate !!!!


Whenever I am by myself I use .xquery ... it just makes sense !
When I joined MarkLogic I adopted their convention for any code I write to be shipped with ML and use .xqy
But for anything personal I still use .xquery

I dont see the need for any more but hey, like standards the fun is that there are so many !



----------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.xmlsh.org

-----Original Message-----
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf Of Joe Wicentowski
Sent: Monday, January 07, 2013 4:33 PM
To: XQuery Talk
Subject:  XQuery file naming conventions (xq, xqy, xql, xqm, xquery, etc.)

Hi all,

There is quite a profusion of file extensions for XQuery: .xq, .xqy,
.xql, .xqm, and .xquery.  Perhaps this profusion has happened the spec
doesn't say anything about the file extensions.  This has opened up
the choice to each implementation and each community/project.  I'd be
interested to know which communities use which file naming
conventions, and if there is any consensus?  What do you use, and why?

My experience: When I first started learning XQuery I used .xq for
everything -- I guess because it's short.  oXygen uses .xquery as its
default file extension for XQuery files but recognizes all of the
above as XQuery files.  The MarkLogic community seems to use .xqy.
When I started to write library modules I started to use .xqm, with
the 'm' indicating module.  I saw yet others in the eXist-db community
using .xql, though it allows all of the above.  Github doesn't
currently recognize .xql or .xqm as XQuery [1].  Diversity is fine,
but the downside is that newcomers are certainly confused, and anytime
we share code there is no reliable way to know whether a file is a
library or main module without opening it up.

The spec does make a distinction that seems to apply to XQuery files.
It states that there are two kinds of modules: *library* modules and
*main* modules.  The distinction is that library modules contain only
functions, whereas main modules contain a single main routine (though
can also contain function declarations).  (See these two terms defined
in the spec at http://www.w3.org/TR/xquery/#dt-library-module and
http://www.w3.org/TR/xquery/#dt-main-module.)

It seems to me that any good XQuery file naming convention should
reflect this distinction between *library* and *main* modules.

After thinking about this, I think .xql and .xqm make good candidates
for a file naming convention, since they mnemonically reflect the
distinction between library (L) and main (M).  Where does that leave
.xq, .xqy, or .xquery?  I guess they're acceptable alternatives to .xq
for main modules, but in my own new projects I think I'm going to go
with .xql and .xqm.

What practices do you use?  What do you think?  Does your
implementation/community document your practice?

Joe

[1] https://github.com/github/linguist/blob/master/lib/linguist/languages.yml.
 I've submitted a pull request to add .xql and .xqm,
https://github.com/github/linguist/pull/338.
_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk



</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004031.html</link><pubDate>Mon, 07 Jan 2013 13:43:19 GMT</pubDate></item><item><title>  XQuery file naming conventions (xq, xqy, xql, xqm,	xquery, etc.)
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi all,

There is quite a profusion of file extensions for XQuery: .xq, .xqy,
.xql, .xqm, and .xquery.  Perhaps this profusion has happened the spec
doesn't say anything about the file extensions.  This has opened up
the choice to each implementation and each community/project.  I'd be
interested to know which communities use which file naming
conventions, and if there is any consensus?  What do you use, and why?

My experience: When I first started learning XQuery I used .xq for
everything -- I guess because it's short.  oXygen uses .xquery as its
default file extension for XQuery files but recognizes all of the
above as XQuery files.  The MarkLogic community seems to use .xqy.
When I started to write library modules I started to use .xqm, with
the 'm' indicating module.  I saw yet others in the eXist-db community
using .xql, though it allows all of the above.  Github doesn't
currently recognize .xql or .xqm as XQuery [1].  Diversity is fine,
but the downside is that newcomers are certainly confused, and anytime
we share code there is no reliable way to know whether a file is a
library or main module without opening it up.

The spec does make a distinction that seems to apply to XQuery files.
It states that there are two kinds of modules: *library* modules and
*main* modules.  The distinction is that library modules contain only
functions, whereas main modules contain a single main routine (though
can also contain function declarations).  (See these two terms defined
in the spec at http://www.w3.org/TR/xquery/#dt-library-module and
http://www.w3.org/TR/xquery/#dt-main-module.)

It seems to me that any good XQuery file naming convention should
reflect this distinction between *library* and *main* modules.

After thinking about this, I think .xql and .xqm make good candidates
for a file naming convention, since they mnemonically reflect the
distinction between library (L) and main (M).  Where does that leave
.xq, .xqy, or .xquery?  I guess they're acceptable alternatives to .xq
for main modules, but in my own new projects I think I'm going to go
with .xql and .xqm.

What practices do you use?  What do you think?  Does your
implementation/community document your practice?

Joe

[1] https://github.com/github/linguist/blob/master/lib/linguist/languages.yml.
 I've submitted a pull request to add .xql and .xqm,
https://github.com/github/linguist/pull/338.
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201301/004030.html</link><pubDate>Mon, 07 Jan 2013 13:33:22 GMT</pubDate></item><item><title>  Basex: using all of -i, -c and -q
   </title><description><![CDATA[<!--beginarticle-->
<PRE>I tried to use all of -i, -c, and -q, but in the end the only thing for
me that worked was
$ basex -q 'declare option db:parser &quot;html&quot;; doc(&quot;bla.html&quot;)'
so maybe it is not possible.

P.S., I tried to send this to the right list, alas,

&lt;http://x-query.com/mailman/listinfo/talk&gt;: host
    cytosin.uni-konstanz.de[134.34.240.61] said: 550 #5.1.0 Address rejected.
    (in reply to RCPT TO command)
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004029.html</link><pubDate>Thu, 27 Dec 2012 02:03:59 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;&gt;&gt;&gt;&gt;<i> &quot;MK&quot; == Michael Kay &lt;mike-JkSD5nQpfvpWk0Htik3J/http://x-query.com/mailman/listinfo/talk&gt; writes:
</I>
MK&gt; The use of /text() in this way is generally a bad habit.

Thanks! I removed them and my program worked just as fine!
(Not Cc'd so didn't notice your comment until now.)
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004028.html</link><pubDate>Sat, 22 Dec 2012 15:09:58 GMT</pubDate></item><item><title>  Join my network on LinkedIn
   </title><description><![CDATA[<!--beginarticle-->
<PRE>LinkedIn
------------




    
    
    
    
      Christian Gr&#252;n has indicated you are a Friend
      
    
      
    
    
  

------------------------------------------

Since you are a person I trust, I wanted to invite you to join my network on LinkedIn.

Accept invitation from Christian Gr&#252;n
http://www.linkedin.com/e/xnupbm-hazynsqq-6d/kDd-YG5BG4ZUACXjkyk-G9jZp24/blk/I384377797_12/3wOtCVFbmdxnSVFbm8JrnpKqlZJrmZzbmNJpjRQnOpBtn9QfmhBt71BoSd1p65Lr6lOfP8NnPsVdPsTcPgUcQALhRhbi2RKp6YLd3cNc3oTdPgNc34LrCBxbOYWrSlI/eml-comm_invm-b-in_ac-inv28/?hs=false&amp;tok=3xGq4sF4XHUlw1

View profile of Christian Gr&#252;n
http://www.linkedin.com/e/xnupbm-hazynsqq-6d/rso/1401638/j1Xp/name/94457480_I384377797_12/?hs=false&amp;tok=0NJzgrz23HUlw1
------------------------------------------
You are receiving Invitation emails.


This email was intended for Ihe Onwuka.
Learn why this is included: http://www.linkedin.com/e/xnupbm-hazynsqq-6d/plh/http%3A%2F%2Fhelp%2Elinkedin%2Ecom%2Fapp%2Fanswers%2Fdetail%2Fa_id%2F4788/-GXI/?hs=false&amp;tok=0vplFFC6XHUlw1

(c) 2012, LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: &lt;http://x-query.com/pipermail/talk/attachments/20121221/1033f69d/attachment.html&gt;
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004027.html</link><pubDate>Fri, 21 Dec 2012 15:39:06 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>

On 12/21/2012 09:40 AM, David Lee wrote:
&gt;<i> in XQuery
</I>&gt;<i>
</I>&gt;<i> declare function foo() {}
</I>&gt;<i>
</I>&gt;<i> is bad for precisely the same reason as functions *always* have a return type.
</I>&gt;<i> (no void).  But what should it be ?
</I>&gt;<i>    
</I>Again, empty-sequence() is the only logical choice.  Better than an 
error in my book.
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004026.html</link><pubDate>Fri, 21 Dec 2012 07:11:09 GMT</pubDate></item><item><title>  [ANN] BaseX 7.5 -- The BaseXMas Edition
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Dear all,

we are excited to announce the release of BaseX 7.5, aka the BaseXMas Edition:

  http://basex.org/downloads

The latest features and changes are as follows:

XQUERY UPDATE
- bulk updates are now much faster than before
- insert and replace operations take much less memory
- databases can now be created via XQuery and db:create()

GUI TEXT EDITOR
- a fast and flexible search/replace panel has been added
- error highlighting has been extended to XML files
- the editor was improved for editing arbitrary text files

XQUERY 3.0
- the code has been aligned with latest changes in the specs
- HTML5 support has been updated

WEB APPLICATIONS
- new modules have been added: Request, Session, Sessions
- logging has been revised and extended to HTTP requests
- SSL support added, switched to Jetty 8
- all operation modes have been unified and simplified
- RESTXQ elements added to simplify forwarding and redirects

CORE FEATURES
- improved stability of concurrent read/write operations
- the INSPECT command performs database sanity checks
- EXECUTE triggers the execution of command scripts

Numerous other updates can be found in our documentation
(http://docs.basex.org).

Your feedback is welcome.

Christian
BaseX Team 2012

PS: We hope to see you all on the XMLPrague Conference 2013! If you
haven&#8217;t registered yet, you are invited to join our BaseX User
Meeting: http://lanyrd.com/2013/basex-users-meetup-xml-prague

</PRE>




]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004025.html</link><pubDate>Fri, 21 Dec 2012 06:55:47 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>... whether there is any good reason plain {} doesn't generate () (an 
empty sequence)?

I'm not aware that the idea has ever been proposed and discussed in the 
WG. I've no idea whether it would find favour. Probably not; minor 
tweaking for minor usability benefits doesn't 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.

Michael Kay
Saxonica
</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004024.html</link><pubDate>Fri, 21 Dec 2012 06:49:53 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Fri, Dec 21, 2012 at 1:08 PM, Michael Sokolov &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> On 12/20/2012 11:00 AM, Michael Kay wrote:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Note that you haven't actually commented anything out. When you change the
</I>&gt;&gt;<i> content of an element constructor from
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> &lt;a&gt; &lt;b/&gt; &lt;c/&gt; &lt;/a&gt;
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> to
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> &lt;a&gt; (:&lt;b/&gt;:) &lt;c/&gt; &lt;/a&gt;
</I>&gt;<i>
</I>&gt;<i> So to achieve the intended effect (no nodes where &lt;b/&gt; is, not even a
</I>&gt;<i> comment node), one would need:
</I>&gt;<i>
</I>&gt;<i> &lt;a&gt;{(:&lt;b/&gt;:)()}&lt;c/&gt;&lt;/a&gt;
</I>&gt;<i>
</I>&gt;<i> ?  That's a lot of punctuation.
</I>&gt;<i>
</I>&gt;<i> I think this has been batted around here before,
</I>
http://www.stylusstudio.com/xquerytalk/201207/003932.html
</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004023.html</link><pubDate>Fri, 21 Dec 2012 06:43:18 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>-------------
Actually my compiler allows &quot;void foo () { }&quot; - why not?  A function 
that does nothing could be very useful sometimes.  &quot;foo () { }&quot; is bad 
because implicitly it is declared as returning int, yet does not return 
anything.
-----------

Which	 is why I used as an example
foo() {} 
which in K&amp;R C means
int foo() {}


not 
void foo() {}

in XQuery 

declare function foo() {}

is bad for precisely the same reason as functions *always* have a return type.
(no void).  But what should it be ?


-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
http://x-query.com/mailman/listinfo/talk
Phone: +1 812-482-5224
Cell:  +1 812-630-7622
www.marklogic.com








</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004022.html</link><pubDate>Fri, 21 Dec 2012 06:40:55 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>

On 12/21/2012 09:32 AM, David Lee wrote:
&gt;<i> ------------------
</I>&gt;<i> I think this has been batted around here before, but would somebody mind
</I>&gt;<i> refreshing us as to whether there is any good reason plain {} doesn't
</I>&gt;<i> generate () (an empty sequence)?
</I>&gt;<i> ---------------
</I>&gt;<i>
</I>&gt;<i> If you want historical rationality you will have to ask someone else.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> If you want deductive logic ...
</I>&gt;<i>
</I>&gt;<i> { expr }  parses expr ... it returns whatever expr is.  If there is nothing there then thats nothing.    () is not nothing, its something.   So it would be silly and inconsistent if {} produced something rather than nothing.
</I>&gt;<i>    
</I>Actually I think () is the closest we have to null and void in xquery, 
so it seems consistent and logical to me :)
&gt;<i> Also there is the other use of {} which is in functions
</I>&gt;<i>
</I>&gt;<i> declare function x () { };
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Which is rightfully an error because there is no expression and should be.
</I>&gt;<i> Although one could argue that it should be treated as
</I>&gt;<i> declare function x () { ()};
</I>&gt;<i>    
</I>Yes I would
&gt;<i> But then one could argue that in C
</I>&gt;<i>
</I>&gt;<i> foo() { }
</I>&gt;<i>
</I>&gt;<i> should be treated as
</I>&gt;<i> foo() { return NULL ; }
</I>&gt;<i>
</I>&gt;<i> But that would be silly now wouldn't it ?
</I>&gt;<i>
</I>&gt;<i>    
</I>Actually my compiler allows &quot;void foo () { }&quot; - why not?  A function 
that does nothing could be very useful sometimes.  &quot;foo () { }&quot; is bad 
because implicitly it is declared as returning int, yet does not return 
anything.
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004021.html</link><pubDate>Fri, 21 Dec 2012 06:38:09 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>------------------
I think this has been batted around here before, but would somebody mind 
refreshing us as to whether there is any good reason plain {} doesn't 
generate () (an empty sequence)?
---------------

If you want historical rationality you will have to ask someone else.


If you want deductive logic ...

{ expr }  parses expr ... it returns whatever expr is.  If there is nothing there then thats nothing.    () is not nothing, its something.   So it would be silly and inconsistent if {} produced something rather than nothing.

The only time that I can see that it is actually inconvenient (&quot;annoying&quot;?) that {} produces nothing rather then something is in this particular case with comments embedded
within literal constructors.   Buy why single out () as the something it should produce ?   There is nothing special about the empty sequence that makes it the best candidate for a fillin for nothing.

Also there is the other use of {} which is in functions 

declare function x () { };


Which is rightfully an error because there is no expression and should be.
Although one could argue that it should be treated as 
declare function x () { ()};

But then one could argue that in C 

foo() { }

should be treated as
foo() { return NULL ; }

But that would be silly now wouldn't it ?


In the end I am not going to try to justify this rule in XQuery ... it just is the way it is.


-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
http://x-query.com/mailman/listinfo/talk
Phone: +1 812-482-5224
Cell:  +1 812-630-7622
www.marklogic.com





</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004020.html</link><pubDate>Fri, 21 Dec 2012 06:32:28 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 12/20/2012 11:00 AM, Michael Kay wrote:
&gt;<i>
</I>&gt;<i> Note that you haven't actually commented anything out. When you change 
</I>&gt;<i> the content of an element constructor from
</I>&gt;<i>
</I>&gt;<i> &lt;a&gt; &lt;b/&gt; &lt;c/&gt; &lt;/a&gt;
</I>&gt;<i>
</I>&gt;<i> to
</I>&gt;<i>
</I>&gt;<i> &lt;a&gt; (:&lt;b/&gt;:) &lt;c/&gt; &lt;/a&gt;
</I>So to achieve the intended effect (no nodes where &lt;b/&gt; is, not even a 
comment node), one would need:

&lt;a&gt;{(:&lt;b/&gt;:)()}&lt;c/&gt;&lt;/a&gt;

?  That's a lot of punctuation.

I think this has been batted around here before, but would somebody mind 
refreshing us as to whether there is any good reason plain {} doesn't 
generate () (an empty sequence)?

-Mike
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004019.html</link><pubDate>Fri, 21 Dec 2012 05:08:35 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>OK, I will try various combinations of these in various situations.
I just wish Google searches wouldn't always just come up with (: :) when
in fact one often needs &quot;the heavy pliers&quot; instead.
DL&gt; its actually quite easy once you learn the syntax.
I'm sure it must be, but I just want to...
http://www.google.com/search?q=Big+Daddy+Kane+I+get+the+job+done
get the job done.
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004018.html</link><pubDate>Thu, 20 Dec 2012 08:47:05 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Sorry, you need to make a  bit  more room in your brain.
The proper syntax is context specific.  And I made a mistake in my example.
double bad :)

inside an element constructor you need this:

&lt;elem&gt;{()(:comment:)}&lt;/elem&gt;

other places you use

   (: comment :)
but realize that produces nothing, not the empty sequence so some places it wont work and you might need 

   ()(:comment:) 

its actually quite easy once you learn the syntax.




----------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.xmlsh.org


-----Original Message-----
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] 
Sent: Thursday, December 20, 2012 11:12 AM
To: David Lee
Cc: http://x-query.com/mailman/listinfo/talk; http://x-query.com/mailman/listinfo/talk
Subject: Re:  let's comment out a line in XQuery

OK. In my brain (which only has room for one comment syntax per
language) I will now try to remember
{(: comment :)()}
as the REAL XQuery comment syntax (the one that is guaranteed not to
fail, the one that gets even tough stains out),
and any simplifications thereof e.g.,
(: comment :)
as mere shortcuts that will sometimes fail. I hope that is fair,
assuming I only want to remember one comment syntax. (No I don't want to
use &lt;!-- comment --&gt; as that ends up in the laundry.)



</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004017.html</link><pubDate>Thu, 20 Dec 2012 08:25:33 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>OK. In my brain (which only has room for one comment syntax per
language) I will now try to remember
{(: comment :)()}
as the REAL XQuery comment syntax (the one that is guaranteed not to
fail, the one that gets even tough stains out),
and any simplifications thereof e.g.,
(: comment :)
as mere shortcuts that will sometimes fail. I hope that is fair,
assuming I only want to remember one comment syntax. (No I don't want to
use &lt;!-- comment --&gt; as that ends up in the laundry.)
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004016.html</link><pubDate>Thu, 20 Dec 2012 08:12:25 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Your problem is the call

concat($f/*:Placemark[$c]//*:coordinates/text(), ...

The first argument selects more than one text node, but the arguments to concat() must be single items.

Note that you haven't actually commented anything out. When you change the content of an element constructor from

&lt;a&gt; &lt;b/&gt; &lt;c/&gt; &lt;/a&gt;

to

&lt;a&gt; (:&lt;b/&gt;:) &lt;c/&gt; &lt;/a&gt;

the content of the &lt;a&gt; element will be a text node containing &quot; (:&quot;, an empty b element, a text node containing &quot;:) &quot;, an empty &lt;c/&gt; element, and possibly (depending on boundary-space settings) a text node containing a single space. This is because comment delimiters are not recognized inside literal element content.

The use of /text() in this way is generally a bad habit. Normally if you want the value of the coordinates element, it's best just to atomize the element. You should only use text() if you want to pick out the text nodes from among the other children of the element.

Michael Kay
Saxonica



On 20/12/2012 15:39, http://x-query.com/mailman/listinfo/talk wrote:
&gt;<i> I don't have a Senior Secondary Certificate of Education :-) but here
</I>&gt;<i> goes anyway. basex: Debian's 7.3-1.
</I>&gt;<i> $ basex noise0.xq |wc
</I>&gt;<i> Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise0.xq:
</I>&gt;<i> [XPTY0004] Single item expected, ( ALLOW ME TO COMMENT OUT THIS LINE, ...) found.
</I>&gt;<i>        0       0       0
</I>&gt;<i> $ cat noise0.xq
</I>&gt;<i> (:
</I>&gt;<i> # Make a map of noisy neighbors, Xquery version.
</I>&gt;<i> # Copyright       : http://www.fsf.org/copyleft/gpl.html
</I>&gt;<i> # Author          : Dan Jacobson -- http://jidanni.org/
</I>&gt;<i> # Created On      : Sat Jan 29 17:28:12 2011
</I>&gt;<i> # Last Modified On: Thu Dec 20 23:29:24 2012
</I>&gt;<i> # Update Count    : 122
</I>&gt;<i> :)
</I>&gt;<i> declare option output:omit-xml-declaration &quot;no&quot;;
</I>&gt;<i> declare function local:fol($f){
</I>&gt;<i>    (: just adds lines between the first point and the rest :)
</I>&gt;<i>    &lt;Folder&gt;
</I>&gt;<i>      {$f/*}
</I>&gt;<i>      &lt;Folder&gt;
</I>&gt;<i>        &lt;name&gt;(lines)&lt;/name&gt;
</I>&gt;<i>        &lt;open&gt;0&lt;/open&gt;
</I>&gt;<i>        {
</I>&gt;<i> 	for $p at $c in $f/*:Placemark
</I>&gt;<i> 	where $c &gt; 1
</I>&gt;<i> 	return
</I>&gt;<i> 	&lt;Placemark&gt;
</I>&gt;<i> 	  &lt;name&gt;{concat($f/*:Placemark[$c]//*:name/text(),&quot; to &quot;,
</I>&gt;<i> 	  $f/*:Placemark[ 1]//*:name/text())}&lt;/name&gt;
</I>&gt;<i> 	  &lt;LineString&gt;
</I>&gt;<i> 	    &lt;coordinates&gt;{concat($f/*:Placemark[$c]//*:coordinates/text(),&quot; &quot;,
</I>&gt;<i> 	    $f/*:Placemark[ 1]//*:coordinates/text())}&lt;/coordinates&gt;
</I>&gt;<i> 	  &lt;/LineString&gt;
</I>&gt;<i> 	&lt;/Placemark&gt;
</I>&gt;<i> }  &lt;/Folder&gt;
</I>&gt;<i> &lt;/Folder&gt;}
</I>&gt;<i> ;
</I>&gt;<i> &lt;kml xmlns=&quot;http://www.opengis.net/kml/2.2&quot;&gt;
</I>&gt;<i>    {comment {&quot;Made by noise.xq, will get OVERWRITTEN&quot;}}
</I>&gt;<i>    &lt;Document&gt;
</I>&gt;<i>      &lt;Folder&gt;
</I>&gt;<i>        &lt;name&gt;&#22122;&#38899; Noise&lt;/name&gt;
</I>&gt;<i>        &lt;description&gt;http://jidanni.org/me/quiet.html&lt;/description&gt;
</I>&gt;<i>        {local:fol(
</I>&gt;<i>        &lt;Folder&gt;
</I>&gt;<i>          &lt;name&gt;&#24950;&#31119;&#34903; 1-3 Qingfu St.&lt;/name&gt;
</I>&gt;<i> 	&lt;Placemark&gt;
</I>&gt;<i> 	  &lt;name&gt;1-3&lt;/name&gt;
</I>&gt;<i> 	  &lt;Point&gt;
</I>&gt;<i> 	    (: &lt;coordinates&gt; ALLOW ME TO COMMENT OUT THIS LINE&lt;/coordinates&gt; :)
</I>&gt;<i> 	    &lt;coordinates&gt;120.865201,24.181712&lt;/coordinates&gt; (: 2012/12 Google satellite :)
</I>&gt;<i> 	  &lt;/Point&gt;
</I>&gt;<i> 	&lt;/Placemark&gt;
</I>&gt;<i>          &lt;Placemark&gt;
</I>&gt;<i>            &lt;name&gt;Luo Yuntian&lt;/name&gt;
</I>&gt;<i>            &lt;Point&gt;
</I>&gt;<i>              &lt;coordinates&gt;120.868205,24.176483&lt;/coordinates&gt;
</I>&gt;<i>            &lt;/Point&gt;
</I>&gt;<i>          &lt;/Placemark&gt;
</I>&gt;<i>          &lt;Placemark&gt;
</I>&gt;<i>            &lt;name&gt;Zhong Guilin&lt;/name&gt;
</I>&gt;<i>            &lt;Point&gt;
</I>&gt;<i>              &lt;coordinates&gt;120.866934,24.152642&lt;/coordinates&gt;
</I>&gt;<i>            &lt;/Point&gt;
</I>&gt;<i>          &lt;/Placemark&gt;
</I>&gt;<i>          &lt;Placemark&gt;
</I>&gt;<i>            &lt;name&gt;Maan Nong Zhuang&lt;/name&gt;
</I>&gt;<i>            &lt;Point&gt;
</I>&gt;<i>              &lt;coordinates&gt;120.84368,24.17268&lt;/coordinates&gt; (: &#26481;&#21218;&#21312;&#24950;&#31119;&#37324;007&#37168;-&#26481;&#38364;&#36335;&#65297;&#65300;&#65303;&#34399; :)
</I>&gt;<i>            &lt;/Point&gt;
</I>&gt;<i>          &lt;/Placemark&gt;
</I>&gt;<i> 	&lt;/Folder&gt;)}
</I>&gt;<i> 	{local:fol(
</I>&gt;<i> 	&lt;Folder&gt;
</I>&gt;<i>            &lt;name&gt;&#24950;&#31119;&#34903; 1-6 Qingfu St.&lt;/name&gt;
</I>&gt;<i> 	  &lt;Placemark&gt;
</I>&gt;<i> 	    &lt;name&gt;1-6&lt;/name&gt;
</I>&gt;<i> 	    &lt;Point&gt;
</I>&gt;<i> 	      &lt;coordinates&gt;120.866215,24.181668&lt;/coordinates&gt;
</I>&gt;<i> 	    &lt;/Point&gt;
</I>&gt;<i> 	  &lt;/Placemark&gt;
</I>&gt;<i>            &lt;Placemark&gt;
</I>&gt;<i>              &lt;name&gt;Liu Shiqing&lt;/name&gt;
</I>&gt;<i>              &lt;Point&gt;
</I>&gt;<i>                &lt;coordinates&gt;120.86981,24.19667&lt;/coordinates&gt; (: Approx :)
</I>&gt;<i>              &lt;/Point&gt;
</I>&gt;<i>            &lt;/Placemark&gt;
</I>&gt;<i>            &lt;Placemark&gt;
</I>&gt;<i>              &lt;name&gt;Wu Yuxuan&lt;/name&gt;
</I>&gt;<i>              &lt;Point&gt;
</I>&gt;<i>                &lt;coordinates&gt;120.86981,24.18811&lt;/coordinates&gt;
</I>&gt;<i>              &lt;/Point&gt;
</I>&gt;<i>            &lt;/Placemark&gt;
</I>&gt;<i>            &lt;Placemark&gt;
</I>&gt;<i>              &lt;name&gt;Chen Chunlai&lt;/name&gt;
</I>&gt;<i>              &lt;Point&gt;
</I>&gt;<i>                &lt;coordinates&gt;120.877008,24.187393&lt;/coordinates&gt;
</I>&gt;<i>              &lt;/Point&gt;
</I>&gt;<i>            &lt;/Placemark&gt;
</I>&gt;<i>            &lt;Placemark&gt;
</I>&gt;<i>              &lt;name&gt;Chen Zhenfeng&lt;/name&gt;
</I>&gt;<i>              &lt;Point&gt;
</I>&gt;<i>                &lt;coordinates&gt;120.87456,24.18333&lt;/coordinates&gt;
</I>&gt;<i>              &lt;/Point&gt;
</I>&gt;<i>            &lt;/Placemark&gt;
</I>&gt;<i>            &lt;Placemark&gt;
</I>&gt;<i>              &lt;name&gt;Dazhong&lt;/name&gt;
</I>&gt;<i>              &lt;Point&gt;
</I>&gt;<i>                &lt;coordinates&gt;120.872499,24.200025&lt;/coordinates&gt;
</I>&gt;<i>              &lt;/Point&gt;
</I>&gt;<i>            &lt;/Placemark&gt;
</I>&gt;<i>            &lt;Placemark&gt;
</I>&gt;<i>              &lt;name&gt;Liu Jinxing&lt;/name&gt;
</I>&gt;<i>              &lt;Point&gt;
</I>&gt;<i>                &lt;coordinates&gt;120.874624,24.193282&lt;/coordinates&gt;
</I>&gt;<i>              &lt;/Point&gt;
</I>&gt;<i>            &lt;/Placemark&gt;
</I>&gt;<i>            &lt;Placemark&gt;
</I>&gt;<i>              &lt;name&gt;Zeng Pingzhu&lt;/name&gt;
</I>&gt;<i>              &lt;Point&gt;
</I>&gt;<i>                &lt;coordinates&gt;120.868530,24.183716&lt;/coordinates&gt;
</I>&gt;<i>              &lt;/Point&gt;
</I>&gt;<i>            &lt;/Placemark&gt;
</I>&gt;<i> 	  &lt;/Folder&gt;)}
</I>&gt;<i>      &lt;/Folder&gt;
</I>&gt;<i>    &lt;/Document&gt;
</I>&gt;<i> &lt;/kml&gt;
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>
</PRE>





]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004015.html</link><pubDate>Thu, 20 Dec 2012 08:00:09 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>As per the mailing list archive link I sent yesterday.
Use this to comment out data inside XML literal constructors

&lt;Point&gt;
	{    (: &lt;coordinates&gt; ALLOW ME TO COMMENT OUT THIS LINE&lt;/coordinates&gt; :)  }
...




----------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.xmlsh.org

-----Original Message-----
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf Of http://x-query.com/mailman/listinfo/talk
Sent: Thursday, December 20, 2012 10:39 AM
To: http://x-query.com/mailman/listinfo/talk
Cc: http://x-query.com/mailman/listinfo/talk
Subject: Re:  let's comment out a line in XQuery

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/mapping/kml/noise0.xq:
[XPTY0004] Single item expected, ( ALLOW ME TO COMMENT OUT THIS LINE, ...) found.
      0       0       0
$ cat noise0.xq
(:
# Make a map of noisy neighbors, Xquery version.
# Copyright       : http://www.fsf.org/copyleft/gpl.html
# Author          : Dan Jacobson -- http://jidanni.org/
# Created On      : Sat Jan 29 17:28:12 2011
# Last Modified On: Thu Dec 20 23:29:24 2012
# Update Count    : 122
:<i>)
</I>declare option output:omit-xml-declaration &quot;no&quot;;
declare function local:fol($f){
  (: just adds lines between the first point and the rest :)
  &lt;Folder&gt;
    {$f/*}
    &lt;Folder&gt;
      &lt;name&gt;(lines)&lt;/name&gt;
      &lt;open&gt;0&lt;/open&gt;
      {
	for $p at $c in $f/*:Placemark
	where $c &gt; 1
	return
	&lt;Placemark&gt;
	  &lt;name&gt;{concat($f/*:Placemark[$c]//*:name/text(),&quot; to &quot;,
	  $f/*:Placemark[ 1]//*:name/text())}&lt;/name&gt;
	  &lt;LineString&gt;
	    &lt;coordinates&gt;{concat($f/*:Placemark[$c]//*:coordinates/text(),&quot; &quot;,
	    $f/*:Placemark[ 1]//*:coordinates/text())}&lt;/coordinates&gt;
	  &lt;/LineString&gt;
	&lt;/Placemark&gt;
}  &lt;/Folder&gt;
&lt;/Folder&gt;}
;
&lt;kml xmlns=&quot;http://www.opengis.net/kml/2.2&quot;&gt;
  {comment {&quot;Made by noise.xq, will get OVERWRITTEN&quot;}}
  &lt;Document&gt;
    &lt;Folder&gt;
      &lt;name&gt;&#22122;&#38899; Noise&lt;/name&gt;
      &lt;description&gt;http://jidanni.org/me/quiet.html&lt;/description&gt;
      {local:fol(
      &lt;Folder&gt;
        &lt;name&gt;&#24950;&#31119;&#34903; 1-3 Qingfu St.&lt;/name&gt;
	&lt;Placemark&gt;
	  &lt;name&gt;1-3&lt;/name&gt;
	  &lt;Point&gt;
	    (: &lt;coordinates&gt; ALLOW ME TO COMMENT OUT THIS LINE&lt;/coordinates&gt; :)
	    &lt;coordinates&gt;120.865201,24.181712&lt;/coordinates&gt; (: 2012/12 Google satellite :)
	  &lt;/Point&gt;
	&lt;/Placemark&gt;
        &lt;Placemark&gt;
          &lt;name&gt;Luo Yuntian&lt;/name&gt;
          &lt;Point&gt;
            &lt;coordinates&gt;120.868205,24.176483&lt;/coordinates&gt;
          &lt;/Point&gt;
        &lt;/Placemark&gt;
        &lt;Placemark&gt;
          &lt;name&gt;Zhong Guilin&lt;/name&gt;
          &lt;Point&gt;
            &lt;coordinates&gt;120.866934,24.152642&lt;/coordinates&gt;
          &lt;/Point&gt;
        &lt;/Placemark&gt;
        &lt;Placemark&gt;
          &lt;name&gt;Maan Nong Zhuang&lt;/name&gt;
          &lt;Point&gt;
            &lt;coordinates&gt;120.84368,24.17268&lt;/coordinates&gt; (: &#26481;&#21218;&#21312;&#24950;&#31119;&#37324;007&#37168;-&#26481;&#38364;&#36335;&#65297;&#65300;&#65303;&#34399; :)
          &lt;/Point&gt;
        &lt;/Placemark&gt;
	&lt;/Folder&gt;)}
	{local:fol(
	&lt;Folder&gt;
          &lt;name&gt;&#24950;&#31119;&#34903; 1-6 Qingfu St.&lt;/name&gt;
	  &lt;Placemark&gt;
	    &lt;name&gt;1-6&lt;/name&gt;
	    &lt;Point&gt;
	      &lt;coordinates&gt;120.866215,24.181668&lt;/coordinates&gt;
	    &lt;/Point&gt;
	  &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Liu Shiqing&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.86981,24.19667&lt;/coordinates&gt; (: Approx :)
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Wu Yuxuan&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.86981,24.18811&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Chen Chunlai&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.877008,24.187393&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Chen Zhenfeng&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.87456,24.18333&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Dazhong&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.872499,24.200025&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Liu Jinxing&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.874624,24.193282&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Zeng Pingzhu&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.868530,24.183716&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
	  &lt;/Folder&gt;)}
    &lt;/Folder&gt;
  &lt;/Document&gt;
&lt;/kml&gt;

_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk

</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004014.html</link><pubDate>Thu, 20 Dec 2012 07:47:05 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>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/mapping/kml/noise0.xq:
[XPTY0004] Single item expected, ( ALLOW ME TO COMMENT OUT THIS LINE, ...) found.
      0       0       0
$ cat noise0.xq
(:
# Make a map of noisy neighbors, Xquery version.
# Copyright       : http://www.fsf.org/copyleft/gpl.html
# Author          : Dan Jacobson -- http://jidanni.org/
# Created On      : Sat Jan 29 17:28:12 2011
# Last Modified On: Thu Dec 20 23:29:24 2012
# Update Count    : 122
:<i>)
</I>declare option output:omit-xml-declaration &quot;no&quot;;
declare function local:fol($f){
  (: just adds lines between the first point and the rest :)
  &lt;Folder&gt;
    {$f/*}
    &lt;Folder&gt;
      &lt;name&gt;(lines)&lt;/name&gt;
      &lt;open&gt;0&lt;/open&gt;
      {
	for $p at $c in $f/*:Placemark
	where $c &gt; 1
	return
	&lt;Placemark&gt;
	  &lt;name&gt;{concat($f/*:Placemark[$c]//*:name/text(),&quot; to &quot;,
	  $f/*:Placemark[ 1]//*:name/text())}&lt;/name&gt;
	  &lt;LineString&gt;
	    &lt;coordinates&gt;{concat($f/*:Placemark[$c]//*:coordinates/text(),&quot; &quot;,
	    $f/*:Placemark[ 1]//*:coordinates/text())}&lt;/coordinates&gt;
	  &lt;/LineString&gt;
	&lt;/Placemark&gt;
}  &lt;/Folder&gt;
&lt;/Folder&gt;}
;
&lt;kml xmlns=&quot;http://www.opengis.net/kml/2.2&quot;&gt;
  {comment {&quot;Made by noise.xq, will get OVERWRITTEN&quot;}}
  &lt;Document&gt;
    &lt;Folder&gt;
      &lt;name&gt;&#22122;&#38899; Noise&lt;/name&gt;
      &lt;description&gt;http://jidanni.org/me/quiet.html&lt;/description&gt;
      {local:fol(
      &lt;Folder&gt;
        &lt;name&gt;&#24950;&#31119;&#34903; 1-3 Qingfu St.&lt;/name&gt;
	&lt;Placemark&gt;
	  &lt;name&gt;1-3&lt;/name&gt;
	  &lt;Point&gt;
	    (: &lt;coordinates&gt; ALLOW ME TO COMMENT OUT THIS LINE&lt;/coordinates&gt; :)
	    &lt;coordinates&gt;120.865201,24.181712&lt;/coordinates&gt; (: 2012/12 Google satellite :)
	  &lt;/Point&gt;
	&lt;/Placemark&gt;
        &lt;Placemark&gt;
          &lt;name&gt;Luo Yuntian&lt;/name&gt;
          &lt;Point&gt;
            &lt;coordinates&gt;120.868205,24.176483&lt;/coordinates&gt;
          &lt;/Point&gt;
        &lt;/Placemark&gt;
        &lt;Placemark&gt;
          &lt;name&gt;Zhong Guilin&lt;/name&gt;
          &lt;Point&gt;
            &lt;coordinates&gt;120.866934,24.152642&lt;/coordinates&gt;
          &lt;/Point&gt;
        &lt;/Placemark&gt;
        &lt;Placemark&gt;
          &lt;name&gt;Maan Nong Zhuang&lt;/name&gt;
          &lt;Point&gt;
            &lt;coordinates&gt;120.84368,24.17268&lt;/coordinates&gt; (: &#26481;&#21218;&#21312;&#24950;&#31119;&#37324;007&#37168;-&#26481;&#38364;&#36335;&#65297;&#65300;&#65303;&#34399; :)
          &lt;/Point&gt;
        &lt;/Placemark&gt;
	&lt;/Folder&gt;)}
	{local:fol(
	&lt;Folder&gt;
          &lt;name&gt;&#24950;&#31119;&#34903; 1-6 Qingfu St.&lt;/name&gt;
	  &lt;Placemark&gt;
	    &lt;name&gt;1-6&lt;/name&gt;
	    &lt;Point&gt;
	      &lt;coordinates&gt;120.866215,24.181668&lt;/coordinates&gt;
	    &lt;/Point&gt;
	  &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Liu Shiqing&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.86981,24.19667&lt;/coordinates&gt; (: Approx :)
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Wu Yuxuan&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.86981,24.18811&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Chen Chunlai&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.877008,24.187393&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Chen Zhenfeng&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.87456,24.18333&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Dazhong&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.872499,24.200025&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Liu Jinxing&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.874624,24.193282&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
          &lt;Placemark&gt;
            &lt;name&gt;Zeng Pingzhu&lt;/name&gt;
            &lt;Point&gt;
              &lt;coordinates&gt;120.868530,24.183716&lt;/coordinates&gt;
            &lt;/Point&gt;
          &lt;/Placemark&gt;
	  &lt;/Folder&gt;)}
    &lt;/Folder&gt;
  &lt;/Document&gt;
&lt;/kml&gt;

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004013.html</link><pubDate>Thu, 20 Dec 2012 07:39:22 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Arg so tired I can't copy/paste sorry
http://markmail.org/thread/cd2nyugalcffjf3o


-----Original Message-----
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf Of David Lee
Sent: Thursday, December 20, 2012 7:18 AM
To: Michael Kay; http://x-query.com/mailman/listinfo/talk
Subject: Re:  let's comment out a line in XQuery

Since I am tired this morning :)
Try perusing this tread for a lively discussion on XQuery comments

arkmail.org/thread/cd2nyugalcffjf3o


-----Original Message-----
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf Of Michael Kay
Sent: Thursday, December 20, 2012 3:30 AM
To: http://x-query.com/mailman/listinfo/talk
Subject: Re:  let's comment out a line in XQuery

Clearly there are contexts in which commenting out a line of code will leave a query that is syntactically or semantically invalid. Why do you find this strange? Why do you expect us to be able to tell you why the remaining query throws an error, when you haven't shown us this query?

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, http://x-query.com/mailman/listinfo/talk wrote:
&gt;<i> Geez, all I wanted to do was comment out a line:
</I>&gt;<i> (: &lt;coordinates&gt;120.865225,24.181802&lt;/coordinates&gt; :) But now I have 
</I>&gt;<i> to make it
</I>&gt;<i> (: 120.865225,24.181802 :)
</I>&gt;<i> or else I get
</I>&gt;<i> $ basex noise.xq &gt; noise.kml
</I>&gt;<i> Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise.xq:
</I>&gt;<i> [XPTY0004] Single item expected, (120.865225,24.181802, 120.865201,24.181712) found.
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>
_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk



_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk



</PRE>
















]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004012.html</link><pubDate>Thu, 20 Dec 2012 04:19:55 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Since I am tired this morning :)
Try perusing this tread for a lively discussion on XQuery comments

arkmail.org/thread/cd2nyugalcffjf3o


-----Original Message-----
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf Of Michael Kay
Sent: Thursday, December 20, 2012 3:30 AM
To: http://x-query.com/mailman/listinfo/talk
Subject: Re:  let's comment out a line in XQuery

Clearly there are contexts in which commenting out a line of code will leave a query that is syntactically or semantically invalid. Why do you find this strange? Why do you expect us to be able to tell you why the remaining query throws an error, when you haven't shown us this query?

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, http://x-query.com/mailman/listinfo/talk wrote:
&gt;<i> Geez, all I wanted to do was comment out a line:
</I>&gt;<i> (: &lt;coordinates&gt;120.865225,24.181802&lt;/coordinates&gt; :) But now I have 
</I>&gt;<i> to make it
</I>&gt;<i> (: 120.865225,24.181802 :)
</I>&gt;<i> or else I get
</I>&gt;<i> $ basex noise.xq &gt; noise.kml
</I>&gt;<i> Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise.xq:
</I>&gt;<i> [XPTY0004] Single item expected, (120.865225,24.181802, 120.865201,24.181712) found.
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>
_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk



</PRE>
















]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004011.html</link><pubDate>Thu, 20 Dec 2012 04:18:26 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Clearly there are contexts in which commenting out a line of code will 
leave a query that is syntactically or semantically invalid. Why do you 
find this strange? Why do you expect us to be able to tell you why the 
remaining query throws an error, when you haven't shown us this query?

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, http://x-query.com/mailman/listinfo/talk wrote:
&gt;<i> Geez, all I wanted to do was comment out a line:
</I>&gt;<i> (: &lt;coordinates&gt;120.865225,24.181802&lt;/coordinates&gt; :)
</I>&gt;<i> But now I have to make it
</I>&gt;<i> (: 120.865225,24.181802 :)
</I>&gt;<i> or else I get
</I>&gt;<i> $ basex noise.xq &gt; noise.kml
</I>&gt;<i> Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise.xq:
</I>&gt;<i> [XPTY0004] Single item expected, (120.865225,24.181802, 120.865201,24.181712) found.
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>
</PRE>
















]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004010.html</link><pubDate>Thu, 20 Dec 2012 00:29:33 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi jidanni,

Your particular line does not cause an error here. Tried it with the BaseX live demo (online).

Your query indicates it consists of at least 26 lines, could you provide the whole query, or even better an ssce?


We are using comments in XQuery on a day to basis, so I hope you're only provided with a misleading error message :-)

Best
Michael 

Am 20.12.2012 um 06:45 schrieb http://x-query.com/mailman/listinfo/talk:

&gt;<i> Geez, all I wanted to do was comment out a line:
</I>&gt;<i> (: &lt;coordinates&gt;120.865225,24.181802&lt;/coordinates&gt; :)
</I>&gt;<i> But now I have to make it
</I>&gt;<i> (: 120.865225,24.181802 :)
</I>&gt;<i> or else I get
</I>&gt;<i> $ basex noise.xq &gt; noise.kml
</I>&gt;<i> Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise.xq:
</I>&gt;<i> [XPTY0004] Single item expected, (120.865225,24.181802, 120.865201,24.181712) found.
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>
</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004009.html</link><pubDate>Wed, 19 Dec 2012 23:41:05 GMT</pubDate></item><item><title>  let's comment out a line in XQuery
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Geez, all I wanted to do was comment out a line:
(: &lt;coordinates&gt;120.865225,24.181802&lt;/coordinates&gt; :)
But now I have to make it
(: 120.865225,24.181802 :)
or else I get
$ basex noise.xq &gt; noise.kml
Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise.xq:
[XPTY0004] Single item expected, (120.865225,24.181802, 120.865201,24.181712) found.
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004008.html</link><pubDate>Wed, 19 Dec 2012 21:45:37 GMT</pubDate></item><item><title>  static error [err:XPST0051]: &amp;quot;xs:anySimpleType&amp;quot;: not defined as atomic type
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Wed, Dec 19, 2012 at 2:54 PM, Robby Pelssers &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Ok...
</I>&gt;<i>
</I>&gt;<i> I managed to get something working.  But not sure if it is such a smart idea... Any comments from the experts?
</I>&gt;<i>
</I>&gt;<i> http://robbypelssers.blogspot.nl/2012/12/using-options-in-xquery.html
</I>&gt;<i>
</I>
Like most of the good things in Scala this originated in Standard ML
(and anybody wondering whether learning Standard ML would short
circuit their Scala learning curve would IMHO be right).

http://www.standardml.org/Basis/option.html

PS I am not an expert.
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004007.html</link><pubDate>Wed, 19 Dec 2012 07:40:37 GMT</pubDate></item><item><title>  static error [err:XPST0051]: &amp;quot;xs:anySimpleType&amp;quot;: not defined as atomic type
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Ok...

I managed to get something working.  But not sure if it is such a smart idea... Any comments from the experts?

http://robbypelssers.blogspot.nl/2012/12/using-options-in-xquery.html


Cheers,
Robby

-----Original Message-----
From: Robby Pelssers 
Sent: Wednesday, December 19, 2012 3:21 PM
To: http://x-query.com/mailman/listinfo/talk; Robby Pelssers
Subject: static error [err:XPST0051]: &quot;xs:anySimpleType&quot;: not defined as atomic type

Hi all,

I was experimenting a bit to make my code more robust but I don't fully understand why the code below complains about the local:getOrElse function.

Can someone shed some light on this matter?

Thx in advance,
Robby

(:
   Taken the same approach as Scala we return options which are either none or some
   &lt;option&gt;
     &lt;none/&gt;
   &lt;/option&gt;
   
   &lt;option&gt;
     &lt;some&gt;4&lt;/some&gt;
   &lt;/option&gt; 

   Example of a lookup map represented in XML
   &lt;map&gt;
     &lt;entry key=&quot;PH3330L&quot;&gt;SOT669&lt;/entry&gt;
     &lt;entry key=&quot;BUK100-50GL&quot;&gt;SOT78B&lt;/entry&gt;
     &lt;entry key=&quot;PSMN003-30B&quot;&gt;SOT404&lt;/entry&gt;
   &lt;/map&gt;   
:<i>)
</I>
declare function local:getOrElse($map as element(map), $key as xs:string, $else as xs:anySimpleType) as xs:anySimpleType {
    let $option := local:get($map, $key)
    return (if (empty($option/some)) then $else else data($option/some)) };

declare function local:get($map as element(map), $key as xs:string) as element(option) {
    return (if (empty($map/entry[key=$key])) then &lt;option&gt;&lt;none/&gt;&lt;/option&gt; else &lt;option&gt;&lt;some&gt;{data($map/entry[key=$key])}&lt;/some&gt;&lt;/option&gt;)
};

let $map := 
   &lt;map&gt;
     &lt;entry key=&quot;PH3330L&quot;&gt;SOT669&lt;/entry&gt;
     &lt;entry key=&quot;BUK100-50GL&quot;&gt;SOT78B&lt;/entry&gt;
     &lt;entry key=&quot;PSMN003-30B&quot;&gt;SOT404&lt;/entry&gt;
   &lt;/map&gt;  
   
return
  &lt;lookups&gt;
    &lt;lookup&gt;{local:getOrElse($map, &quot;PH3330L&quot;, &quot;test1&quot;)}&lt;/lookup&gt;
    &lt;lookup&gt;{local:getOrElse($map, &quot;INVALID&quot;, &quot;test1&quot;)}&lt;/lookup&gt;
  &lt;/lookups&gt;  

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004006.html</link><pubDate>Wed, 19 Dec 2012 06:54:28 GMT</pubDate></item><item><title>  static error [err:XPST0051]: &amp;quot;xs:anySimpleType&amp;quot;: not defined as atomic type
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi all,

I was experimenting a bit to make my code more robust but I don't fully understand why the code below complains about the local:getOrElse function.

Can someone shed some light on this matter?

Thx in advance,
Robby

(:
   Taken the same approach as Scala we return options which are either none or some
   &lt;option&gt;
     &lt;none/&gt;
   &lt;/option&gt;
   
   &lt;option&gt;
     &lt;some&gt;4&lt;/some&gt;
   &lt;/option&gt; 

   Example of a lookup map represented in XML
   &lt;map&gt;
     &lt;entry key=&quot;PH3330L&quot;&gt;SOT669&lt;/entry&gt;
     &lt;entry key=&quot;BUK100-50GL&quot;&gt;SOT78B&lt;/entry&gt;
     &lt;entry key=&quot;PSMN003-30B&quot;&gt;SOT404&lt;/entry&gt;
   &lt;/map&gt;   
:<i>)
</I>
declare function local:getOrElse($map as element(map), $key as xs:string, $else as xs:anySimpleType) as xs:anySimpleType {
    let $option := local:get($map, $key)
    return (if (empty($option/some)) then $else else data($option/some))
};

declare function local:get($map as element(map), $key as xs:string) as element(option) {
    return (if (empty($map/entry[key=$key])) then &lt;option&gt;&lt;none/&gt;&lt;/option&gt; else &lt;option&gt;&lt;some&gt;{data($map/entry[key=$key])}&lt;/some&gt;&lt;/option&gt;)
};

let $map := 
   &lt;map&gt;
     &lt;entry key=&quot;PH3330L&quot;&gt;SOT669&lt;/entry&gt;
     &lt;entry key=&quot;BUK100-50GL&quot;&gt;SOT78B&lt;/entry&gt;
     &lt;entry key=&quot;PSMN003-30B&quot;&gt;SOT404&lt;/entry&gt;
   &lt;/map&gt;  
   
return 
  &lt;lookups&gt;
    &lt;lookup&gt;{local:getOrElse($map, &quot;PH3330L&quot;, &quot;test1&quot;)}&lt;/lookup&gt;
    &lt;lookup&gt;{local:getOrElse($map, &quot;INVALID&quot;, &quot;test1&quot;)}&lt;/lookup&gt;
  &lt;/lookups&gt;  

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004005.html</link><pubDate>Wed, 19 Dec 2012 06:21:21 GMT</pubDate></item><item><title>  The value does not conform to the lexical constraints defined for the xs:anyURI type
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;&gt;<i> http://www.w3.org/2011/04/XMLSchema/TypeLibrary-IRI-RFC3987.xsd
</I>
So the newest regex is the union of
((([A-Za-z])[A-Za-z0-9+\-\.]*):((//(((([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;- &#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;-&#56063;&#57341;&#56064;&#56320;- &#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;!$&amp;'()*+,;=:]|(%[0-9A-Fa-f][0-9A-Fa-f]))*@))?((\[((((([0-9A-Fa-f]{0,4}:)){6}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|(::(([0-9A-Fa-f]{0,4}:)){5}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|(([0-9A-Fa-f]{0,4})?::(([0-9A-Fa-f]{0,4}:)){4}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:))?[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:)){3}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,2}[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:)){2}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,3}[0-9A-Fa-f]{0,4}))?::[0-9A-Fa-f]{0,4}:(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,4}[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,5}[0-9A-Fa-f]{0,4}))?::[0-9A-Fa-f]{0,4})|((((([0-9A-Fa-f]{0,4}:)){0,6}[0-9A-Fa-f]{0,4}))?::))|(v[0-9A-Fa-f]+\.[A-Za-z0-9\-\._~!$&amp;'()*+,;=:]+))\])|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))|(([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=]))*)((:[0-9]*))?)((/(([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@]))*))*)|(/(((([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@]))+((/(([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@]))*))*))?)|((([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@]))+((/(([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@]))*))*)|)((\?(([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@])|[&#57344;-&#63743;&#56192;&#56320;-&#56255;&#57341;&#56256;&#56320;-&#56319;&#57341;/?])*))?((#((([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@])|/|\?))*))?)
and
(((//(((([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;- &#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;-&#56063;&#57341;&#56064;&#56320;- &#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;!$&amp;'()*+,;=:]|(%[0-9A-Fa-f][0-9A-Fa-f]))*@))?((\[((((([0-9A-Fa-f]{0,4}:)){6}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|(::(([0-9A-Fa-f]{0,4}:)){5}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|(([0-9A-Fa-f]{0,4})?::(([0-9A-Fa-f]{0,4}:)){4}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:))?[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:)){3}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,2}[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:)){2}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,3}[0-9A-Fa-f]{0,4}))?::[0-9A-Fa-f]{0,4}:(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,4}[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,5}[0-9A-Fa-f]{0,4}))?::[0-9A-Fa-f]{0,4})|((((([0-9A-Fa-f]{0,4}:)){0,6}[0-9A-Fa-f]{0,4}))?::))|(v[0-9A-Fa-f]+\.[A-Za-z0-9\-\._~!$&amp;'()*+,;=:]+))\])|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))|(([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=]))*)((:[0-9]*))?)((/(([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@]))*))*)|(/(((([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@]))+((/(([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@]))*))*))?)|(([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;!$&amp;'()*+,;=@]|(%[0-9A-Fa-f][0-9A-Fa-f]))+((/(([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@]))*))*))?((\?(([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@])|[&#57344;-&#63743;&#56192;&#56320;-&#56255;&#57341;&#56256;&#56320;-&#56319;&#57341;/?])*))?((#((([A-Za-z0-9\-\._~ -&#55295;&#63744;-&#64975;&#65008;-&#65519;&#55296;&#56320;-&#55359;&#57341;&#55360;&#56320;-&#55423;&#57341;&#55424;&#56320;-&#55487;&#57341;&#55488;&#56320;-&#55551;&#57341;&#55552;&#56320;-&#55615;&#57341;&#55616;&#56320;-&#55679;&#57341;&#55680;&#56320;-&#55743;&#57341;&#55744;&#56320;-&#55807;&#57341;&#55808;&#56320;-&#55871;&#57341;&#55872;&#56320;-&#55935;&#57341;&#55936;&#56320;-&#55999;&#57341;&#56000;&#56320;- &#56063;&#57341;&#56064;&#56320;-&#56127;&#57341;&#56132;&#56320;-&#56191;&#57341;]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&amp;'()*+,;=:@])|/|\?))*))?)

But that is even worse!

Benito

On 12/19/2012 12:41 PM, Michael Kay wrote:&gt; Michael Sperberg-McQueen has defined types that match&gt; different flavours of URI in&gt;&gt; http://www.w3.org/2011/04/XMLSchema/TypeLibrary-URI-RFC3986.xsd&gt;&gt; and&gt;&gt; http://www.w3.org/2011/04/XMLSchema/TypeLibrary-IRI-RFC3987.xsd&gt;&gt; To see the way these complex regular expressions are constructed, view&gt; these documents at the raw XML level using (for example) curl.&gt;&gt; Michael Kay&gt; Saxonica&gt;&gt;&gt; On 19/12/2012 11:13, Benito van der Zander wrote:&gt;&gt; Hi,&gt;&gt;&gt;&gt; btw. has anyone a regular expression matching exactly the allowed &gt;&gt; anyURIs of XSD 1.0?&gt;&gt;&gt;&gt; I tried to make one by translating the BNF in RFC 2396 and 2732 to &gt;&gt; regex, by having a regex for every token, and substituting them &gt;&gt; everywhere the token is used in the BNF.&gt;&gt;&gt;&gt; But the resulting regex:&gt;&gt;&gt;&gt; ((((([a-zA-Z][a-zA-Z0-9+-.]*:)?((//(((([a-zA-Z0-9-_.!~*''();:&amp;=+$,]|%[a-fA-F0-9]{2})*@)?((([a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?.)*[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?.?)|([0-9]+(.[0-9]+){3})|\[(([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?|([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?::([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?)(:[0-9]{1,3}(.[0-9]{1,3}){3})?\])(:[0-9]*)?)?|([a-zA-Z0-9-_.!~*''()$,;:@&amp;=+]|%[a-fA-F0-9]{2})+)(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*)*)?)|(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*)*)))|(([a-zA-Z0-9-_.!~*''();@&amp;=+$,]|%[a-fA-F0-9]{2})+(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*)*)?))([?]([;/?:@&amp;=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*)?)|([a-zA-Z][a-zA-Z0-9+-.]*:([a-zA-Z0-9-_.!~*''();?:@&amp;=+$,]|%[a-fA-F0-9]{2})(([;/?:@&amp;=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2}))*))?(#(([;/?:@&amp;=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*))? &gt;&gt;&gt;&gt;&gt;&gt; is just horrible.&gt;&gt; (and it might not even work so well with unicode)&gt;&gt;&gt;&gt; Benito&gt;&gt;&gt;&gt;&gt;&gt; On 12/19/2012 10:31 AM, Michael Kay wrote:&gt;&gt;&gt; The validation rules for xs:anyURI in the XSD 1.0 specification are &gt;&gt;&gt; notoriously troublesome, and it is not surprising that different &gt;&gt;&gt; implementors interpret them differently.&gt;&gt;&gt;&gt;&gt;&gt; This is what XSD 1.0 says:&gt;&gt;&gt;&gt;&gt;&gt; &lt;quote&gt;&gt;&gt;&gt; The &#183;lexical space&#183; of anyURI is finite-length character sequences &gt;&gt;&gt; which, when the algorithm defined in Section 5.4 of [XML Linking &gt;&gt;&gt; Language] is applied to them, result in strings which are legal URIs &gt;&gt;&gt; according to [RFC 2396], as amended by [RFC 2732].&gt;&gt;&gt;&gt;&gt;&gt; Note: Spaces are, in principle, allowed in the &#183;lexical space&#183; of &gt;&gt;&gt; anyURI, however, their use is highly discouraged (unless they are &gt;&gt;&gt; encoded by %20).&gt;&gt;&gt; &lt;/quote&gt;&gt;&gt;&gt;&gt;&gt;&gt; The &quot;Note&quot; here suggests that Sedna is wrong to reject the value (it &gt;&gt;&gt; also suggests that your query is wrong to supply it, but that you &gt;&gt;&gt; should be able to get away with it).&gt;&gt;&gt;&gt;&gt;&gt; The &quot;algorithm&quot; referred to in this rule is basically the escaping &gt;&gt;&gt; of special characters such as space.&gt;&gt;&gt;&gt;&gt;&gt; Note that in XSD 1.1, the spec gives up trying to define what's &gt;&gt;&gt; valid in an xs:anyURI and what isn't - all strings are now valid in &gt;&gt;&gt; the lexical space of xs:anyURI.&gt;&gt;&gt;&gt;&gt;&gt; Michael Kay&gt;&gt;&gt; Saxonica&gt;&gt;&gt;&gt;&gt;&gt; On 19/12/2012 09:11, Robby Pelssers wrote:&gt;&gt;&gt;&gt; Hi all,&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I tested following Xquery with Sedna and Zorba:&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; declare function local:getPipUri($id as xs:string) as xs:anyURI {&gt;&gt;&gt;&gt; xs:anyURI(concat(&quot;http://www.nxp.com/pip/&quot;, $id))&gt;&gt;&gt;&gt; };&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; local:getPipUri(&quot;CX24483 14LZ&quot;)&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Sedna throws an exception:&gt;&gt;&gt;&gt; 2012/12/19 10:07:09 database query/update failed (SEDNA Message: &gt;&gt;&gt;&gt; ERROR FORG0001&gt;&gt;&gt;&gt; Invalid value for cast/constructor.&gt;&gt;&gt;&gt; Details: The value does not conform to the lexical constraints &gt;&gt;&gt;&gt; defined for the xs:anyURI type.&gt;&gt;&gt;&gt; Query line: 6, column:4&gt;&gt;&gt;&gt; )&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; http://www.zorba-xquery.com/html/demo happy returns &gt;&gt;&gt;&gt; &quot;http://www.nxp.com/pip/CX24483 14LZ&quot;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; So how does the xs:anyURI cast work? Is the developer supposed to &gt;&gt;&gt;&gt; encode the String before passing it to xs:anyURI or is the anyURI &gt;&gt;&gt;&gt; function supposed to do this?&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thx in advance,&gt;&gt;&gt;&gt; Robby&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________&gt;&gt;&gt;&gt; http://x-query.com/mailman/listinfo/talk&gt;&gt;&gt;&gt; http://x-query.com/mailman/listinfo/talk&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________&gt;&gt;&gt; http://x-query.com/mailman/listinfo/talk&gt;&gt;&gt; http://x-query.com/mailman/listinfo/talk&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________&gt;&gt; http://x-query.com/mailman/listinfo/talk&gt;&gt; http://x-query.com/mailman/listinfo/talk&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________&gt; http://x-query.com/mailman/listinfo/talk&gt; http://x-query.com/mailman/listinfo/talk&gt;

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004004.html</link><pubDate>Wed, 19 Dec 2012 04:11:12 GMT</pubDate></item><item><title>  The value does not conform to the lexical constraints defined for the xs:anyURI type
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Michael Sperberg-McQueen has defined types that match
different flavours of URI in

http://www.w3.org/2011/04/XMLSchema/TypeLibrary-URI-RFC3986.xsd

and

http://www.w3.org/2011/04/XMLSchema/TypeLibrary-IRI-RFC3987.xsd

To see the way these complex regular expressions are constructed, view
these documents at the raw XML level using (for example) curl.

Michael Kay
Saxonica


On 19/12/2012 11:13, Benito van der Zander wrote:
&gt;<i> Hi,
</I>&gt;<i>
</I>&gt;<i> btw. has anyone a regular expression matching exactly the allowed 
</I>&gt;<i> anyURIs of XSD 1.0?
</I>&gt;<i>
</I>&gt;<i> I tried to make one by translating the BNF in RFC 2396 and 2732 to 
</I>&gt;<i> regex, by having a regex for every token, and substituting them 
</I>&gt;<i> everywhere the token is used in the BNF.
</I>&gt;<i>
</I>&gt;<i> But the resulting regex:
</I>&gt;<i>
</I>&gt;<i> ((((([a-zA-Z][a-zA-Z0-9+-.]*:)?((//(((([a-zA-Z0-9-_.!~*''();:&amp;=+$,]|%[a-fA-F0-9]{2})*@)?((([a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?.)*[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?.?)|([0-9]+(.[0-9]+){3})|\[(([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?|([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?::([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?)(:[0-9]{1,3}(.[0-9]{1,3}){3})?\])(:[0-9]*)?)?|([a-zA-Z0-9-_.!~*''()$,;:@&amp;=+]|%[a-fA-F0-9]{2})+)(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*)*)?)|(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*)*)))|(([a-zA-Z0-9-_.!~*''();@&amp;=+$,]|%[a-fA-F0-9]{2})+(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*)*)?))([?]([;/?:@&amp;=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*)?)|([a-zA-Z][a-zA-Z0-9+-.]*:([a-zA-Z0-9-_.!~*''();?:@&amp;=+$,]|%[a-fA-F0-9]{2})(([;/?:@&amp;=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2}))*))?(#(([;/?:@&amp;=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*))? 
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> is just horrible.
</I>&gt;<i> (and it might not even work so well with unicode)
</I>&gt;<i>
</I>&gt;<i> Benito
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> On 12/19/2012 10:31 AM, Michael Kay wrote:
</I>&gt;&gt;<i> The validation rules for xs:anyURI in the XSD 1.0 specification are 
</I>&gt;&gt;<i> notoriously troublesome, and it is not surprising that different 
</I>&gt;&gt;<i> implementors interpret them differently.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> This is what XSD 1.0 says:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> &lt;quote&gt;
</I>&gt;&gt;<i> The &#183;lexical space&#183; of anyURI is finite-length character sequences 
</I>&gt;&gt;<i> which, when the algorithm defined in Section 5.4 of [XML Linking 
</I>&gt;&gt;<i> Language] is applied to them, result in strings which are legal URIs 
</I>&gt;&gt;<i> according to [RFC 2396], as amended by [RFC 2732].
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Note:  Spaces are, in principle, allowed in the &#183;lexical space&#183; of 
</I>&gt;&gt;<i> anyURI, however, their use is highly discouraged (unless they are 
</I>&gt;&gt;<i> encoded by %20).
</I>&gt;&gt;<i> &lt;/quote&gt;
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> The &quot;Note&quot; here suggests that Sedna is wrong to reject the value (it 
</I>&gt;&gt;<i> also suggests that your query is wrong to supply it, but that you 
</I>&gt;&gt;<i> should be able to get away with it).
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> The &quot;algorithm&quot; referred to in this rule is basically the escaping of 
</I>&gt;&gt;<i> special characters such as space.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Note that in XSD 1.1, the spec gives up trying to define what's valid 
</I>&gt;&gt;<i> in an xs:anyURI and what isn't - all strings are now valid in the 
</I>&gt;&gt;<i> lexical space of xs:anyURI.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Michael Kay
</I>&gt;&gt;<i> Saxonica
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> On 19/12/2012 09:11, Robby Pelssers wrote:
</I>&gt;&gt;&gt;<i> Hi all,
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> I tested following Xquery with Sedna and Zorba:
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> declare function local:getPipUri($id as xs:string) as xs:anyURI {
</I>&gt;&gt;&gt;<i>     xs:anyURI(concat(&quot;http://www.nxp.com/pip/&quot;, $id))
</I>&gt;&gt;&gt;<i> };
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> local:getPipUri(&quot;CX24483 14LZ&quot;)
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> Sedna throws an exception:
</I>&gt;&gt;&gt;<i> 2012/12/19 10:07:09 database query/update failed (SEDNA Message: 
</I>&gt;&gt;&gt;<i> ERROR FORG0001
</I>&gt;&gt;&gt;<i> Invalid value for cast/constructor.
</I>&gt;&gt;&gt;<i> Details: The value does not conform to the lexical constraints 
</I>&gt;&gt;&gt;<i> defined for the xs:anyURI type.
</I>&gt;&gt;&gt;<i> Query line: 6, column:4
</I>&gt;&gt;&gt;<i> )
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> http://www.zorba-xquery.com/html/demo happy returns 
</I>&gt;&gt;&gt;<i> &quot;http://www.nxp.com/pip/CX24483 14LZ&quot;
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> So how does the xs:anyURI cast work? Is the developer supposed to 
</I>&gt;&gt;&gt;<i> encode the String before passing it to xs:anyURI or is the anyURI 
</I>&gt;&gt;&gt;<i> function supposed to do this?
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> Thx in advance,
</I>&gt;&gt;&gt;<i> Robby
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>


</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004003.html</link><pubDate>Wed, 19 Dec 2012 03:41:17 GMT</pubDate></item><item><title>  The value does not conform to the lexical constraints defined for the xs:anyURI type
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi,

btw. has anyone a regular expression matching exactly the allowed 
anyURIs of XSD 1.0?

I tried to make one by translating the BNF in RFC 2396 and 2732 to 
regex, by having a regex for every token, and substituting them 
everywhere the token is used in the BNF.

But the resulting regex:

((((([a-zA-Z][a-zA-Z0-9+-.]*:)?((//(((([a-zA-Z0-9-_.!~*''();:&amp;=+$,]|%[a-fA-F0-9]{2})*@)?((([a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?.)*[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?.?)|([0-9]+(.[0-9]+){3})|\[(([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?|([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?::([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?)(:[0-9]{1,3}(.[0-9]{1,3}){3})?\])(:[0-9]*)?)?|([a-zA-Z0-9-_.!~*''()$,;:@&amp;=+]|%[a-fA-F0-9]{2})+)(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*)*)?)|(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*)*)))|(([a-zA-Z0-9-_.!~*''();@&amp;=+$,]|%[a-fA-F0-9]{2})+(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&amp;=+$,]|%[a-fA-F0-9]{2})*)*)*)?))([?]([;/?:@&amp;=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*)?)|([a-zA-Z][a-zA-Z0-9+-.]*:([a-zA-Z0-9-_.!~*''();?:@&amp;=+$,]|%[a-fA-F0-9]{2})(([;/?:@&amp;=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2}))*))?(#(([;/?:@&amp;=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*))?

is just horrible.
(and it might not even work so well with unicode)

Benito


On 12/19/2012 10:31 AM, Michael Kay wrote:
&gt;<i> The validation rules for xs:anyURI in the XSD 1.0 specification are 
</I>&gt;<i> notoriously troublesome, and it is not surprising that different 
</I>&gt;<i> implementors interpret them differently.
</I>&gt;<i>
</I>&gt;<i> This is what XSD 1.0 says:
</I>&gt;<i>
</I>&gt;<i> &lt;quote&gt;
</I>&gt;<i> The &#183;lexical space&#183; of anyURI is finite-length character sequences 
</I>&gt;<i> which, when the algorithm defined in Section 5.4 of [XML Linking 
</I>&gt;<i> Language] is applied to them, result in strings which are legal URIs 
</I>&gt;<i> according to [RFC 2396], as amended by [RFC 2732].
</I>&gt;<i>
</I>&gt;<i> Note:  Spaces are, in principle, allowed in the &#183;lexical space&#183; of 
</I>&gt;<i> anyURI, however, their use is highly discouraged (unless they are 
</I>&gt;<i> encoded by %20).
</I>&gt;<i> &lt;/quote&gt;
</I>&gt;<i>
</I>&gt;<i> The &quot;Note&quot; here suggests that Sedna is wrong to reject the value (it 
</I>&gt;<i> also suggests that your query is wrong to supply it, but that you 
</I>&gt;<i> should be able to get away with it).
</I>&gt;<i>
</I>&gt;<i> The &quot;algorithm&quot; referred to in this rule is basically the escaping of 
</I>&gt;<i> special characters such as space.
</I>&gt;<i>
</I>&gt;<i> Note that in XSD 1.1, the spec gives up trying to define what's valid 
</I>&gt;<i> in an xs:anyURI and what isn't - all strings are now valid in the 
</I>&gt;<i> lexical space of xs:anyURI.
</I>&gt;<i>
</I>&gt;<i> Michael Kay
</I>&gt;<i> Saxonica
</I>&gt;<i>
</I>&gt;<i> On 19/12/2012 09:11, Robby Pelssers wrote:
</I>&gt;&gt;<i> Hi all,
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> I tested following Xquery with Sedna and Zorba:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> declare function local:getPipUri($id as xs:string) as xs:anyURI {
</I>&gt;&gt;<i>     xs:anyURI(concat(&quot;http://www.nxp.com/pip/&quot;, $id))
</I>&gt;&gt;<i> };
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> local:getPipUri(&quot;CX24483 14LZ&quot;)
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Sedna throws an exception:
</I>&gt;&gt;<i> 2012/12/19 10:07:09 database query/update failed (SEDNA Message: 
</I>&gt;&gt;<i> ERROR FORG0001
</I>&gt;&gt;<i> Invalid value for cast/constructor.
</I>&gt;&gt;<i> Details: The value does not conform to the lexical constraints 
</I>&gt;&gt;<i> defined for the xs:anyURI type.
</I>&gt;&gt;<i> Query line: 6, column:4
</I>&gt;&gt;<i> )
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> http://www.zorba-xquery.com/html/demo happy returns 
</I>&gt;&gt;<i> &quot;http://www.nxp.com/pip/CX24483 14LZ&quot;
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> So how does the xs:anyURI cast work? Is the developer supposed to 
</I>&gt;&gt;<i> encode the String before passing it to xs:anyURI or is the anyURI 
</I>&gt;&gt;<i> function supposed to do this?
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Thx in advance,
</I>&gt;&gt;<i> Robby
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>


</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004002.html</link><pubDate>Wed, 19 Dec 2012 03:13:00 GMT</pubDate></item><item><title>  The value does not conform to the lexical constraints defined for the xs:anyURI type
   </title><description><![CDATA[<!--beginarticle-->
<PRE>The validation rules for xs:anyURI in the XSD 1.0 specification are 
notoriously troublesome, and it is not surprising that different 
implementors interpret them differently.

This is what XSD 1.0 says:

&lt;quote&gt;
The &#183;lexical space&#183; of anyURI is finite-length character sequences 
which, when the algorithm defined in Section 5.4 of [XML Linking 
Language] is applied to them, result in strings which are legal URIs 
according to [RFC 2396], as amended by [RFC 2732].

Note:  Spaces are, in principle, allowed in the &#183;lexical space&#183; of 
anyURI, however, their use is highly discouraged (unless they are 
encoded by %20).
&lt;/quote&gt;

The &quot;Note&quot; here suggests that Sedna is wrong to reject the value (it 
also suggests that your query is wrong to supply it, but that you should 
be able to get away with it).

The &quot;algorithm&quot; referred to in this rule is basically the escaping of 
special characters such as space.

Note that in XSD 1.1, the spec gives up trying to define what's valid in 
an xs:anyURI and what isn't - all strings are now valid in the lexical 
space of xs:anyURI.

Michael Kay
Saxonica

On 19/12/2012 09:11, Robby Pelssers wrote:
&gt;<i> Hi all,
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> I tested following Xquery with Sedna and Zorba:
</I>&gt;<i>
</I>&gt;<i> declare function local:getPipUri($id as xs:string) as xs:anyURI {
</I>&gt;<i>     xs:anyURI(concat(&quot;http://www.nxp.com/pip/&quot;, $id))
</I>&gt;<i> };
</I>&gt;<i>
</I>&gt;<i> local:getPipUri(&quot;CX24483 14LZ&quot;)
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Sedna throws an exception:
</I>&gt;<i> 2012/12/19 10:07:09 database query/update failed (SEDNA Message: ERROR FORG0001
</I>&gt;<i> Invalid value for cast/constructor.
</I>&gt;<i> Details: The value does not conform to the lexical constraints defined for the xs:anyURI type.
</I>&gt;<i> Query line: 6, column:4
</I>&gt;<i> )
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> http://www.zorba-xquery.com/html/demo happy returns &quot;http://www.nxp.com/pip/CX24483 14LZ&quot;
</I>&gt;<i>
</I>&gt;<i> So how does the xs:anyURI cast work? Is the developer supposed to encode the String before passing it to xs:anyURI or is the anyURI function supposed to do this?
</I>&gt;<i>
</I>&gt;<i> Thx in advance,
</I>&gt;<i> Robby
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004001.html</link><pubDate>Wed, 19 Dec 2012 01:31:29 GMT</pubDate></item><item><title>  The value does not conform to the lexical constraints defined for the xs:anyURI type
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi all,


I tested following Xquery with Sedna and Zorba:

declare function local:getPipUri($id as xs:string) as xs:anyURI {
   xs:anyURI(concat(&quot;http://www.nxp.com/pip/&quot;, $id))
};

local:getPipUri(&quot;CX24483 14LZ&quot;)


Sedna throws an exception:
2012/12/19 10:07:09 database query/update failed (SEDNA Message: ERROR FORG0001
Invalid value for cast/constructor. 
Details: The value does not conform to the lexical constraints defined for the xs:anyURI type.
Query line: 6, column:4
)


http://www.zorba-xquery.com/html/demo happy returns &quot;http://www.nxp.com/pip/CX24483 14LZ&quot;

So how does the xs:anyURI cast work? Is the developer supposed to encode the String before passing it to xs:anyURI or is the anyURI function supposed to do this?

Thx in advance,
Robby

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/004000.html</link><pubDate>Wed, 19 Dec 2012 01:11:55 GMT</pubDate></item><item><title>  Sequence of Nodes Comparison
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
On 05/12/2012 04:59, Kunal Chauhan wrote:
&gt;<i> Hi,
</I>&gt;<i>
</I>&gt;<i> I tried the way you suggest, but it works for me in xquery editor.
</I>&gt;<i> when I integrate it with java it returns true all the time.
</I>&gt;<i>
</I>&gt;<i> don't know why it happens ?
</I>&gt;<i>
</I>Because you are doing something wrong.

If you want help in discovering what you are doing wrong, you will need 
to tell us more precisely what you are doing.

Michael Kay
Saxonica
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/003999.html</link><pubDate>Wed, 05 Dec 2012 00:49:50 GMT</pubDate></item><item><title>  Sequence of Nodes Comparison
   </title><description><![CDATA[<!--beginarticle-->
<PRE>let $i := (&lt;item id=&quot;2&quot;&gt;ABC&lt;/item&gt;, &lt;item id=&quot;2&quot;&gt;DEF&lt;/item&gt;, &lt;item2 
id=&quot;3&quot;&gt;XYZ&lt;/item2&gt;) let $j := (&lt;item id=&quot;2&quot;&gt;DEF&lt;/item&gt;, &lt;item2 
id=&quot;3&quot;&gt;XYZ&lt;/item2&gt;, &lt;item id=&quot;1&quot;&gt;ABC&lt;/item&gt;) return every $x in $i 
satisfies some $y in $j satisfies deep-equal($x, $y) : )

(a) that's O(n^2)

(b) it will return true if the first list is empty and the second 
contains anything at all (or nothing). At the very least you need to 
check the lengths are equal; but even then, there's a potential problem 
with duplicates.

Michael Kay
Saxonica

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/003998.html</link><pubDate>Tue, 04 Dec 2012 07:37:24 GMT</pubDate></item><item><title>  Sequence of Nodes Comparison
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 4 December 2012 15:14, Kunal Chauhan &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Hi,
</I>&gt;<i>
</I>&gt;<i> I want to compare two list of nodes.
</I>&gt;<i> Comparison should be based on QName, attribute and value.
</I>&gt;<i> Node's position is sequence doesn't matter.
</I>&gt;<i>
</I>&gt;<i> for example,
</I>&gt;<i> List A
</I>&gt;<i> &lt;item id=1&gt;ABC&lt;/item&gt;
</I>&gt;<i> &lt;item id=2&gt;DEF&lt;/item&gt;
</I>&gt;<i> &lt;item2 id=3&gt;XYZ&lt;/item2&gt;
</I>&gt;<i>
</I>&gt;<i> List B
</I>&gt;<i> &lt;item id=2&gt;DEF&lt;/item&gt;
</I>&gt;<i> &lt;item2 id=3&gt;XYZ&lt;/item2&gt;
</I>&gt;<i> &lt;item id=1&gt;ABC&lt;/item&gt;
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> When I compare both the lists it should show equal.
</I>

let $i := (&lt;item id=&quot;2&quot;&gt;ABC&lt;/item&gt;,
&lt;item id=&quot;2&quot;&gt;DEF&lt;/item&gt;,
&lt;item2 id=&quot;3&quot;&gt;XYZ&lt;/item2&gt;)

let $j := (&lt;item id=&quot;2&quot;&gt;DEF&lt;/item&gt;,
&lt;item2 id=&quot;3&quot;&gt;XYZ&lt;/item2&gt;,
&lt;item id=&quot;1&quot;&gt;ABC&lt;/item&gt;)

return every $x in $i satisfies some $y in $j satisfies deep-equal($x, $y)

:<i> )
</I>


-- 
Andrew Welch
http://andrewjwelch.com
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201212/003997.html</link><pubDate>Tue, 04 Dec 2012 07:26:37 GMT</pubDate></item><item><title>  [ANN] RXQ v0.1 - RESTful MVC with XQuery 3.0 annotations for MarkLogic
   </title><description><![CDATA[<!--beginarticle-->
<PRE>..great news, thanks for the links!
Christian
___________________________

&gt;<i> having fun with Adam Retter's RESTXQ
</I>&gt;<i>
</I>&gt;<i> src at https://github.com/xquery/rxq
</I>&gt;<i>
</I>&gt;<i> -Jim Fuller
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I></PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003996.html</link><pubDate>Sun, 28 Oct 2012 12:26:39 GMT</pubDate></item><item><title>  [ANN] RXQ v0.1 - RESTful MVC with XQuery 3.0	annotations for MarkLogic
   </title><description><![CDATA[<!--beginarticle-->
<PRE>having fun with Adam Retter's RESTXQ

src at https://github.com/xquery/rxq

-Jim Fuller
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003995.html</link><pubDate>Sun, 28 Oct 2012 12:23:40 GMT</pubDate></item><item><title>  exist xquery search
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;<i>Also the
</I>&gt;<i> performance is really bad.
</I>
Your query can be made much more efficient yet.

&gt;<i> I haven't fully done an index of the exist-db yet.
</I>
Indexes made a huge difference in eXist, but you need to get your
query correct first, so that you know which indexes you need.

-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003994.html</link><pubDate>Thu, 25 Oct 2012 05:26:22 GMT</pubDate></item><item><title>  exist xquery search
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Im not quite sure what the context of your query is, but this really
does not look right to me. I would try inverting the order of
execution, you can often use the set operators like union or intersect
to bring together faceted queries -

e.g.

let $base := if($person) then
//foo/bar[contributions/person/@val = $person]
else
//foo/bar
return

let $next := if($other) then
//foo/bar[other = $other]
else
//foo/bar
return

subsequence($base intersect $next, $off, $num)

Another option is actually to build your predicates as a string using
concatenation, and then use util:eval to evaluate the query.


On 25 October 2012 12:37, Michael Jones &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Hi,
</I>&gt;<i>
</I>&gt;<i> I'm trying to write a faceted search with exist and xquery. What I have so
</I>&gt;<i> far is:
</I>&gt;<i>
</I>&gt;<i> xquery version &quot;1.0&quot;;
</I>&gt;<i> declare namespace request=&quot;http://exist-db.org/xquery/request&quot;;
</I>&gt;<i> declare namespace xs=&quot;http://www.w3.org/2001/XMLSchema&quot;;
</I>&gt;<i> declare option exist:serialize &quot;method=xml media-type=text/xml
</I>&gt;<i> omit-xml-declaration=no indent=yes&quot;;
</I>&gt;<i>
</I>&gt;<i> let $label:= request:get-parameter(&quot;l&quot;,'0')
</I>&gt;<i> let $dateTo:= request:get-parameter(&quot;dt&quot;,'0')
</I>&gt;<i> let $dateFrom := request:get-parameter(&quot;df&quot;,'0')
</I>&gt;<i> let $person := request:get-parameter(&quot;p&quot;,'0')
</I>&gt;<i> let $officesHeld := request:get-parameter(&quot;o&quot;,'0')
</I>&gt;<i> let $off := request:get-parameter(&quot;off&quot;,'0')
</I>&gt;<i> let $num := request:get-parameter(&quot;num&quot;,'10')
</I>&gt;<i>
</I>&gt;<i> return
</I>&gt;<i> &lt;xml&gt;
</I>&gt;<i> {
</I>&gt;<i> subsequence(//foo/bar[
</I>&gt;<i>
</I>&gt;<i> (: label :)
</I>&gt;<i>   (if ($label = '0')
</I>&gt;<i>   then (
</I>&gt;<i>   *
</I>&gt;<i> )else(
</I>&gt;<i> label/@val = $label
</I>&gt;<i> ))
</I>&gt;<i>
</I>&gt;<i> and
</I>&gt;<i> (: person :)
</I>&gt;<i> (if ($person = '0')
</I>&gt;<i> then (
</I>&gt;<i>   *
</I>&gt;<i>   )else(
</I>&gt;<i>   contributions/person/@val = $person
</I>&gt;<i>   ))
</I>&gt;<i> and
</I>&gt;<i> (: offices held :)
</I>&gt;<i> (if ($officesHeld = '0')
</I>&gt;<i> then (
</I>&gt;<i>   *
</I>&gt;<i>   )else(
</I>&gt;<i>   contributions/offices_held/@val = $officesHeld
</I>&gt;<i>   ))
</I>&gt;<i>   ],$off,$num)
</I>&gt;<i> }
</I>&gt;<i> &lt;/xml&gt;
</I>&gt;<i>
</I>&gt;<i> On my local machine this runs fine but on my server I get FORG0001:
</I>&gt;<i> xs:string(0) is not a sub-type of xs:double [at line 18, column 9]. Also the
</I>&gt;<i> performance is really bad. Is there a better way to do a faceted search? I
</I>&gt;<i> want to say, if there is a parameter in the URL that matches $person then
</I>&gt;<i> search for a person that matches something similar to the value of the
</I>&gt;<i> person element. And if the parameter isn't in the url don't search for it,
</I>&gt;<i> the way I thought about getting around that is by putting in *, and then
</I>&gt;<i> building up a search query based on that. But this seems really inefficient.
</I>&gt;<i> I haven't fully done an index of the exist-db yet. But can anyone see a
</I>&gt;<i> better way to do this search?
</I>&gt;<i>
</I>&gt;<i> Thanks
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>


-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003993.html</link><pubDate>Thu, 25 Oct 2012 05:24:20 GMT</pubDate></item><item><title>  moving an element from last child to next sibling
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
&gt;<i> Now I wonder whether something like this is feasible using xquery 3.0 
</I>&gt;<i> features.  Maybe not worth the effort, given the existence of xslt, 
</I>&gt;<i> but at least you could imagine defining a map of XPath to function, 
</I>&gt;<i> iterating over a tree, matching patterns and calling functions...
</I>&gt;<i>
</I>I think that with maps* and higher-order functions you could do 
something quite powerful; however the resulting code might be very 
cryptic to the uninitiated.

* Sadly, maps are not in XQuery 3.0, though John Snelson has shown how 
they can be implemented using higher-order functions...

Michael Kay
Saxonica


</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003992.html</link><pubDate>Wed, 24 Oct 2012 00:43:14 GMT</pubDate></item><item><title>  moving an element from last child to next sibling
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 10/23/2012 10:02 AM, David Sewell wrote:
&gt;<i>
</I>&gt;<i> Speaking as someone who wrote a lot of pseudo-templates in XQuery 
</I>&gt;<i> before MarkLogic added an XSLT 2.0 parser to their product, this is 
</I>&gt;<i> one area where XSLT is a lot more pleasant to use, if that's a 
</I>&gt;<i> possibility.
</I>&gt;<i>
</I>&gt;<i> David
</I>Hear, hear - we abandoned using xquery for transformations as well for 
that reason.

When I was still struggling with that, I found myself trying to write a 
pattern-matching system (basically something like xslt implemented in 
xquery), but it was too difficult in XQuery 1.0.

Now I wonder whether something like this is feasible using xquery 3.0 
features.  Maybe not worth the effort, given the existence of xslt, but 
at least you could imagine defining a map of XPath to function, 
iterating over a tree, matching patterns and calling functions...

-Mike
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003991.html</link><pubDate>Tue, 23 Oct 2012 19:30:20 GMT</pubDate></item><item><title>  moving an element from last child to next sibling
   </title><description><![CDATA[<!--beginarticle-->
<PRE>There are at least a couple of different approaches to this via the typeswitch 
strategy, but I think the simplest would be:

1. In your function for closer, recurse over the child nodes as usual (which I 
assume will output a &lt;closer&gt; element, or whatever you transform it to), then 
process your postscript children:

    for $ps in $node/tei:postscript
    return &lt;postscript&gt;{$ps/@*, eccoparse:recurse($ps)}&lt;/postscript&gt;

2. Extend your postscript function so it returns null if the postscript is a 
child of &lt;closer&gt;:

    declare function eccoparse:postscript($node as element(tei:postscript)) as
    element()*
    {
      if ($node/parent::tei:closer) then ()
      else &lt;postscript&gt;{$node/@*}{eccoparse:recurse($node)}&lt;/postscript&gt;
    }

Speaking as someone who wrote a lot of pseudo-templates in XQuery before 
MarkLogic added an XSLT 2.0 parser to their product, this is one area where XSLT 
is a lot more pleasant to use, if that's a possibility.

David

On Tue, 23 Oct 2012, Martin Mueller wrote:

&gt;<i> I have used the xquery typeswitch function to transform elements from a TEI
</I>&gt;<i> file, but I am stymied by a task involving the following fragment:
</I>&gt;<i>
</I>&gt;<i>    &lt;closer&gt;
</I>&gt;<i>               &lt;signed&gt;Your ever affectionate WOODVILLE.&lt;/signed&gt;
</I>&gt;<i>               &lt;postscript&gt;
</I>&gt;<i>                  &lt;p&gt;P.S. You have a house, within a mile of York; where we
</I>&gt;<i> have spent many happy days&#8212;&lt;q rend=&quot;inline&quot;&gt;&quot;Days of ease, and nights of
</I>&gt;<i> pleasure.&quot;&lt;/q&gt; Who knows but we may there recover our juve&#8209;nile tastes and
</I>&gt;<i> passions! impossible! As well when advanced in life, might we hope to
</I>&gt;<i> reco&#8209;ver our youth, &lt;hi&gt;in those fields where we once were young.&lt;/hi&gt;&#8212;But
</I>&gt;<i> is that house untenanted? Will you be our host? Or have you lett, or lent
</I>&gt;<i> it?&lt;/p&gt;
</I>&gt;<i>               &lt;/postscript&gt;
</I>&gt;<i>            &lt;/closer&gt;
</I>&gt;<i>
</I>&gt;<i> I want to move the &lt;postscript&gt; element from its position as the last child
</I>&gt;<i> of &lt;closer&gt; into the position of right sibling of &lt;closer&gt; so that the
</I>&gt;<i> desire output would look like this:
</I>&gt;<i>
</I>&gt;<i> &lt;closer&gt;
</I>&gt;<i>           &lt;signed&gt;Your ever affectionate WOODVILLE.&lt;/signed&gt;
</I>&gt;<i>
</I>&gt;<i> &lt;/closer&gt;
</I>&gt;<i> &lt;postscript&gt;
</I>&gt;<i>                  &lt;p&gt;P.S. You have a house, within a mile of York; where we
</I>&gt;<i> have spent many happy days&#8212;&lt;q rend=&quot;inline&quot;&gt;&quot;Days of ease, and nights of
</I>&gt;<i> pleasure.&quot;&lt;/q&gt; Who knows but we may there recover our juve&#8209;nile tastes and
</I>&gt;<i> passions! impossible! As well when advanced in life, might we hope to
</I>&gt;<i> reco&#8209;ver our youth, &lt;hi&gt;in those fields where we once were young.&lt;/hi&gt;&#8212;But
</I>&gt;<i> is that house untenanted? Will you be our host? Or have you lett, or lent
</I>&gt;<i> it?&lt;/p&gt;
</I>&gt;<i> &lt;/postscript&gt;
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> How do I do this? In a typeswitch function the different tasks relating to
</I>&gt;<i> elements are carried out by subsidiary function. Here is the postscript
</I>&gt;<i> function that simply passes through the element:
</I>&gt;<i>
</I>&gt;<i> declare function eccoparse:postscript($node as element(tei:postscript)) as
</I>&gt;<i> element()
</I>&gt;<i> {
</I>&gt;<i> &lt;postscript&gt;{$node/@*}{eccoparse:recurse($node)}&lt;/postscript&gt;
</I>&gt;<i> };
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> I know how to various things that would change the postscript element but
</I>&gt;<i> leave it in its current place. But how do I put it in another place without
</I>&gt;<i> changing anything in it?  Is this a task that should be done at the level of
</I>&gt;<i> the parent element?
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> I'll be grateful for any advice.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Martin Mueller
</I>&gt;<i>
</I>&gt;<i> Professor emeritus of English and Classics
</I>&gt;<i>
</I>&gt;<i> Northwestern University
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>
-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: http://x-query.com/mailman/listinfo/talk   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003990.html</link><pubDate>Tue, 23 Oct 2012 07:02:06 GMT</pubDate></item><item><title>  moving an element from last child to next sibling
   </title><description><![CDATA[<!--beginarticle-->
<PRE>I have used the xquery typeswitch function to transform elements from a TEI
file, but I am stymied by a task involving the following fragment:

    &lt;closer&gt;
               &lt;signed&gt;Your ever affectionate WOODVILLE.&lt;/signed&gt;
               &lt;postscript&gt;
                  &lt;p&gt;P.S. You have a house, within a mile of York; where we
have spent many happy days&#8212;&lt;q rend=&quot;inline&quot;&gt;&quot;Days of ease, and nights of
pleasure.&quot;&lt;/q&gt; Who knows but we may there recover our juve&#8209;nile tastes and
passions! impossible! As well when advanced in life, might we hope to
reco&#8209;ver our youth, &lt;hi&gt;in those fields where we once were young.&lt;/hi&gt;&#8212;But
is that house untenanted? Will you be our host? Or have you lett, or lent
it?&lt;/p&gt;
               &lt;/postscript&gt;
            &lt;/closer&gt;

I want to move the &lt;postscript&gt; element from its position as the last child
of &lt;closer&gt; into the position of right sibling of &lt;closer&gt; so that the
desire output would look like this:

 &lt;closer&gt;
           &lt;signed&gt;Your ever affectionate WOODVILLE.&lt;/signed&gt;
               
 &lt;/closer&gt;
&lt;postscript&gt;
                  &lt;p&gt;P.S. You have a house, within a mile of York; where we
have spent many happy days&#8212;&lt;q rend=&quot;inline&quot;&gt;&quot;Days of ease, and nights of
pleasure.&quot;&lt;/q&gt; Who knows but we may there recover our juve&#8209;nile tastes and
passions! impossible! As well when advanced in life, might we hope to
reco&#8209;ver our youth, &lt;hi&gt;in those fields where we once were young.&lt;/hi&gt;&#8212;But
is that house untenanted? Will you be our host? Or have you lett, or lent
it?&lt;/p&gt;
&lt;/postscript&gt;


How do I do this? In a typeswitch function the different tasks relating to
elements are carried out by subsidiary function. Here is the postscript
function that simply passes through the element:

declare function eccoparse:postscript($node as element(tei:postscript)) as
element() 
{
&lt;postscript&gt;{$node/@*}{eccoparse:recurse($node)}&lt;/postscript&gt;
};



I know how to various things that would change the postscript element but
leave it in its current place. But how do I put it in another place without
changing anything in it?  Is this a task that should be done at the level of
the parent element?



I'll be grateful for any advice.





Martin Mueller

Professor emeritus of English and Classics

Northwestern University




-------------- next part --------------
An HTML attachment was scrubbed...
URL: &lt;http://x-query.com/pipermail/talk/attachments/20121023/aeef61ca/attachment.html&gt;
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003989.html</link><pubDate>Tue, 23 Oct 2012 06:36:41 GMT</pubDate></item><item><title>  Invitation to connect on LinkedIn
   </title><description><![CDATA[<!--beginarticle-->
<PRE>LinkedIn
------------



I'd like to add you to my professional network on LinkedIn.

- Naveen

Naveen Hanumara
Software Developer at Detica
London, United Kingdom

Confirm that you know Naveen Hanumara:
https://www.linkedin.com/e/vuwohj-h8hgff4f-3o/isd/9161410241/uQwFakjN/?hs=false&amp;tok=1xEmtoYKixvls1

--
You are receiving Invitation to Connect emails. Click to unsubscribe:
http://www.linkedin.com/e/vuwohj-h8hgff4f-3o/uDkLrgTRH42D5Lxbr_d17aeXvE/goo/talk%40xquery%2Ecom/20061/I3065200479_1/?hs=false&amp;tok=0hRZBjI-axvls1

(c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: &lt;http://x-query.com/pipermail/talk/attachments/20121019/8b3bb98b/attachment.html&gt;
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003988.html</link><pubDate>Fri, 19 Oct 2012 08:29:26 GMT</pubDate></item><item><title>  deduplicating information in XML files
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi,

I'm currently trying out a pure XSLT solution.  As an add-on, I'd like to mention I like where Zorba is going although I did not have the time to use it yet. I really need to take a closer look once I have time at the documentation.  

Thx for the tip by the way.

Robby

-----Original Message-----
From: Helena Galhardas [mailto:http://x-query.com/mailman/listinfo/talk] 
Sent: Wednesday, October 17, 2012 12:19 PM
To: Robby Pelssers
Cc: http://x-query.com/mailman/listinfo/talk; xquery-discuss; Bruno Martins; Daniela Florescu
Subject: Re:  deduplicating information in XML files

Dear Robby,

Zorba XQuery processor currently supports a data cleaning module (look for data cleaning in http://www.zorba-xquery.com/html/modules)
that we may want to try.

In principle, the requirements associated to your data de-duplication problem can be addressed by writing an XQuery program that invokes some of the functions available in this data cleaning module.

We would appreciate your feedback if you decide to do so and please let us know if we can help somehow.

Thanks.
Best Regards,
Helena Galhardas

On Oct 12, 2012, at 1:02 PM, Robby Pelssers wrote:

&gt;<i> Hi all,
</I>&gt;<i> 
</I>&gt;<i> This time I have a rather challenging task at hand.  Let me first 
</I>&gt;<i> describe the use case.  We have lots of product information stored in 
</I>&gt;<i> XML.  Some of that information describes . Technical applications . 
</I>&gt;<i> Features and benefits . Technical summary
</I>&gt;<i> 
</I>&gt;<i> One of the problems is a lot of products had e.g. the same features 
</I>&gt;<i> and benefits as they are of the same product family or group.  But as 
</I>&gt;<i> we stored that info per product it got duplicated.  Now we want to 
</I>&gt;<i> deduplicate that info by generating DITA maps and topics (both are 
</I>&gt;<i> just XML).  Now for simplicity let's assume we generate the following 
</I>&gt;<i> content for product1 and product2.  The goal is to get from INPUT to 
</I>&gt;<i> OUTPUT by checking if the body of the linked topics are duplicates, 
</I>&gt;<i> next create 1 generic topic and rewrite the links in the map to  point 
</I>&gt;<i> to that single topic.  I have XSLT / XQuery (XMLDB) and Java at my 
</I>&gt;<i> disposal to get the job done.  I'm not sure what will be the easiest 
</I>&gt;<i> way to get the job done.  Keep also in mind that my INPUT will contain 
</I>&gt;<i> a few 1000 files (maps and linked topics) and I will need to 
</I>&gt;<i> deduplicate the whole set ;-)
</I>&gt;<i> 
</I>&gt;<i> Thx upfront for any input,
</I>&gt;<i> Robby
</I>&gt;<i> 
</I>&gt;<i> INPUT
</I>&gt;<i> 
</I>&gt;<i> Product1_map.xml
</I>&gt;<i> &lt;map&gt;
</I>&gt;<i>   &lt;features-benefits-ref href=&quot;features-benefits/Product1_FandB.xml 
</I>&gt;<i> &quot;/&gt; &lt;/map&gt;
</I>&gt;<i> 
</I>&gt;<i> Product1_FandB.xml:
</I>&gt;<i> &lt;content&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>     &lt;id&gt;product1&lt;/id&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for high frequency applications due to fast switching characteristics&lt;/p&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for logic level gate drive sources&lt;/p&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i> &lt;/content&gt;
</I>&gt;<i> 
</I>&gt;<i> Product2_map.xml
</I>&gt;<i> &lt;map&gt;
</I>&gt;<i>   &lt;features-benefits-ref href=&quot;features-benefits/Product2_FandB.xml 
</I>&gt;<i> &quot;/&gt; &lt;/map&gt;
</I>&gt;<i> 
</I>&gt;<i> Product2_FandB.xml:
</I>&gt;<i> &lt;content&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>     &lt;id&gt;product2&lt;/id&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for high frequency applications due to fast switching characteristics&lt;/p&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for logic level gate drive sources&lt;/p&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i> &lt;/content&gt;
</I>&gt;<i> 
</I>&gt;<i> Expected output:
</I>&gt;<i> 
</I>&gt;<i> Product1_map.xml
</I>&gt;<i> &lt;map&gt;
</I>&gt;<i>   &lt;features-benefits-ref href=&quot;features-benefits/FandB_1.xml &quot;/&gt; 
</I>&gt;<i> &lt;/map&gt;
</I>&gt;<i> 
</I>&gt;<i> Product2_map.xml
</I>&gt;<i> &lt;map&gt;
</I>&gt;<i>   &lt;features-benefits-ref href=&quot;features-benefits/FandB_1.xml &quot;/&gt; 
</I>&gt;<i> &lt;/map&gt;
</I>&gt;<i> 
</I>&gt;<i> FandB_1.xml:
</I>&gt;<i> &lt;content&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>     &lt;id&gt;&lt;!- can become empty  -&gt; &lt;/id&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for high frequency applications due to fast switching characteristics&lt;/p&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for logic level gate drive sources&lt;/p&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i> &lt;/content&gt;
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003987.html</link><pubDate>Fri, 19 Oct 2012 04:05:55 GMT</pubDate></item><item><title>  deduplicating information in XML files
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Dear Robby,

Zorba XQuery processor currently supports a data cleaning module 
(look for data cleaning in http://www.zorba-xquery.com/html/modules)
that we may want to try.

In principle, the requirements associated to your data de-duplication problem can be 
addressed by writing an XQuery program that invokes some of the functions available
in this data cleaning module.

We would appreciate your feedback if you decide to do so and please let us know if we
can help somehow.

Thanks.
Best Regards,
Helena Galhardas

On Oct 12, 2012, at 1:02 PM, Robby Pelssers wrote:

&gt;<i> Hi all,
</I>&gt;<i> 
</I>&gt;<i> This time I have a rather challenging task at hand.  Let me first describe the use case.  We have lots of product information stored in XML.  Some of that information describes 
</I>&gt;<i> . Technical applications
</I>&gt;<i> . Features and benefits
</I>&gt;<i> . Technical summary
</I>&gt;<i> 
</I>&gt;<i> One of the problems is a lot of products had e.g. the same features and benefits as they are of the same product family or group.  But as we stored that info per product it got duplicated.  Now we want to deduplicate that info by generating DITA maps and topics (both are just XML).  Now for simplicity let's assume we generate the following content for product1 and product2.  The goal is to get from INPUT to OUTPUT by checking if the body of the linked topics are duplicates, next create 1 generic topic and rewrite the links in the map to  point to that single topic.  I have XSLT / XQuery (XMLDB) and Java at my disposal to get the job done.  I'm not sure what will be the easiest way to get the job done.  Keep also in mind that my INPUT will contain a few 1000 files (maps and linked topics) and I will need to deduplicate the whole set ;-)
</I>&gt;<i> 
</I>&gt;<i> Thx upfront for any input,
</I>&gt;<i> Robby  
</I>&gt;<i> 
</I>&gt;<i> INPUT
</I>&gt;<i> 
</I>&gt;<i> Product1_map.xml
</I>&gt;<i> &lt;map&gt;
</I>&gt;<i>   &lt;features-benefits-ref href=&quot;features-benefits/Product1_FandB.xml &quot;/&gt;
</I>&gt;<i> &lt;/map&gt;
</I>&gt;<i> 
</I>&gt;<i> Product1_FandB.xml:
</I>&gt;<i> &lt;content&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>     &lt;id&gt;product1&lt;/id&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for high frequency applications due to fast switching characteristics&lt;/p&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for logic level gate drive sources&lt;/p&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i> &lt;/content&gt;
</I>&gt;<i> 
</I>&gt;<i> Product2_map.xml
</I>&gt;<i> &lt;map&gt;
</I>&gt;<i>   &lt;features-benefits-ref href=&quot;features-benefits/Product2_FandB.xml &quot;/&gt;
</I>&gt;<i> &lt;/map&gt;
</I>&gt;<i> 
</I>&gt;<i> Product2_FandB.xml:
</I>&gt;<i> &lt;content&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>     &lt;id&gt;product2&lt;/id&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for high frequency applications due to fast switching characteristics&lt;/p&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for logic level gate drive sources&lt;/p&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i> &lt;/content&gt;
</I>&gt;<i> 
</I>&gt;<i> Expected output:
</I>&gt;<i> 
</I>&gt;<i> Product1_map.xml
</I>&gt;<i> &lt;map&gt;
</I>&gt;<i>   &lt;features-benefits-ref href=&quot;features-benefits/FandB_1.xml &quot;/&gt;
</I>&gt;<i> &lt;/map&gt;
</I>&gt;<i> 
</I>&gt;<i> Product2_map.xml
</I>&gt;<i> &lt;map&gt;
</I>&gt;<i>   &lt;features-benefits-ref href=&quot;features-benefits/FandB_1.xml &quot;/&gt;
</I>&gt;<i> &lt;/map&gt;
</I>&gt;<i> 
</I>&gt;<i> FandB_1.xml:
</I>&gt;<i> &lt;content&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>     &lt;id&gt;&lt;!- can become empty  -&gt; &lt;/id&gt;
</I>&gt;<i>   &lt;meta&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for high frequency applications due to fast switching characteristics&lt;/p&gt;
</I>&gt;<i>     &lt;p&gt;Suitable for logic level gate drive sources&lt;/p&gt;
</I>&gt;<i>   &lt;body&gt;
</I>&gt;<i> &lt;/content&gt;
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003986.html</link><pubDate>Wed, 17 Oct 2012 03:18:36 GMT</pubDate></item><item><title>  deduplicating information in XML files
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi all,

This time I have a rather challenging task at hand. &#160;Let me first describe the use case.&#160; We have lots of product information stored in XML.&#160; Some of that information describes 
. Technical applications
. Features and benefits
. Technical summary

One of the problems is a lot of products had e.g. the same features and benefits as they are of the same product family or group.&#160; But as we stored that info per product it got duplicated.&#160; Now we want to deduplicate that info by generating DITA maps and topics (both are just XML).&#160; Now for simplicity let's assume we generate the following content for product1 and product2.&#160; The goal is to get from INPUT to OUTPUT by checking if the body of the linked topics are duplicates, next create 1 generic topic and rewrite the links in the map to&#160; point to that single topic.&#160; I have XSLT / XQuery (XMLDB) and Java at my disposal to get the job done.&#160; I'm not sure what will be the easiest way to get the job done. &#160;Keep also in mind that my INPUT will contain a few 1000 files (maps and linked topics) and I will need to deduplicate the whole set ;-)

Thx upfront for any input,
Robby &#160;

INPUT

Product1_map.xml
&lt;map&gt;
&#160; &lt;features-benefits-ref href=&quot;features-benefits/Product1_FandB.xml &quot;/&gt;
&lt;/map&gt;

Product1_FandB.xml:
&lt;content&gt;
&#160; &lt;meta&gt;
&#160;&#160;&#160; &lt;id&gt;product1&lt;/id&gt;
&#160; &lt;meta&gt;
&#160; &lt;body&gt;
&#160;&#160;&#160; &lt;p&gt;Suitable for high frequency applications due to fast switching characteristics&lt;/p&gt;
&#160;&#160;&#160; &lt;p&gt;Suitable for logic level gate drive sources&lt;/p&gt;
&#160; &lt;body&gt;
&lt;/content&gt;

Product2_map.xml
&lt;map&gt;
&#160; &lt;features-benefits-ref href=&quot;features-benefits/Product2_FandB.xml &quot;/&gt;
&lt;/map&gt;

Product2_FandB.xml:
&lt;content&gt;
&#160; &lt;meta&gt;
&#160;&#160;&#160; &lt;id&gt;product2&lt;/id&gt;
&#160; &lt;meta&gt;
&#160; &lt;body&gt;
&#160;&#160;&#160; &lt;p&gt;Suitable for high frequency applications due to fast switching characteristics&lt;/p&gt;
&#160;&#160;&#160; &lt;p&gt;Suitable for logic level gate drive sources&lt;/p&gt;
&#160; &lt;body&gt;
&lt;/content&gt;

Expected output:

Product1_map.xml
&lt;map&gt;
&#160; &lt;features-benefits-ref href=&quot;features-benefits/FandB_1.xml &quot;/&gt;
&lt;/map&gt;

Product2_map.xml
&lt;map&gt;
&#160; &lt;features-benefits-ref href=&quot;features-benefits/FandB_1.xml &quot;/&gt;
&lt;/map&gt;

FandB_1.xml:
&lt;content&gt;
&#160; &lt;meta&gt;
&#160;&#160;&#160; &lt;id&gt;&lt;!- can become empty &#160;-&gt; &lt;/id&gt;
&#160; &lt;meta&gt;
&#160; &lt;body&gt;
&#160;&#160;&#160; &lt;p&gt;Suitable for high frequency applications due to fast switching characteristics&lt;/p&gt;
&#160;&#160;&#160; &lt;p&gt;Suitable for logic level gate drive sources&lt;/p&gt;
&#160; &lt;body&gt;
&lt;/content&gt;


</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003985.html</link><pubDate>Fri, 12 Oct 2012 05:02:40 GMT</pubDate></item><item><title>  [ANN] XML Prague 2013 Call for Papers
   </title><description><![CDATA[<!--beginarticle-->
<PRE>XML Prague 2013 is now welcoming submissions for presentations on the
following topics:

    Digital books and publishing: The role of XML in single-source
publishing in the era of tablets, smart phones, and eBook readers.
    Semantic web: Beyond mere structures. Expressing semantics in data
formats and communication protocols.
    XML vocabularies: A deep dive into industry specific usage of XML.
    XML efficiency: High-speed processing, compact serialization and
storage, processing of big data volumes.
    XML birthday: Do we need new syntax, data model or both or is XML
just fine after 15 years?

For more information on CFP

    http://www.xmlprague.cz/call-for-papers/


on behalf,
     XML Prague Committee 2013

--
--
XMLPrague 2013, Feb 8-10    &lt;http://xmlprague.cz&gt;

Sponsored by
&lt;oXygen/&gt; XML editor &lt;http://oxygenxml.com&gt;
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003984.html</link><pubDate>Wed, 10 Oct 2012 03:42:45 GMT</pubDate></item><item><title>  incorrect syntax?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Do I sense an International Obfuscated XQuery Code Contest [1] [2] in 
the offing?

-- Ron

[1] http://www.ioccc.org/
[2] http://en.wikipedia.org/wiki/International_Obfuscated_C_Code_Contest

On 10/2/2012 1:38 AM, Andrew Welch wrote:
&gt;<i> On 2 October 2012 09:30, David Carlisle&lt;http://x-query.com/mailman/listinfo/talk&gt;  wrote:
</I>&gt;&gt;<i> On 02/10/2012 08:56, Andrew Welch wrote:
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> ha that's great (if a little contrived):
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> declare default function namespace &quot;x&quot;;
</I>&gt;&gt;&gt;<i> declare function return ($x) { $x+1 };
</I>&gt;&gt;&gt;<i> return (23)
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> returns 24
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Yes that is contrived, I think it's clearer if you write it like this
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> declare default function namespace &quot;return&quot;;
</I>&gt;&gt;<i> declare variable $return := 23;
</I>&gt;&gt;<i> declare function return ($return) { $return+1 };
</I>&gt;&gt;<i> return ($return)
</I>&gt;<i>
</I>&gt;<i> That is indeed much clearer, thanks David.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> ;)
</I>&gt;<i>
</I>&gt;<i>
</I></PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003983.html</link><pubDate>Tue, 02 Oct 2012 08:51:12 GMT</pubDate></item><item><title>  incorrect syntax?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 2 October 2012 09:30, David Carlisle &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> On 02/10/2012 08:56, Andrew Welch wrote:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> ha that's great (if a little contrived):
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> declare default function namespace &quot;x&quot;;
</I>&gt;&gt;<i> declare function return ($x) { $x+1 };
</I>&gt;&gt;<i> return (23)
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> returns 24
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Yes that is contrived, I think it's clearer if you write it like this
</I>&gt;<i>
</I>&gt;<i> declare default function namespace &quot;return&quot;;
</I>&gt;<i> declare variable $return := 23;
</I>&gt;<i> declare function return ($return) { $return+1 };
</I>&gt;<i> return ($return)
</I>
That is indeed much clearer, thanks David.


;)


-- 
Andrew Welch
http://andrewjwelch.com
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003982.html</link><pubDate>Tue, 02 Oct 2012 01:38:30 GMT</pubDate></item><item><title>  incorrect syntax?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 02/10/2012 08:56, Andrew Welch wrote:
&gt;<i> ha that's great (if a little contrived):
</I>&gt;<i>
</I>&gt;<i> declare default function namespace &quot;x&quot;;
</I>&gt;<i> declare function return ($x) { $x+1 };
</I>&gt;<i> return (23)
</I>&gt;<i>
</I>&gt;<i> returns 24
</I>
Yes that is contrived, I think it's clearer if you write it like this

declare default function namespace &quot;return&quot;;
declare variable $return := 23;
declare function return ($return) { $return+1 };
return ($return)

________________________________________________________________________
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. 
________________________________________________________________________
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003981.html</link><pubDate>Tue, 02 Oct 2012 01:30:07 GMT</pubDate></item><item><title>  incorrect syntax?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;<i> But if you say
</I>&gt;<i>
</I>&gt;<i> declare default function namespace &quot;x&quot;;
</I>&gt;<i> declare function return ($x) { $x+1 };
</I>&gt;<i> return (23)
</I>&gt;<i>
</I>&gt;<i> that does seem to return 24 for at least one processor that I tried, which
</I>&gt;<i> seems truly bizarre (to me, anyway)
</I>
ha that's great (if a little contrived):

declare default function namespace &quot;x&quot;;
declare function return ($x) { $x+1 };
return (23)

returns 24

but add a let:

declare default function namespace &quot;x&quot;;
declare function return ($x) { $x+1 };
let $foo := 1
return (23)

returns 23

(tested using Saxon HE 9.3.0.5.)
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003980.html</link><pubDate>Tue, 02 Oct 2012 00:56:32 GMT</pubDate></item><item><title>  incorrect syntax?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 10/1/2012 7:22 PM, Michael Sokolov wrote:
&gt;<i> Sorry, I think I neglected to include a let before a couple of the
</I>&gt;<i> returns.
</I>
I thought that might be the case.

&gt;<i> But my main point was the unusual (and probably unfamiliar to
</I>&gt;<i> people used to other languages) change in the interpretation of
</I>&gt;<i> parentheses when they follow the return keyword and when they follow the
</I>&gt;<i> return function.
</I>
That is confusing.

The other thing that confuses people is that functions don't use the 
&quot;return&quot; keyword and instead just return the result of evaluating the 
contained expression.

&gt;<i> Admittedly the idea of defining a function with the same name as a
</I>&gt;<i> keyword is contrived and ill-advised, right up there with C++ operator
</I>&gt;<i> overloading. It just occurred to me on reading Michael Kay's comment
</I>&gt;<i> 'There is no function called &quot;return&quot;' that there actually could be one.
</I>
Agreed.

-- Ron
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003979.html</link><pubDate>Mon, 01 Oct 2012 21:11:32 GMT</pubDate></item><item><title>  incorrect syntax?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Sorry, I think I neglected to include a let before a couple of the 
returns.  But my main point was the unusual (and probably unfamiliar to 
people used to other languages) change in the interpretation of 
parentheses when they follow the return keyword and when they follow the 
return function.

Admittedly the idea of defining a function with the same name as a 
keyword is contrived and ill-advised, right up there with C++ operator 
overloading.  It just occurred to me on reading Michael Kay's comment 
'There is no function called &quot;return&quot;' that there actually could be one.

Mike Sokolov

On 10/1/2012 8:55 PM, Ronald Bourret wrote:
&gt;<i> This is actually very straightforward. &quot;return&quot; is a keyword, used in 
</I>&gt;<i> FLWOR expressions and a few other places. There is no standalone 
</I>&gt;<i> &quot;return&quot; in XQuery. Thus:
</I>&gt;<i>
</I>&gt;<i>    let $x:=0 return (23)
</I>&gt;<i>
</I>&gt;<i> is a valid (if uninteresting) FLWOR expression that is equivalent to 
</I>&gt;<i> the even less interesting (but still valid) expression:
</I>&gt;<i>
</I>&gt;<i>    (23)
</I>&gt;<i>
</I>&gt;<i> And a standalone &quot;return&quot; is illegal:
</I>&gt;<i>
</I>&gt;<i>    return (23) (: error :)
</I>&gt;<i>
</I>&gt;<i> Where you have included parentheses below, you are calling a function 
</I>&gt;<i> named &quot;return&quot; and XQuery works as expected. It's a bad idea to name a 
</I>&gt;<i> function using a keyword as a name, but XQuery allows it. If you 
</I>&gt;<i> replace &quot;return(...)&quot; with &quot;foo(...)&quot; in the expressions below, the 
</I>&gt;<i> intended meaning will be clear.
</I>&gt;<i>
</I>&gt;<i> The last two XQuery expressions should return errors (and do in the 
</I>&gt;<i> online Zorba XQuery processor I tried them in). As noted above, this 
</I>&gt;<i> is because there is no standalone use of the &quot;return&quot; keyword -- 
</I>&gt;<i> either the processor you are using has a bug or you haven't shown us 
</I>&gt;<i> the entire expression.
</I>&gt;<i>
</I>&gt;<i> Thanks,
</I>&gt;<i>
</I>&gt;<i> -- Ron
</I>&gt;<i>
</I>&gt;<i> On 10/1/2012 5:34 PM, Michael Sokolov wrote:
</I>&gt;&gt;<i> On 10/1/2012 10:48 AM, Michael Kay wrote:
</I>&gt;&gt;&gt;<i> There is no function called &quot;return&quot;. Just remove the keyword.
</I>&gt;&gt;&gt;<i> Depending on the context, you might need to remove the outer curly
</I>&gt;&gt;&gt;<i> braces as well.
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> It's a little confusing because you can say
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> let $x:=0 return 23
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> but you can't say
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> return 23
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Actually if you really start to dig, it becomes a lot confusing
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> you can say
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> let $x := 0 return (23)
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> but in that instance return is not a function call; the parentheses here
</I>&gt;&gt;<i> are constructing a sequence (of one item)
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> But if you say
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> declare default function namespace &quot;x&quot;;
</I>&gt;&gt;<i> declare function return ($x) { $x+1 };
</I>&gt;&gt;<i> return (23)
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> that does seem to return 24 for at least one processor that I tried,
</I>&gt;&gt;<i> which seems truly bizarre (to me, anyway)
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> yet
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> declare default function namespace &quot;x&quot;;
</I>&gt;&gt;<i> declare function return ($x) { $x+1 };
</I>&gt;&gt;<i> return 23
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> returns 23
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> while
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> declare default function namespace &quot;x&quot;;
</I>&gt;&gt;<i> declare function return ($x) { $x+1 };
</I>&gt;&gt;<i> return return(23)
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> returns 24
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> -Mike Sokolov
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003978.html</link><pubDate>Mon, 01 Oct 2012 19:22:03 GMT</pubDate></item><item><title>  incorrect syntax?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>This is actually very straightforward. &quot;return&quot; is a keyword, used in 
FLWOR expressions and a few other places. There is no standalone 
&quot;return&quot; in XQuery. Thus:

    let $x:=0 return (23)

is a valid (if uninteresting) FLWOR expression that is equivalent to the 
even less interesting (but still valid) expression:

    (23)

And a standalone &quot;return&quot; is illegal:

    return (23) (: error :)

Where you have included parentheses below, you are calling a function 
named &quot;return&quot; and XQuery works as expected. It's a bad idea to name a 
function using a keyword as a name, but XQuery allows it. If you replace 
&quot;return(...)&quot; with &quot;foo(...)&quot; in the expressions below, the intended 
meaning will be clear.

The last two XQuery expressions should return errors (and do in the 
online Zorba XQuery processor I tried them in). As noted above, this is 
because there is no standalone use of the &quot;return&quot; keyword -- either the 
processor you are using has a bug or you haven't shown us the entire 
expression.

Thanks,

-- Ron

On 10/1/2012 5:34 PM, Michael Sokolov wrote:
&gt;<i> On 10/1/2012 10:48 AM, Michael Kay wrote:
</I>&gt;&gt;<i> There is no function called &quot;return&quot;. Just remove the keyword.
</I>&gt;&gt;<i> Depending on the context, you might need to remove the outer curly
</I>&gt;&gt;<i> braces as well.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> It's a little confusing because you can say
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> let $x:=0 return 23
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> but you can't say
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> return 23
</I>&gt;<i>
</I>&gt;<i> Actually if you really start to dig, it becomes a lot confusing
</I>&gt;<i>
</I>&gt;<i> you can say
</I>&gt;<i>
</I>&gt;<i> let $x := 0 return (23)
</I>&gt;<i>
</I>&gt;<i> but in that instance return is not a function call; the parentheses here
</I>&gt;<i> are constructing a sequence (of one item)
</I>&gt;<i>
</I>&gt;<i> But if you say
</I>&gt;<i>
</I>&gt;<i> declare default function namespace &quot;x&quot;;
</I>&gt;<i> declare function return ($x) { $x+1 };
</I>&gt;<i> return (23)
</I>&gt;<i>
</I>&gt;<i> that does seem to return 24 for at least one processor that I tried,
</I>&gt;<i> which seems truly bizarre (to me, anyway)
</I>&gt;<i>
</I>&gt;<i> yet
</I>&gt;<i>
</I>&gt;<i> declare default function namespace &quot;x&quot;;
</I>&gt;<i> declare function return ($x) { $x+1 };
</I>&gt;<i> return 23
</I>&gt;<i>
</I>&gt;<i> returns 23
</I>&gt;<i>
</I>&gt;<i> while
</I>&gt;<i>
</I>&gt;<i> declare default function namespace &quot;x&quot;;
</I>&gt;<i> declare function return ($x) { $x+1 };
</I>&gt;<i> return return(23)
</I>&gt;<i>
</I>&gt;<i> returns 24
</I>&gt;<i>
</I>&gt;<i> -Mike Sokolov
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I></PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003977.html</link><pubDate>Mon, 01 Oct 2012 17:55:20 GMT</pubDate></item><item><title>  incorrect syntax?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 01/10/2012 15:19, Gleb Gawriljuk wrote:
&gt;<i> I cannot see where my error lies. I am just executing the return function
</I>

That is your error. Xquery does not have a return function.
Without seeing more context it's not clear what the query should be.

David


-- 
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. 
________________________________________________________________________
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003976.html</link><pubDate>Mon, 01 Oct 2012 07:29:35 GMT</pubDate></item><item><title>  incorrect syntax?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi Gleb,

Could the prefix in front of the return call be missing? (e.g., local:return, depending on how you defined this function)

By default (if you have not changed it), the default function namespace is the builtin one (also available through fn:), so just typing &quot;return&quot; will look up among builtin functions (fn:return, which as far as I know does not exist).

Does this help?

Kind regards,
Ghislain


On Oct 1, 2012, at 4:19 PM, Gleb Gawriljuk &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:

&gt;<i> Hey everyone,
</I>&gt;<i> 
</I>&gt;<i> I have the following query which I use as a string in Saxon 8.9: 
</I>&gt;<i> {return( 
</I>&gt;<i> 	if (
</I>&gt;<i> 		not(doc('path.xml')/Student/StudentID = doc(path.xml')/RentNote/StudentID) and	
</I>&gt;<i> 		not(doc('path.xml')/Buch/BuchID = doc('path.xml')/RentNote/BuchID)
</I>&gt;<i> 		) 	
</I>&gt;<i> 	then error()	
</I>&gt;<i> 	else &lt;ok&gt;&lt;/ok&gt;
</I>&gt;<i> )
</I>&gt;<i> }
</I>&gt;<i> 
</I>&gt;<i> However I receive the follwoing error:
</I>&gt;<i> &lt;image.png&gt;
</I>&gt;<i> 
</I>&gt;<i> I cannot see where my error lies. I am just executing the return function which holds a xpath expression. Can anybody help?
</I>&gt;<i> 
</I>&gt;<i> Kind regards,
</I>&gt;<i> Gleb
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201210/003975.html</link><pubDate>Mon, 01 Oct 2012 07:25:03 GMT</pubDate></item><item><title>  Looking for help restricting results per input?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 24 September 2012 07:47, Jeremy Botto &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> let $keywords := (&quot;keyworda&quot;, &quot;keywordb&quot;, &quot;keywordc&quot;)
</I>&gt;<i> for $keyword in $keywords,
</I>&gt;<i> $v in doc('test')//document/item
</I>&gt;<i> where $v/quote contains text {$keyword}
</I>&gt;<i> return (&lt;re&gt;
</I>&gt;<i> {$v/comment}
</I>&gt;<i> {$v/buyer}&lt;/re&gt;)
</I>&gt;<i>
</I>&gt;<i> There are three things I am trying to add to this query:
</I>&gt;<i>
</I>&gt;<i> 1) I'd like to get only two results per $keyword in $keywords, but I am
</I>&gt;<i> currently getting 20-30 results per keyword.
</I>
You've got a &quot;cartesian cross product&quot; in your for expression.... is
that really what you want?

&gt;<i> 2) I'd like to search for case-insensitive keywords.
</I>
Covert both items to lower-case() before comparing, or use your xquery
vendors custom extensions.

&gt;<i> 3) Because I am trying to receive only 2 results, I want to prioritize
</I>&gt;<i> results whose 'quote' element also contain round braces &quot;(&quot; and &quot;)&quot;.
</I>
Use order by - if if the quote contains round brackets return 1 else
return 0, then sort by number descending.


-- 
Andrew Welch
http://andrewjwelch.com
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201209/003974.html</link><pubDate>Mon, 24 Sep 2012 01:59:21 GMT</pubDate></item><item><title>  [xml-dev] XQuery 3.0 implementations vs the	XQuery 3.0 Test Suite
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Jim,

I expect Zorba to report results by the end of the year, hopefully 100%. We implement all the features,
including the optional ones.

Best
Dana


On Sep 17, 2012, at 6:55 PM, Jim Melton wrote:

&gt;<i> Gentle friends,
</I>&gt;<i> 
</I>&gt;<i> The XML Query WG, jointly with the XSLT Working Group, are nearly ready to several several of the &quot;3.0&quot; suite of specifications from Last Call Working Draft to Candidate Recommendation.  The exceptions are Serialization 3.0, which will be submitted for a second Last Call comment period, and XSLT 3.0, which has not yet entered the Last Call phase.  (The documents being considered for advancement are XQuery 3.0, XQueryX 3.0, XPath 3.0, XDM 3.0, and F&amp;O 3.0.)
</I>&gt;<i> 
</I>&gt;<i> We already have in place a very substantial test suite for XQuery 3.0, although we do not claim that it is as complete as we wish it to be.  We are currently in the process of reviewing the test suite to determine what additional tests are needed to ensure that we can determine our specs to be implementable as required by W3C policies.
</I>&gt;<i> 
</I>&gt;<i> The purpose of Candidate Recommendation is, as implied above, to determine whether the specs are implementable, particularly that each feature can be implemented by two or more implementations compatibly.  Therefore, as documents are transitioned to Candidate Recommendation, a Call for Implementations is issued.  Implementations respond to that call by submitting their results from running the test suite and by reporting bugs they've discovered as a result.
</I>&gt;<i> 
</I>&gt;<i> When we transition to Candidate Recommendation, we are required to indicate a date through which we will accept test suite results and other comments before we consider a further transition to Proposed Recommendation.  At this point, we honestly cannot predict whether implementors will require two weeks, two months, or two quarters before they're able to submit results.
</I>&gt;<i> 
</I>&gt;<i> If you are responsible for an XQuery 3.0 implementation, please respond to this message with your best estimate of how long from, say, mid-October 2012 it will be until you are able to submit test suite results.
</I>&gt;<i> 
</I>&gt;<i> Many thanks!
</I>&gt;<i>   Jim
</I>&gt;<i> 
</I>&gt;<i> ========================================================================
</I>&gt;<i> Jim Melton --- Editor of ISO/IEC 9075-* (SQL)     Phone: +1.801.942.0144
</I>&gt;<i>  Chair, ISO/IEC JTC1/SC32 and W3C XML Query WG    Fax : +1.801.942.3345
</I>&gt;<i> Oracle Corporation        Oracle Email: jim dot melton at oracle dot com
</I>&gt;<i> 1930 Viscounti Drive      Alternate email: jim dot melton at acm dot org
</I>&gt;<i> Sandy, UT 84093-1063 USA  Personal email: SheltieJim at xmission dot com
</I>&gt;<i> ========================================================================
</I>&gt;<i> =  Facts are facts.   But any opinions expressed are the opinions      =
</I>&gt;<i> =  only of myself and may or may not reflect the opinions of anybody   =
</I>&gt;<i> =  else with whom I may or may not have discussed the issues at hand.  =
</I>&gt;<i> ========================================================================  
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________________________________
</I>&gt;<i> 
</I>&gt;<i> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
</I>&gt;<i> to support XML implementation and development. To minimize
</I>&gt;<i> spam in the archives, you must subscribe before posting.
</I>&gt;<i> 
</I>&gt;<i> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
</I>&gt;<i> Or unsubscribe: http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> subscribe: http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> List archive: http://lists.xml.org/archives/xml-dev/
</I>&gt;<i> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
</I>&gt;<i> 
</I>
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201209/003973.html</link><pubDate>Wed, 19 Sep 2012 10:12:56 GMT</pubDate></item><item><title>  Replacing an attribute
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
&gt;<i> Yes. I saw that If I write an XSLT stylesheet, then I can call that 
</I>&gt;<i> from marklogic and it all works good...
</I>&gt;<i> I am not too sure, if XSLT is a good approach or if Xquery is a better 
</I>&gt;<i> way of doing things?
</I>&gt;<i>
</I>Generally, XQuery is better than XSLT for extracting specific 
information out of an XML document, and XSLT is better at making small 
changes to a document while leaving most of the content unchanged. Or to 
put it another way, XQuery is better at query and XSLT is better at 
transformation. (XQuery Update is an alternative, though, if available).

Michael Kay
Saxonica
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201209/003972.html</link><pubDate>Fri, 07 Sep 2012 08:22:52 GMT</pubDate></item><item><title>  Simple (I thought) Xquery giving run-time error.
   </title><description><![CDATA[<!--beginarticle-->
<PRE>It seems like you might have too many '/*' steps.  For example, if you evaluate $models/* in the body, I think you should get the empty sequence.  $models appears to bind to the sequence of &lt;Model&gt; elements so $models/* would select element children of each but there aren't any.

I would try changing your line to the following:

   {$models/&lt;case id='{text()}Case'&gt;{local:bindModel(local:defineModelRoot(.),&quot;&quot;,xs:QName('group'))}&lt;/case&gt;}

Josh

On Jul 13, 2012, at 7:41 AM, Ihe Onwuka wrote:

&gt;<i> Given this in modelNames.xml
</I>&gt;<i> 
</I>&gt;<i> &lt;?xml version=&quot;1.0&quot;?&gt;
</I>&gt;<i> &lt;ModelNames xmlns=&quot;http://www.b2b.net/plants&quot;&gt;
</I>&gt;<i>  &lt;Model singular=&quot;sale&quot;&gt;sales&lt;/Model&gt;
</I>&gt;<i>  &lt;Model singular=&quot;stock&quot;&gt;stocks&lt;/Model&gt;
</I>&gt;<i>  &lt;Model singular=&quot;plant&quot;&gt;plants&lt;/Model&gt;
</I>&gt;<i>  &lt;Model singular=&quot;client&quot;&gt;clients&lt;/Model&gt;
</I>&gt;<i> &lt;/ModelNames&gt;
</I>&gt;<i> 
</I>&gt;<i> I am having problems with the following XQuery
</I>&gt;<i> 
</I>&gt;<i> xquery version &quot;1.0&quot;;
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> declare namespace b2b = &quot;http://www.b2b.net/plants&quot;;
</I>&gt;<i> declare namespace xf=&quot;http://www.w3.org/2002/xforms&quot;;
</I>&gt;<i> declare namespace html=&quot;http://www.w3.org/1999/xhtml&quot;;
</I>&gt;<i> declare namespace ev=&quot;http://www.w3.org/2001/xml-events&quot;;
</I>&gt;<i> 
</I>&gt;<i> declare variable $configDir as xs:string :=&quot;config&quot;;
</I>&gt;<i> 
</I>&gt;<i> declare variable $models as element()*
</I>&gt;<i> :=doc(concat($configDir,&quot;/modelNames.xml&quot;))/*/*;
</I>&gt;<i> 
</I>&gt;<i> declare function local:bindModel($x,$y,$z) {$x};
</I>&gt;<i> 
</I>&gt;<i> declare function local:capitalise($str)
</I>&gt;<i> {
</I>&gt;<i>    concat(upper-case(substring($str,1,1)),substring($str,2))
</I>&gt;<i> };
</I>&gt;<i> 
</I>&gt;<i> declare function local:defineModelRoot($model as element())
</I>&gt;<i> {
</I>&gt;<i>   element {concat('b2b:',local:capitalise($model/text()))}
</I>&gt;<i>            {element xf:bind {attribute repeat
</I>&gt;<i> {local:getBindingFileName($model)}}}
</I>&gt;<i> };
</I>&gt;<i> 
</I>&gt;<i> declare function local:getBindingFileName($model as element()) as xs:string
</I>&gt;<i> {
</I>&gt;<i>   concat($model/@singular,'Bindings.xml')
</I>&gt;<i> };
</I>&gt;<i>    &lt;switch xmlns=&quot;http://www.w3.org/2002/xforms&quot;&gt;
</I>&gt;<i>      {$models/*/&lt;case
</I>&gt;<i> id='{text()}Case'&gt;{local:bindModel(local:defineModelRoot(.),&quot;&quot;,xs:QName('group'))}&lt;/case&gt;}
</I>&gt;<i>    &lt;/switch&gt;
</I>&gt;<i> 
</I>&gt;<i> The idea of  the line that says
</I>&gt;<i> 
</I>&gt;<i>  {$models/*/&lt;case
</I>&gt;<i> id='{text()}Case'&gt;{local:bindModel(local:defineModelRoot(.),&quot;&quot;,xs:QName('group'))}&lt;/case&gt;}
</I>&gt;<i> 
</I>&gt;<i> is for the &lt;case&gt; direct constructor to be evaluated for each model
</I>&gt;<i> element in $models. The two substitutions I am hoping for is the
</I>&gt;<i> text() element in the AVT for the id attribute of the case element and
</I>&gt;<i> the . in local:defineModelRoot, which is meant to pass the context
</I>&gt;<i> model element as a parameter to local:defineModelRoot.
</I>&gt;<i> 
</I>&gt;<i> Is my understanding of what I should expect incorrect. If so I would
</I>&gt;<i> appreciate an explanation rather than just a solution.
</I>&gt;<i> 
</I>&gt;<i> thanks.
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003911.html</link><pubDate>Fri, 13 Jul 2012 08:20:41 GMT</pubDate></item><item><title>  Simple (I thought) Xquery giving run-time error.
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
Your problem is that the initialization of $models goes down two levels 
below the document node, so it is bound to a sequence of Model elements, 
so when you do $models/* you are selecting the children of the Model 
elements, but there are no child elements to select. Remove a /* either 
from the definition of $models or from the expression where it is used.

Michael Kay
Saxonica

On 13/07/2012 15:41, Ihe Onwuka wrote:
&gt;<i> xquery version &quot;1.0&quot;;
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> declare namespace b2b =&quot;http://www.b2b.net/plants&quot;;
</I>&gt;<i> declare namespace xf=&quot;http://www.w3.org/2002/xforms&quot;;
</I>&gt;<i> declare namespace html=&quot;http://www.w3.org/1999/xhtml&quot;;
</I>&gt;<i> declare namespace ev=&quot;http://www.w3.org/2001/xml-events&quot;;
</I>&gt;<i>
</I>&gt;<i> declare variable $configDir as xs:string :=&quot;config&quot;;
</I>&gt;<i>
</I>&gt;<i> declare variable $models as element()*
</I>&gt;<i> :=doc(concat($configDir,&quot;/modelNames.xml&quot;))/*/*;
</I>&gt;<i>
</I>&gt;<i> declare function local:bindModel($x,$y,$z) {$x};
</I>&gt;<i>
</I>&gt;<i> declare function local:capitalise($str)
</I>&gt;<i> {
</I>&gt;<i>      concat(upper-case(substring($str,1,1)),substring($str,2))
</I>&gt;<i> };
</I>&gt;<i>
</I>&gt;<i> declare function local:defineModelRoot($model as element())
</I>&gt;<i> {
</I>&gt;<i>     element {concat('b2b:',local:capitalise($model/text()))}
</I>&gt;<i>              {element xf:bind {attribute repeat
</I>&gt;<i> {local:getBindingFileName($model)}}}
</I>&gt;<i> };
</I>&gt;<i>
</I>&gt;<i> declare function local:getBindingFileName($model as element()) as xs:string
</I>&gt;<i> {
</I>&gt;<i>     concat($model/@singular,'Bindings.xml')
</I>&gt;<i> };
</I>&gt;<i>      &lt;switch xmlns=&quot;http://www.w3.org/2002/xforms&quot;&gt;
</I>&gt;<i>        {$models/*/&lt;case
</I>&gt;<i> id='{text()}Case'&gt;{local:bindModel(local:defineModelRoot(.),&quot;&quot;,xs:QName('group'))}&lt;/case&gt;}
</I>&gt;<i>      &lt;/switch&gt;
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003910.html</link><pubDate>Fri, 13 Jul 2012 08:18:08 GMT</pubDate></item><item><title>  Simple (I thought) Xquery giving run-time error.
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Given this in modelNames.xml

&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;ModelNames xmlns=&quot;http://www.b2b.net/plants&quot;&gt;
  &lt;Model singular=&quot;sale&quot;&gt;sales&lt;/Model&gt;
  &lt;Model singular=&quot;stock&quot;&gt;stocks&lt;/Model&gt;
  &lt;Model singular=&quot;plant&quot;&gt;plants&lt;/Model&gt;
  &lt;Model singular=&quot;client&quot;&gt;clients&lt;/Model&gt;
&lt;/ModelNames&gt;

I am having problems with the following XQuery

xquery version &quot;1.0&quot;;


declare namespace b2b = &quot;http://www.b2b.net/plants&quot;;
declare namespace xf=&quot;http://www.w3.org/2002/xforms&quot;;
declare namespace html=&quot;http://www.w3.org/1999/xhtml&quot;;
declare namespace ev=&quot;http://www.w3.org/2001/xml-events&quot;;

declare variable $configDir as xs:string :=&quot;config&quot;;

declare variable $models as element()*
:<i>=doc(concat($configDir,&quot;/modelNames.xml&quot;))/*/*;
</I>
declare function local:bindModel($x,$y,$z) {$x};

declare function local:capitalise($str)
{
    concat(upper-case(substring($str,1,1)),substring($str,2))
};

declare function local:defineModelRoot($model as element())
{
   element {concat('b2b:',local:capitalise($model/text()))}
            {element xf:bind {attribute repeat
{local:getBindingFileName($model)}}}
};

declare function local:getBindingFileName($model as element()) as xs:string
{
   concat($model/@singular,'Bindings.xml')
};
    &lt;switch xmlns=&quot;http://www.w3.org/2002/xforms&quot;&gt;
      {$models/*/&lt;case
id='{text()}Case'&gt;{local:bindModel(local:defineModelRoot(.),&quot;&quot;,xs:QName('group'))}&lt;/case&gt;}
    &lt;/switch&gt;

The idea of  the line that says

  {$models/*/&lt;case
id='{text()}Case'&gt;{local:bindModel(local:defineModelRoot(.),&quot;&quot;,xs:QName('group'))}&lt;/case&gt;}

is for the &lt;case&gt; direct constructor to be evaluated for each model
element in $models. The two substitutions I am hoping for is the
text() element in the AVT for the id attribute of the case element and
the . in local:defineModelRoot, which is meant to pass the context
model element as a parameter to local:defineModelRoot.

Is my understanding of what I should expect incorrect. If so I would
appreciate an explanation rather than just a solution.

thanks.
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003909.html</link><pubDate>Fri, 13 Jul 2012 07:41:50 GMT</pubDate></item><item><title>  XML &amp;amp; XQuery @ NoSQL Now! 2012
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hello gang,

This year edition of the NoSQL Now! 2012 will feature several talks
related to XML &amp; XQuery topics.
We have listed the ones related to the Zorba XQuery Processor at
http://www.zorba-xquery.com/html/entry/2012/07/10/NoSQL_Now

We hope to see you there!

William
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003908.html</link><pubDate>Wed, 11 Jul 2012 08:59:58 GMT</pubDate></item><item><title>  XQuery Update Facility and unwanted whitespace
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
Andrew has answered the whitespace questions.

It's a Saxon (not an Oxygen) restriction that XQuery 3.0 and XQuery 
Update can't currently be used together in the same query. It happened 
that way because both are implemented as extensions to the &quot;core&quot; XQuery 
1.0 parser, built using subclassing. (Done that way partly because of 
the code separation between different Saxon editions). We need to fix 
this mechanism, which is becoming pretty unmanageable with the number of 
different language dialects supported. Ideally, I suppose, we should 
make a complete break and move to a bottom-up table driven parser; but 
XQuery parsing is so fragile with the number of context-dependent 
decisions that need to be made, it's a risky change to contemplate.

Michael Kay
Saxonica

On 09/07/2012 19:45, Joe Wicentowski wrote:
&gt;<i> Hi all,
</I>&gt;<i>
</I>&gt;<i> I'm having a problem with query I wrote that makes use of the XQuery
</I>&gt;<i> Update Facility.  The problem is that unwanted whitespace inserted
</I>&gt;<i> into the results of my query.  Here is my source XML (a TEI-like
</I>&gt;<i> list), the query in question, and the output showing the unwanted
</I>&gt;<i> whitespace:
</I>&gt;<i>
</I>&gt;<i> source.xml:
</I>&gt;<i> -----------------
</I>&gt;<i> &lt;list&gt;
</I>&gt;<i>      &lt;item&gt;See &lt;ref target=&quot;#MIDDLEEAST&quot;&gt;Middle East&lt;/ref&gt;&lt;/item&gt;
</I>&gt;<i>      &lt;item xml:id=&quot;MIDDLEEAST&quot;&gt;Middle East &lt;ref target=&quot;#d68&quot;&gt;68&lt;/ref&gt;&lt;/item&gt;
</I>&gt;<i> &lt;/list&gt;
</I>&gt;<i>
</I>&gt;<i> fix-ids.xq:
</I>&gt;<i> --------------
</I>&gt;<i> let $doc := doc('source.xml')
</I>&gt;<i> for $item-id at $count in $doc//item/@xml:id
</I>&gt;<i> let $new-id := concat('in', $count)
</I>&gt;<i> let $new-target := concat('#', $new-id)
</I>&gt;<i> let $targets := $doc//ref[@target = concat('#', $item-id)]/@target
</I>&gt;<i> return
</I>&gt;<i>      (
</I>&gt;<i>      (: fix @xml:ids :)
</I>&gt;<i>      replace value of node $item-id with $new-id
</I>&gt;<i>      ,
</I>&gt;<i>      (: fix @targets :)
</I>&gt;<i>      for $target in $targets
</I>&gt;<i>      return
</I>&gt;<i>          replace value of node $target with $new-target
</I>&gt;<i>      )
</I>&gt;<i>
</I>&gt;<i> output:
</I>&gt;<i> ----------
</I>&gt;<i> &lt;list&gt;
</I>&gt;<i>     &lt;item&gt;See &lt;ref target=&quot;#in1&quot;&gt;Middle East&lt;/ref&gt;
</I>&gt;<i>     &lt;/item&gt;
</I>&gt;<i>     &lt;item xml:id=&quot;in1&quot;&gt;Middle East &lt;ref target=&quot;#d68&quot;&gt;68&lt;/ref&gt;
</I>&gt;<i>     &lt;/item&gt;
</I>&gt;<i> &lt;/list&gt;
</I>&gt;<i>
</I>&gt;<i> Note that while the query only modifies attribute values, the results
</I>&gt;<i> of the query are somehow re-indented.  (Specifically, in the source,
</I>&gt;<i> there was no whitespace between &lt;/ref&gt; and &lt;/item&gt;, but in the
</I>&gt;<i> results, &lt;/item&gt; is on a new line.
</I>&gt;<i>
</I>&gt;<i> Is this a serialization issue?  Is there a way for me to declare some
</I>&gt;<i> options that will prevent the unwanted whitespace from being inserted?
</I>&gt;<i>
</I>&gt;<i> I'm not sure whether this is a general XQuery issue or an
</I>&gt;<i> implementation-specific issue, so let me know if this isn't the right
</I>&gt;<i> forum for this question.  I'm using oXygen 13 in XQuery Debugger mode
</I>&gt;<i> with Saxon EE-XQuery 9.3.0.5.
</I>&gt;<i>
</I>&gt;<i> (On a related note, I see that XQuery 3.0 has new support for
</I>&gt;<i> serialization options --
</I>&gt;<i> http://www.w3.org/TR/xquery-30/#id-serialization -- but oXygen doesn't
</I>&gt;<i> seem to allow combining XQuery 3.0 with XQuery Update Facility and
</I>&gt;<i> Saxon EE.  This forum post instructs users to disable XQuery 1.1/3.0
</I>&gt;<i> support in order to use XQUF:
</I>&gt;<i> http://www.oxygenxml.com/forum/topic6615.html.)
</I>&gt;<i>
</I>&gt;<i> Thanks,
</I>&gt;<i> Joe
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003907.html</link><pubDate>Tue, 10 Jul 2012 01:00:23 GMT</pubDate></item><item><title>  XQuery Update Facility and unwanted whitespace
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi Andrew,

&gt;<i> What is you &quot;strip whitespace&quot; set to?  It sounds like it's set to &quot;all&quot;...
</I>
Great point - I had actually been fiddling with that setting earlier
before your I emailed the list.  Setting it back to &quot;none&quot; or
&quot;ignorable&quot; is much better:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;list&gt;
    &lt;item&gt;See &lt;ref target=&quot;#in1&quot;&gt;Middle East&lt;/ref&gt;&lt;/item&gt;
    &lt;item xml:id=&quot;in1&quot;&gt;Middle East &lt;ref target=&quot;#d68&quot;&gt;68&lt;/ref&gt;&lt;/item&gt;
&lt;/list&gt;

I couldn't get it to put &lt;list&gt; on a new line, but that's no biggie.

So, in sum, the combination of unticking 'format transformer output'
and setting 'strip whitespace' to 'none' or 'ignorable' yields quite
nice results.

Thanks very much, Andrew.

Joe
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003906.html</link><pubDate>Mon, 09 Jul 2012 14:12:04 GMT</pubDate></item><item><title>  XQuery Update Facility and unwanted whitespace
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 9 July 2012 20:35, Joe Wicentowski &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
&gt;<i> Hi Andrew,
</I>&gt;<i>
</I>&gt;&gt;<i> In the XQuery options (in oXygen) untick 'format transformer output'
</I>&gt;<i>
</I>&gt;<i> Thanks for that suggestion.  That's definitely preferable, in that it
</I>&gt;<i> doesn't introduce new whitespace, though it does strips out all
</I>&gt;<i> whitespace between nodes -- which is fine with me:
</I>
What is you &quot;strip whitespace&quot; set to?  It sounds like it's set to &quot;all&quot;...


-- 
Andrew Welch
http://andrewjwelch.com
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003905.html</link><pubDate>Mon, 09 Jul 2012 12:53:49 GMT</pubDate></item><item><title>  XQuery Update Facility and unwanted whitespace
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi Andrew,

&gt;<i> In the XQuery options (in oXygen) untick 'format transformer output'
</I>
Thanks for that suggestion.  That's definitely preferable, in that it
doesn't introduce new whitespace, though it does strips out all
whitespace between nodes -- which is fine with me:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;list&gt;&lt;item&gt;See &lt;ref
target=&quot;#in1&quot;&gt;Middle East&lt;/ref&gt;&lt;/item&gt;&lt;item xml:id=&quot;in1&quot;&gt;Middle East
&lt;ref target=&quot;#d68&quot;&gt;68&lt;/ref&gt;&lt;/item&gt;&lt;/list&gt;

To sum up, I guess this was an oXygen/Saxon-specific issue, but it
applies to all XQuery results in oXygen, not just those queries that
use the XQuery Update Facility.

Ah, whitespace.  Life would be so boring and straightforward without you.

Thanks again,
Joe
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003904.html</link><pubDate>Mon, 09 Jul 2012 12:35:47 GMT</pubDate></item><item><title>  XQuery Update Facility and unwanted whitespace
   </title><description><![CDATA[<!--beginarticle-->
<PRE>&gt;<i> Is this a serialization issue?  Is there a way for me to declare some
</I>&gt;<i> options that will prevent the unwanted whitespace from being inserted?
</I>&gt;<i>
</I>&gt;<i> I'm not sure whether this is a general XQuery issue or an
</I>&gt;<i> implementation-specific issue, so let me know if this isn't the right
</I>&gt;<i> forum for this question.  I'm using oXygen 13 in XQuery Debugger mode
</I>&gt;<i> with Saxon EE-XQuery 9.3.0.5.
</I>
In the XQuery options (in oXygen) untick 'format transformer output'


-- 
Andrew Welch
http://andrewjwelch.com
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003903.html</link><pubDate>Mon, 09 Jul 2012 12:02:22 GMT</pubDate></item><item><title>  XQuery Update Facility and unwanted whitespace
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi all,

I'm having a problem with query I wrote that makes use of the XQuery
Update Facility.  The problem is that unwanted whitespace inserted
into the results of my query.  Here is my source XML (a TEI-like
list), the query in question, and the output showing the unwanted
whitespace:

source.xml:
-----------------
&lt;list&gt;
    &lt;item&gt;See &lt;ref target=&quot;#MIDDLEEAST&quot;&gt;Middle East&lt;/ref&gt;&lt;/item&gt;
    &lt;item xml:id=&quot;MIDDLEEAST&quot;&gt;Middle East &lt;ref target=&quot;#d68&quot;&gt;68&lt;/ref&gt;&lt;/item&gt;
&lt;/list&gt;

fix-ids.xq:
--------------
let $doc := doc('source.xml')
for $item-id at $count in $doc//item/@xml:id
let $new-id := concat('in', $count)
let $new-target := concat('#', $new-id)
let $targets := $doc//ref[@target = concat('#', $item-id)]/@target
return
    (
    (: fix @xml:ids :)
    replace value of node $item-id with $new-id
    ,
    (: fix @targets :)
    for $target in $targets
    return
        replace value of node $target with $new-target
    )

output:
----------
&lt;list&gt;
   &lt;item&gt;See &lt;ref target=&quot;#in1&quot;&gt;Middle East&lt;/ref&gt;
   &lt;/item&gt;
   &lt;item xml:id=&quot;in1&quot;&gt;Middle East &lt;ref target=&quot;#d68&quot;&gt;68&lt;/ref&gt;
   &lt;/item&gt;
&lt;/list&gt;

Note that while the query only modifies attribute values, the results
of the query are somehow re-indented.  (Specifically, in the source,
there was no whitespace between &lt;/ref&gt; and &lt;/item&gt;, but in the
results, &lt;/item&gt; is on a new line.

Is this a serialization issue?  Is there a way for me to declare some
options that will prevent the unwanted whitespace from being inserted?

I'm not sure whether this is a general XQuery issue or an
implementation-specific issue, so let me know if this isn't the right
forum for this question.  I'm using oXygen 13 in XQuery Debugger mode
with Saxon EE-XQuery 9.3.0.5.

(On a related note, I see that XQuery 3.0 has new support for
serialization options --
http://www.w3.org/TR/xquery-30/#id-serialization -- but oXygen doesn't
seem to allow combining XQuery 3.0 with XQuery Update Facility and
Saxon EE.  This forum post instructs users to disable XQuery 1.1/3.0
support in order to use XQUF:
http://www.oxygenxml.com/forum/topic6615.html.)

Thanks,
Joe
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003902.html</link><pubDate>Mon, 09 Jul 2012 11:45:23 GMT</pubDate></item><item><title>  fn:doc not returning data
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi Daniel,

XQIB does not support the doc function - the XQIB way of accessing an XML document is to send a GET request over the Web with the EXPath http-client module (possibly to the same server).

An example is given here:
http://www.xqib.org/js/RESTCallCourses_source.html

I hope this is helpful?

Kind regards,
Ghislain


On Jul 9, 2012, at 4:15 PM, Daniel Oneil wrote:

&gt;<i> I'm trying to use XQIB to get data from an XML file using the fn:doc function.
</I>&gt;<i> The following link leads to a Source Forge forum where I posted my code and a link to the books.xml file.
</I>&gt;<i> https://sourceforge.net/projects/mxquery/forums/forum/633155/topic/5412690
</I>&gt;<i> 
</I>&gt;<i> Kurt Cagle successfully used the fn:doc function in his example.
</I>&gt;<i> http://www.stylusstudio.com/xmldev/201101/post20010.html
</I>&gt;<i> 
</I>&gt;<i> The post at the Source Forge forum describes the problem and various attempts. Any assistance would be appreciated -- thanks.
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003901.html</link><pubDate>Mon, 09 Jul 2012 09:10:28 GMT</pubDate></item><item><title>  fn:doc not returning data
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Daniel Oneil wrote:
&gt;<i> I'm trying to use XQIB to get data from an XML file using the fn:doc
</I>&gt;<i> function.
</I>&gt;<i> The following link leads to a Source Forge forum where I posted my code
</I>&gt;<i> and a link to the books.xml file.
</I>&gt;<i> https://sourceforge.net/projects/mxquery/forums/forum/633155/topic/5412690
</I>
&gt;<i> The post at the Source Forge forum describes the problem and various
</I>&gt;<i> attempts. Any assistance would be appreciated -- thanks.
</I>
What is the location of the HTML file with the XQuery script in relation 
to that local XML file? Is the HTML file also loaded from the local file 
system?
Does the Firefox or Chrome error console show any security errors like 
&quot;access to ... denied&quot;?


-- 

	Martin Honnen --- MVP Data Platform Development
	http://msmvps.com/blogs/martin_honnen/


</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003900.html</link><pubDate>Mon, 09 Jul 2012 07:32:17 GMT</pubDate></item><item><title>  simple map operator
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Thank you, Michael,

I see that this is a syntactic categorisation and that the semantics of the definition does not carry as much weight as the order of precedence.

When the order of precedence changes in the next draft, will &quot;/&quot; and &quot;//&quot; become map operators?

Waiting to have syntax and semantics linked up again, in the next edition of your book,

Jens

On Jul 9, 2012, at 11:26 AM, Michael Kay wrote:

&gt;<i> 
</I>&gt;<i> A!B is a RelativePathExpr in the BNF grammar, but so are 29, count($x), and (1 to 10)[3].
</I>&gt;<i> 
</I>&gt;<i> Similarly, the way the grammar works, &quot;a and b&quot; is an instance of OrExpr, and 2+2 is an instance of ValueComp.
</I>&gt;<i> 
</I>&gt;<i> So you need to distinguish the names of productions in the grammar, which affect the precedence of expressions, from the semantics of the operators appearing in those expressions. Generally productions are named after the lowest-precedence operator that is allowed to appear in the expression.
</I>&gt;<i> 
</I>&gt;<i> In fact, since XPath 3.0 was last published, we have decided to change the precedence of the new &quot;!&quot; operator to be lower than the precedence of &quot;/&quot;, so this will change.
</I>&gt;<i> 
</I>&gt;<i> As for my book, see the discussion of the terminological problems around the phrase &quot;path expression&quot; on the first page of chapter 9; also see page 523. In common parlance, a &quot;path expression&quot; is an expression that uses the &quot;/&quot; operator, just as an &quot;or expression&quot; is one that uses the &quot;or&quot; operator; but that doesn't correspond to the BNF symbols PathExpr and OrExpr.
</I>&gt;<i> 
</I>&gt;<i> The term &quot;sequence expression&quot; is used as a chapter heading in my book, as a convenient title for the set of constructs I chose to describe in that chapter, but it is not a term that appears in the XPath language specification itself.
</I>&gt;<i> 
</I>&gt;<i> Michael Kay
</I>&gt;<i> Saxonica
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> On 09/07/2012 09:43, Jens &#216;stergaard Petersen wrote:
</I>&gt;&gt;<i> Thanks, Michael,
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> If the simple map operator &quot;does not locate any special nodes within trees, but works on sequences of items you specify by expressions&quot;, does that not make it into a sequence expression in the terms of Michael Kay's Reference, Chapter 10 (which also has &quot;/&quot; as a simple mapping expression when it works on atomic values)? Also, the draft defines a path expression as something that &quot;can be used to locate nodes within trees&quot;, so I still wonder what the meaning behind this categorisation is.
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> Cheers,
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> Jens
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> On Jul 9, 2012, at 10:01 AM, Michael Seiferle wrote:
</I>&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> Hi Jens,
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> they are relative, such that each step (E1 ! E2) will serve as the input sequence E'1 for the next operation (E'1 ! E'2), hence:
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;&gt;<i> &lt;foo&gt;
</I>&gt;&gt;&gt;&gt;<i>  &lt;bar&gt;hello&lt;/bar&gt;
</I>&gt;&gt;&gt;&gt;<i>  &lt;bar&gt;world&lt;/bar&gt;
</I>&gt;&gt;&gt;&gt;<i>  &lt;bar&gt;and&lt;/bar&gt;
</I>&gt;&gt;&gt;&gt;<i>  &lt;bar&gt;hello&lt;/bar&gt;
</I>&gt;&gt;&gt;&gt;<i>  &lt;bar&gt;universe&lt;/bar&gt;
</I>&gt;&gt;&gt;&gt;<i> &lt;/foo&gt;/bar ! (: here we locate each &lt;bar /&gt; child of &lt;foo /&gt; :)
</I>&gt;&gt;&gt;&gt;<i>    upper-case(.) !  (: we return a sequence of their text() in upper-case :)
</I>&gt;&gt;&gt;&gt;<i>          substring(.,2,string-length(.)) (: we return a sequence of the upper case text and strip the first character :)
</I>&gt;&gt;&gt;<i> the map operator redefines the context items (inner focus) for each subsequent operation.
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> So it does not locate any special nodes within trees, but works on sequences of items you specify by expressions, for example:
</I>&gt;&gt;&gt;&gt;<i> (1 to 5) ! (. + 1) ! (. * 2)
</I>&gt;&gt;&gt;<i> will work as well and returns (4, 6, 8, 10, 12).
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> Hope this helped to clear things up a little :-).
</I>&gt;&gt;&gt;<i> I guess others on this list will correct me if I got something wrong.
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> Kind regards
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> Michael
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> Am 09.07.2012 um 09:41 schrieb Jens &#216;stergaard Petersen:
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;&gt;<i> Hi,
</I>&gt;&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;&gt;<i> Can anyone explain to me why the XQuery 3.0 simple map operator &lt;http://www.w3.org/TR/xquery-30/#id-map-operator&gt; is a relative path expression? Which nodes within trees does it locate?
</I>&gt;&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;&gt;<i> Thanks in advance for any enlightenment,
</I>&gt;&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;&gt;<i> Jens
</I>&gt;&gt;&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003899.html</link><pubDate>Mon, 09 Jul 2012 03:30:44 GMT</pubDate></item><item><title>  simple map operator
   </title><description><![CDATA[<!--beginarticle-->
<PRE>
A!B is a RelativePathExpr in the BNF grammar, but so are 29, count($x), 
and (1 to 10)[3].

Similarly, the way the grammar works, &quot;a and b&quot; is an instance of 
OrExpr, and 2+2 is an instance of ValueComp.

So you need to distinguish the names of productions in the grammar, 
which affect the precedence of expressions, from the semantics of the 
operators appearing in those expressions. Generally productions are 
named after the lowest-precedence operator that is allowed to appear in 
the expression.

In fact, since XPath 3.0 was last published, we have decided to change 
the precedence of the new &quot;!&quot; operator to be lower than the precedence 
of &quot;/&quot;, so this will change.

As for my book, see the discussion of the terminological problems around 
the phrase &quot;path expression&quot; on the first page of chapter 9; also see 
page 523. In common parlance, a &quot;path expression&quot; is an expression that 
uses the &quot;/&quot; operator, just as an &quot;or expression&quot; is one that uses the 
&quot;or&quot; operator; but that doesn't correspond to the BNF symbols PathExpr 
and OrExpr.

The term &quot;sequence expression&quot; is used as a chapter heading in my book, 
as a convenient title for the set of constructs I chose to describe in 
that chapter, but it is not a term that appears in the XPath language 
specification itself.

Michael Kay
Saxonica


On 09/07/2012 09:43, Jens &#216;stergaard Petersen wrote:
&gt;<i> Thanks, Michael,
</I>&gt;<i>
</I>&gt;<i> If the simple map operator &quot;does not locate any special nodes within trees, but works on sequences of items you specify by expressions&quot;, does that not make it into a sequence expression in the terms of Michael Kay's Reference, Chapter 10 (which also has &quot;/&quot; as a simple mapping expression when it works on atomic values)? Also, the draft defines a path expression as something that &quot;can be used to locate nodes within trees&quot;, so I still wonder what the meaning behind this categorisation is.
</I>&gt;<i>
</I>&gt;<i> Cheers,
</I>&gt;<i>
</I>&gt;<i> Jens
</I>&gt;<i>
</I>&gt;<i> On Jul 9, 2012, at 10:01 AM, Michael Seiferle wrote:
</I>&gt;<i>
</I>&gt;&gt;<i> Hi Jens,
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> they are relative, such that each step (E1 ! E2) will serve as the input sequence E'1 for the next operation (E'1 ! E'2), hence:
</I>&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> &lt;foo&gt;
</I>&gt;&gt;&gt;<i>   &lt;bar&gt;hello&lt;/bar&gt;
</I>&gt;&gt;&gt;<i>   &lt;bar&gt;world&lt;/bar&gt;
</I>&gt;&gt;&gt;<i>   &lt;bar&gt;and&lt;/bar&gt;
</I>&gt;&gt;&gt;<i>   &lt;bar&gt;hello&lt;/bar&gt;
</I>&gt;&gt;&gt;<i>   &lt;bar&gt;universe&lt;/bar&gt;
</I>&gt;&gt;&gt;<i> &lt;/foo&gt;/bar ! (: here we locate each &lt;bar /&gt; child of &lt;foo /&gt; :)
</I>&gt;&gt;&gt;<i>     upper-case(.) !  (: we return a sequence of their text() in upper-case :)
</I>&gt;&gt;&gt;<i>           substring(.,2,string-length(.)) (: we return a sequence of the upper case text and strip the first character :)
</I>&gt;&gt;<i> the map operator redefines the context items (inner focus) for each subsequent operation.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> So it does not locate any special nodes within trees, but works on sequences of items you specify by expressions, for example:
</I>&gt;&gt;&gt;<i> (1 to 5) ! (. + 1) ! (. * 2)
</I>&gt;&gt;<i> will work as well and returns (4, 6, 8, 10, 12).
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Hope this helped to clear things up a little :-).
</I>&gt;&gt;<i> I guess others on this list will correct me if I got something wrong.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Kind regards
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Michael
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Am 09.07.2012 um 09:41 schrieb Jens &#216;stergaard Petersen:
</I>&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> Hi,
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> Can anyone explain to me why the XQuery 3.0 simple map operator &lt;http://www.w3.org/TR/xquery-30/#id-map-operator&gt; is a relative path expression? Which nodes within trees does it locate?
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> Thanks in advance for any enlightenment,
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> Jens
</I>&gt;&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003898.html</link><pubDate>Mon, 09 Jul 2012 02:26:50 GMT</pubDate></item><item><title>  simple map operator
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Thanks, Michael,

If the simple map operator &quot;does not locate any special nodes within trees, but works on sequences of items you specify by expressions&quot;, does that not make it into a sequence expression in the terms of Michael Kay's Reference, Chapter 10 (which also has &quot;/&quot; as a simple mapping expression when it works on atomic values)? Also, the draft defines a path expression as something that &quot;can be used to locate nodes within trees&quot;, so I still wonder what the meaning behind this categorisation is.

Cheers,

Jens

On Jul 9, 2012, at 10:01 AM, Michael Seiferle wrote:

&gt;<i> Hi Jens, 
</I>&gt;<i> 
</I>&gt;<i> they are relative, such that each step (E1 ! E2) will serve as the input sequence E'1 for the next operation (E'1 ! E'2), hence:
</I>&gt;<i> 
</I>&gt;&gt;<i> &lt;foo&gt;
</I>&gt;&gt;<i>  &lt;bar&gt;hello&lt;/bar&gt;
</I>&gt;&gt;<i>  &lt;bar&gt;world&lt;/bar&gt;
</I>&gt;&gt;<i>  &lt;bar&gt;and&lt;/bar&gt;
</I>&gt;&gt;<i>  &lt;bar&gt;hello&lt;/bar&gt;
</I>&gt;&gt;<i>  &lt;bar&gt;universe&lt;/bar&gt;
</I>&gt;&gt;<i> &lt;/foo&gt;/bar ! (: here we locate each &lt;bar /&gt; child of &lt;foo /&gt; :)
</I>&gt;&gt;<i>    upper-case(.) !  (: we return a sequence of their text() in upper-case :)
</I>&gt;&gt;<i>          substring(.,2,string-length(.)) (: we return a sequence of the upper case text and strip the first character :)
</I>&gt;<i> the map operator redefines the context items (inner focus) for each subsequent operation. 
</I>&gt;<i> 
</I>&gt;<i> So it does not locate any special nodes within trees, but works on sequences of items you specify by expressions, for example:
</I>&gt;&gt;<i> (1 to 5) ! (. + 1) ! (. * 2)
</I>&gt;<i> will work as well and returns (4, 6, 8, 10, 12).
</I>&gt;<i> 
</I>&gt;<i> Hope this helped to clear things up a little :-).
</I>&gt;<i> I guess others on this list will correct me if I got something wrong.
</I>&gt;<i> 
</I>&gt;<i> Kind regards
</I>&gt;<i> 
</I>&gt;<i> Michael
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> Am 09.07.2012 um 09:41 schrieb Jens &#216;stergaard Petersen:
</I>&gt;<i> 
</I>&gt;&gt;<i> Hi,
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> Can anyone explain to me why the XQuery 3.0 simple map operator &lt;http://www.w3.org/TR/xquery-30/#id-map-operator&gt; is a relative path expression? Which nodes within trees does it locate?
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> Thanks in advance for any enlightenment,
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> Jens
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> 
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003897.html</link><pubDate>Mon, 09 Jul 2012 01:43:12 GMT</pubDate></item><item><title>  simple map operator
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi Jens, 

they are relative, such that each step (E1 ! E2) will serve as the input sequence E'1 for the next operation (E'1 ! E'2), hence:

&gt;<i> &lt;foo&gt;
</I>&gt;<i>   &lt;bar&gt;hello&lt;/bar&gt;
</I>&gt;<i>   &lt;bar&gt;world&lt;/bar&gt;
</I>&gt;<i>   &lt;bar&gt;and&lt;/bar&gt;
</I>&gt;<i>   &lt;bar&gt;hello&lt;/bar&gt;
</I>&gt;<i>   &lt;bar&gt;universe&lt;/bar&gt;
</I>&gt;<i> &lt;/foo&gt;/bar ! (: here we locate each &lt;bar /&gt; child of &lt;foo /&gt; :)
</I>&gt;<i>     upper-case(.) !  (: we return a sequence of their text() in upper-case :)
</I>&gt;<i>           substring(.,2,string-length(.)) (: we return a sequence of the upper case text and strip the first character :)
</I>the map operator redefines the context items (inner focus) for each subsequent operation. 

So it does not locate any special nodes within trees, but works on sequences of items you specify by expressions, for example:
&gt;<i> (1 to 5) ! (. + 1) ! (. * 2)
</I>will work as well and returns (4, 6, 8, 10, 12).

Hope this helped to clear things up a little :-).
I guess others on this list will correct me if I got something wrong.

Kind regards

Michael
 


Am 09.07.2012 um 09:41 schrieb Jens &#216;stergaard Petersen:

&gt;<i> Hi,
</I>&gt;<i> 
</I>&gt;<i> Can anyone explain to me why the XQuery 3.0 simple map operator &lt;http://www.w3.org/TR/xquery-30/#id-map-operator&gt; is a relative path expression? Which nodes within trees does it locate?
</I>&gt;<i> 
</I>&gt;<i> Thanks in advance for any enlightenment,
</I>&gt;<i> 
</I>&gt;<i> Jens
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003896.html</link><pubDate>Mon, 09 Jul 2012 01:01:21 GMT</pubDate></item><item><title>  simple map operator
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi,

Can anyone explain to me why the XQuery 3.0 simple map operator &lt;http://www.w3.org/TR/xquery-30/#id-map-operator&gt; is a relative path expression? Which nodes within trees does it locate?

Thanks in advance for any enlightenment,

Jens
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201207/003895.html</link><pubDate>Mon, 09 Jul 2012 00:41:30 GMT</pubDate></item><item><title>  Invitation to connect on LinkedIn
   </title><description><![CDATA[<!--beginarticle-->
<PRE>LinkedIn
------------



I'd like to add you to my professional network on LinkedIn.

- Alice

Alice Wei
Technical Consultant at Indiana University
Bloomington, Indiana Area

Confirm that you know Alice Wei:
https://www.linkedin.com/e/xnupbm-h3muyo7o-28/isd/7546757883/m_IXhCbP/?hs=false&amp;tok=1ClHTo3ERgPBg1

--
You are receiving Invitation to Connect emails. Click to unsubscribe:
http://www.linkedin.com/e/xnupbm-h3muyo7o-28/kDd-YG5BG4ZUACXjkyk-G9jZp24/goo/talk%40x-query%2Ecom/20061/I2558502205_1/?hs=false&amp;tok=2vCMZQeY1gPBg1

(c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: &lt;http://x-query.com/pipermail/talk/attachments/20120619/749b6f02/attachment.html&gt;
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201206/003894.html</link><pubDate>Tue, 19 Jun 2012 03:56:38 GMT</pubDate></item><item><title>  [ANN] BaseX 7.3
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Hi everyone,

we are glad to announce a great new release of BaseX, our XML database
and XPath/XQuery 3.0 processor! Here are the latest features;

- Many new internal XQuery Modules have been added, and existing ones
have been revised to ensure long-term stability of your future XQuery
applications: http://docs.basex.org/wiki/Module_Library

- A new powerful Command API is provided to specify BaseX commands and
scripts as XML: http://docs.basex.org/wiki/Commands#Basics

- The full-text fuzzy index was extended to also support wildcard
queries: http://docs.basex.org/wiki/Full-Text

- The simple map operator of XQuery 3.0 gives you a compact syntax to
process items of sequences: http://docs.basex.org/wiki/XQuery_3.0

- BaseX as Web Application can now start its own server instance:
http://docs.basex.org/wiki/Web_Application

- All command-line options will now be executed in the given order:
http://docs.basex.org/wiki/Startup_Options

- Charles Foster's latest XQJ Driver supports XQuery 3.0 and the
Update and Full Text extensions: http://xqj.net/basex/

As usual, your feedback is welcome. More infos can be found on
http://basex.org.

For those of you in the Northern Hemisphere, we wish you a nice
summer! No worries, we'll stay busy..

Christian
BaseX Team, 2012
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201206/003893.html</link><pubDate>Mon, 18 Jun 2012 09:47:04 GMT</pubDate></item><item><title>  Strong data checking on @xml:id?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>The relevant statement in the spec is XQuery 3.7.1.1 clause 5:

&quot;If the attribute name is xml:id, then xml:id processing is performed as 
defined in [XML ID]. This ensures that the attribute has the type xs:ID 
and that its value is properly normalized. If an error is encountered 
during xml:id processing, an implementation MAY raise a dynamic error 
[err:XQDY0091].&quot;

So yes, the effect is to some extent implementation-defined.

Saxon never raises XQDY0091. It does apply normalize-space() to the 
value, but unless you are validating the result tree, it doesn't 
complain if the value isn't a valid NCName. I'm not sure why I made this 
decision; it's conformant with the spec, but my feeling today would be 
that validating the value (and reporting an error) would be preferable.

Michael Kay
Saxonica

On 08/06/2012 18:55, David Sewell wrote:
&gt;<i> Working within MarkLogic, I just got bitten by a server error caused 
</I>&gt;<i> by lexically invalid @xml:id in the input data. Boiled down, this was 
</I>&gt;<i> the offending query:
</I>&gt;<i>
</I>&gt;<i> let $in := &lt;input xml:id=&quot;-ptr&quot;/&gt;
</I>&gt;<i> return element out {
</I>&gt;<i>   attribute id { $in/@xml:id }
</I>&gt;<i> }
</I>&gt;<i>
</I>&gt;<i> MarkLogic complains: XDMP-LEXVAL: xs:ID(&quot;-ptr&quot;) -- Invalid lexical 
</I>&gt;<i> value &quot;-ptr&quot;
</I>&gt;<i>
</I>&gt;<i> So it is obviously trying to cast '-ptr' as xs:ID and failing. But I
</I>&gt;<i> notice that Saxon doesn't throw an error in this case. Either processor
</I>&gt;<i> is happy if I wrap string() around $in/@xml:id.
</I>&gt;<i>
</I>&gt;<i> I'm just wondering if this is an implementation-dependent matter, or
</I>&gt;<i> what the specs might say about such a case.
</I>&gt;<i>
</I>&gt;<i> David S.
</I>&gt;<i>
</I></PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201206/003892.html</link><pubDate>Fri, 08 Jun 2012 16:00:06 GMT</pubDate></item><item><title>  Strong data checking on @xml:id?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Yes that's because the id table is validating ...
Simple case is the XML is schema invalid.  It needs to be fixed.
Some processors will choke others may not.  But its still bad XML.


----------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.xmlsh.org


&gt;<i> -----Original Message-----
</I>&gt;<i> From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On
</I>&gt;<i> Behalf Of G. Ken Holman
</I>&gt;<i> Sent: Friday, June 08, 2012 2:48 PM
</I>&gt;<i> To: http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> Subject: Re:  Strong data checking on @xml:id?
</I>&gt;<i> 
</I>&gt;<i> At 2012-06-08 18:35 +0000, David Lee wrote:
</I>&gt;<i> &gt;I belive the issue is that of validation.
</I>&gt;<i> &gt;MarkLogic is a validating XQuery parser so is validating xml:id
</I>&gt;<i> &gt;against the standard XML schemas.   &quot;-ptr&quot; is not a valid xml:id
</I>&gt;<i> &gt;
</I>&gt;<i> &gt;Saxon HE (I presume you are using HE), otoh, is not a validating
</I>&gt;<i> &gt;XQuery engine.
</I>&gt;<i> 
</I>&gt;<i> Maybe so, but I did discover recently that Saxon HE does not load the
</I>&gt;<i> id() table when the token is not a valid xml:id value:
</I>&gt;<i> 
</I>&gt;<i> t:\ftemp&gt;type david.xq
</I>&gt;<i> let $in := document { &lt;input xml:id=&quot;abc&quot;/&gt; }
</I>&gt;<i> return ( 'Result with ''abc'':',count($in/id('abc')) ),
</I>&gt;<i> let $in := document { &lt;input xml:id=&quot;-ptr&quot;/&gt; }
</I>&gt;<i> return ( 'Result with ''-ptr'':',count($in/id('-ptr')) )
</I>&gt;<i> 
</I>&gt;<i> t:\ftemp&gt;xquery david.xq
</I>&gt;<i> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;Result with 'abc': 1 Result
</I>&gt;<i> with '-ptr': 0
</I>&gt;<i> 
</I>&gt;<i> t:\ftemp&gt;
</I>&gt;<i> 
</I>&gt;<i> I hope this is helpful.
</I>&gt;<i> 
</I>&gt;<i> . . . . . . . . Ken
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> --
</I>&gt;<i> Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012
</I>&gt;<i> Contact us for world-wide XML consulting and instructor-led training
</I>&gt;<i> Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
</I>&gt;<i> Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/q/
</I>&gt;<i> G. Ken Holman                   mailto:http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> Google+ profile: https://plus.google.com/116832879756988317389/about
</I>&gt;<i> Legal business disclaimers:    http://www.CraneSoftwrights.com/legal
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>


</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201206/003891.html</link><pubDate>Fri, 08 Jun 2012 12:21:59 GMT</pubDate></item><item><title>  Strong data checking on @xml:id?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>At 2012-06-08 18:35 +0000, David Lee wrote:
&gt;<i>I belive the issue is that of validation.
</I>&gt;<i>MarkLogic is a validating XQuery parser so is validating xml:id 
</I>&gt;<i>against the standard XML schemas.   &quot;-ptr&quot; is not a valid xml:id
</I>&gt;<i>
</I>&gt;<i>Saxon HE (I presume you are using HE), otoh, is not a validating 
</I>&gt;<i>XQuery engine.
</I>
Maybe so, but I did discover recently that Saxon HE does not load the 
id() table when the token is not a valid xml:id value:

t:\ftemp&gt;type david.xq
let $in := document { &lt;input xml:id=&quot;abc&quot;/&gt; }
return ( 'Result with ''abc'':',count($in/id('abc')) ),
let $in := document { &lt;input xml:id=&quot;-ptr&quot;/&gt; }
return ( 'Result with ''-ptr'':',count($in/id('-ptr')) )

t:\ftemp&gt;xquery david.xq
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;Result with 'abc': 1 Result 
with '-ptr': 0

t:\ftemp&gt;

I hope this is helpful.

. . . . . . . . Ken


--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012
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:http://x-query.com/mailman/listinfo/talk
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201206/003890.html</link><pubDate>Fri, 08 Jun 2012 11:48:11 GMT</pubDate></item><item><title>  Strong data checking on @xml:id?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>I belive the issue is that of validation.
MarkLogic is a validating XQuery parser so is validating xml:id against the standard XML schemas.   &quot;-ptr&quot; is not a valid xml:id

Saxon HE (I presume you are using HE), otoh, is not a validating XQuery engine.



----------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.xmlsh.org

&gt;<i> -----Original Message-----
</I>&gt;<i> From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On
</I>&gt;<i> Behalf Of David Sewell
</I>&gt;<i> Sent: Friday, June 08, 2012 1:55 PM
</I>&gt;<i> To: http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> Subject:  Strong data checking on @xml:id?
</I>&gt;<i> 
</I>&gt;<i> Working within MarkLogic, I just got bitten by a server error caused by
</I>&gt;<i> lexically invalid @xml:id in the input data. Boiled down, this was the
</I>&gt;<i> offending query:
</I>&gt;<i> 
</I>&gt;<i> let $in := &lt;input xml:id=&quot;-ptr&quot;/&gt;
</I>&gt;<i> return element out {
</I>&gt;<i>    attribute id { $in/@xml:id }
</I>&gt;<i> }
</I>&gt;<i> 
</I>&gt;<i> MarkLogic complains: XDMP-LEXVAL: xs:ID(&quot;-ptr&quot;) -- Invalid lexical value &quot;-ptr&quot;
</I>&gt;<i> 
</I>&gt;<i> So it is obviously trying to cast '-ptr' as xs:ID and failing. But I
</I>&gt;<i> notice that Saxon doesn't throw an error in this case. Either processor
</I>&gt;<i> is happy if I wrap string() around $in/@xml:id.
</I>&gt;<i> 
</I>&gt;<i> I'm just wondering if this is an implementation-dependent matter, or
</I>&gt;<i> what the specs might say about such a case.
</I>&gt;<i> 
</I>&gt;<i> David S.
</I>&gt;<i> 
</I>&gt;<i> --
</I>&gt;<i> David Sewell, Editorial and Technical Manager
</I>&gt;<i> ROTUNDA, The University of Virginia Press
</I>&gt;<i> PO Box 400314, Charlottesville, VA 22904-4314 USA
</I>&gt;<i> Email: http://x-query.com/mailman/listinfo/talk   Tel: +1 434 924 9973
</I>&gt;<i> Web: http://rotunda.upress.virginia.edu/
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>


</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201206/003889.html</link><pubDate>Fri, 08 Jun 2012 11:35:21 GMT</pubDate></item><item><title>  Strong data checking on @xml:id?
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Working within MarkLogic, I just got bitten by a server error caused by 
lexically invalid @xml:id in the input data. Boiled down, this was the 
offending query:

let $in := &lt;input xml:id=&quot;-ptr&quot;/&gt;
return element out {
   attribute id { $in/@xml:id }
}

MarkLogic complains: XDMP-LEXVAL: xs:ID(&quot;-ptr&quot;) -- Invalid lexical value &quot;-ptr&quot;

So it is obviously trying to cast '-ptr' as xs:ID and failing. But I
notice that Saxon doesn't throw an error in this case. Either processor
is happy if I wrap string() around $in/@xml:id.

I'm just wondering if this is an implementation-dependent matter, or
what the specs might say about such a case.

David S.

-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: http://x-query.com/mailman/listinfo/talk   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201206/003888.html</link><pubDate>Fri, 08 Jun 2012 10:55:20 GMT</pubDate></item><item><title>  Help with an XQuery function
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Perfect.  Thank you everyone.

I was a bit confused about using the string-join function, but I just looked it up and it makes sense now.  So, I can call the following with my function, as Liam mentioned:

	string-join(local:xpath($someNode), '')

Or I can use the new built-in function, as David mentioned, replacing any unwanted strings, like so:

	replace(fn:path($name),'\[1\]|Q\{\}','')

It seems like I have a lot more to get used to with XQuery, but I think that I understand things a little bit better now.  Thanks again,

Mark



-----Original Message-----
From: Liam R E Quin [mailto:http://x-query.com/mailman/listinfo/talk] 
Sent: Tuesday, May 15, 2012 12:48 PM
To: Custer, Mark
Cc: xquery-discuss
Subject: Re:  Help with an XQuery function

On Tue, 2012-05-15 at 11:29 -0400, Custer, Mark wrote:
[..]
&gt;<i> This works, but I was wondering if it could be written better (and I 
</I>&gt;<i> imagine that someone already has written a concise XQuery function to 
</I>&gt;<i> do this).
</I>
It might be easier to write it recursively, but clear is better than concise.

&gt;<i>   Also, I'm not entirely sure why, but when I run the above function, 
</I>&gt;<i> I get the following result:
</I>&gt;<i> 
</I>&gt;<i> /a /b /c[3]
</I>
This is because you construct a sequence of strings. Use string-join( your-function(), &quot;&quot;) to fix that.

Or it might be, string-join(&quot;&quot;, your-function()), I never remember, which suggests it's the opposite of the other languages I use :-)

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


</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201205/003887.html</link><pubDate>Tue, 15 May 2012 10:28:44 GMT</pubDate></item><item><title>  Help with an XQuery function
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On Tue, 2012-05-15 at 11:29 -0400, Custer, Mark wrote:
[..]
&gt;<i> This works, but I was wondering if it could be written better (and I
</I>&gt;<i> imagine that someone already has written a concise XQuery function to
</I>&gt;<i> do this).
</I>
It might be easier to write it recursively, but clear is better than
concise.

&gt;<i>   Also, I'm not entirely sure why, but when I run the above function,
</I>&gt;<i> I get the following result:
</I>&gt;<i> 
</I>&gt;<i> /a /b /c[3]
</I>
This is because you construct a sequence of strings. Use
string-join( your-function(), &quot;&quot;)
to fix that.

Or it might be, string-join(&quot;&quot;, your-function()), I never remember,
which suggests it's the opposite of the other languages I use :-)

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

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201205/003886.html</link><pubDate>Tue, 15 May 2012 09:48:14 GMT</pubDate></item><item><title>  Help with an XQuery function
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 15/05/2012 17:02, Custer, Mark wrote:
&gt;<i> Thanks for pointing out the XQuery 3.0 functions, Matthias!
</I>&gt;<i>
</I>&gt;<i> fn:path is indeed supported, but I want a function that will do the same
</I>&gt;<i> as fn:path, minus any of the values of &#8220;[1]&#8221;. Plus, since my current
</I>&gt;<i> crop of documents don&#8217;t have any associated namespaces, the processor
</I>&gt;<i> that I&#8217;m using prepends &#8220;Q{}&#8221; before each path. So, with the previous
</I>&gt;<i> a/b/c example, I get the following:
</I>&gt;<i>
</I>&gt;<i> /Q{}a[1]/Q{}b[1]/Q{}c[3]
</I>&gt;<i>
</I>&gt;<i> But all I want is:
</I>&gt;<i>
</I>&gt;<i> /a/b/c[3]
</I>&gt;<i>
</I>&gt;<i> I&#8217;ll try working on it again later. Thanks again,
</I>&gt;<i>
</I>&gt;<i> Mark
</I>

sounds like

replace(path(),'\[1\]|Q{}','')

will do what you want.

David

-- 
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. 
________________________________________________________________________
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201205/003885.html</link><pubDate>Tue, 15 May 2012 09:12:40 GMT</pubDate></item><item><title>  Setting the document URI on constructed   nodes.
   </title><description><![CDATA[<!--beginarticle-->
<PRE>At 2012-05-13 10:19 -0400, I wrote:
&gt;<i>I cannot think of any way in the spec to specify the document URI of 
</I>&gt;<i>a temporary in-memory tree, because I don't think that is meaningful 
</I>&gt;<i>in the general case.
</I>&gt;<i>
</I>&gt;<i>However, when I've chained transformations in the past, I've 
</I>&gt;<i>sometimes needed to preserve the input document URI along all of the 
</I>&gt;<i>steps (because there have been relative URI addresses in the data) 
</I>&gt;<i>and so I've very simply used xml:base= on the document element of 
</I>&gt;<i>the temporary tree (unless the document element already has an 
</I>&gt;<i>xml:base= attribute).
</I>&gt;<i>
</I>&gt;<i>Remember that from a syntax perspective, the root document file 
</I>&gt;<i>entity of an XML document must contain the document element, so 
</I>&gt;<i>base-uri(/*) is always the same as document-uri(root()) when there 
</I>&gt;<i>is no xml:base= already there on the document element.
</I>&gt;<i>
</I>&gt;<i>So, when I create a temporary tree I use:
</I>&gt;<i>
</I>&gt;<i>   &lt;root xml:base=&quot;...whatever...&quot;/&gt;
</I>&gt;<i>
</I>&gt;<i>... and when I ask for base-uri(/*) I get &quot;...whatever...&quot;.
</I>&gt;<i>
</I>&gt;<i>In my work I would do something along the lines of:
</I>&gt;<i>
</I>&gt;<i>let $d := doc(&quot;input.xml&quot;) return
</I>&gt;<i>element {$d/name(.)}
</I>&gt;<i>  {
</I>&gt;<i>   attribute xml:base { &quot;...whatever...&quot; },
</I>&gt;<i>   $d/@xml:base, (:in case there already exists one:)
</I>&gt;<i>   &quot;rest of the processing&quot;
</I>&gt;<i>  }
</I>
Actually, two mistakes in throwing together that example.  I was 
asking for the name of the root node (not the document element) and I 
wouldn't hard-code the xml:base value.  Rather I'd use the 
document-uri() function to preserve the URI of the input file, or 
even shorten it further by using base-uri() on the document element 
so as to accommodate any existing xml:base= attribute:

let $d := doc(&quot;input.xml&quot;) return
element {$d/*/name(.)}
  {
   attribute xml:base { base-uri($d/*) },
   &quot;rest of the processing&quot;
  }

&gt;<i>I hope this helps.
</I>&gt;<i>
</I>&gt;<i>. . . . . . . . . . . Ken
</I>&gt;<i>
</I>&gt;<i>At 2012-05-13 13:58 +0000, David Lee wrote:
</I>&gt;&gt;<i>I noticed somewhat of a hole in XQuery ... hoping I am wrong.
</I>&gt;&gt;<i>I can find no way to set the base URI of a constructed document e.g
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>document {  &lt;root/&gt; }
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>such that fn:document-uri() would return it.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>It seem this is one of those properties that must come from the 
</I>&gt;&gt;<i>outside environment.
</I>&gt;&gt;<i>I know if I were to store the document to a file then re-read it, 
</I>&gt;&gt;<i>likely the XML processor would pick it up ... I also know how to do 
</I>&gt;&gt;<i>this programmatically in API's like say Saxon.
</I>&gt;&gt;<i>But it seems missing from XQuery itself.   My guess is that since 
</I>&gt;&gt;<i>XQuery doesnt support storing documents it was thought unimportant 
</I>&gt;&gt;<i>to set the document URI.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>Why I ask ?
</I>&gt;&gt;<i>I'm still looking at Streaming XDM formats, including pure 
</I>&gt;&gt;<i>in-memory streaming.
</I>&gt;&gt;<i>But it seems like I cannot directly encode and pass on a document 
</I>&gt;&gt;<i>(or base) URI through XQuery by itself to the output.   So any 
</I>&gt;&gt;<i>constructed documents would have none or undefined URI's to the 
</I>&gt;&gt;<i>receiver.   this leads me to think I need a meta encoding for XDM 
</I>&gt;&gt;<i>much like proposed at Balisage (XDML).   basically passing the URI 
</I>&gt;&gt;<i>information as seperate XDM values and a convention for 
</I>&gt;&gt;<i>interpreting them.  This seems like it could not be done in pure 
</I>&gt;&gt;<i>XQuery however because the target even if it got say  a sequence ( 
</I>&gt;&gt;<i>&quot;uri&quot; , document ) has no way to apply the uri to the document 
</I>&gt;&gt;<i>using XQuery so it must be done by external code.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>Thanks for any commentary.
</I>&gt;&gt;<i>-David
</I>

--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012
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:http://x-query.com/mailman/listinfo/talk
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal

</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201205/003884.html</link><pubDate>Sun, 13 May 2012 09:26:34 GMT</pubDate></item><item><title>  Setting the document URI on constructed  nodes.
   </title><description><![CDATA[<!--beginarticle-->
<PRE>I cannot think of any way in the spec to specify the document URI of 
a temporary in-memory tree, because I don't think that is meaningful 
in the general case.

However, when I've chained transformations in the past, I've 
sometimes needed to preserve the input document URI along all of the 
steps (because there have been relative URI addresses in the data) 
and so I've very simply used xml:base= on the document element of the 
temporary tree (unless the document element already has an xml:base= 
attribute).

Remember that from a syntax perspective, the root document file 
entity of an XML document must contain the document element, so 
base-uri(/*) is always the same as document-uri(root()) when there is 
no xml:base= already there on the document element.

So, when I create a temporary tree I use:

   &lt;root xml:base=&quot;...whatever...&quot;/&gt;

... and when I ask for base-uri(/*) I get &quot;...whatever...&quot;.

In my work I would do something along the lines of:

let $d := doc(&quot;input.xml&quot;) return
element {$d/name(.)}
  {
   attribute xml:base { &quot;...whatever...&quot; },
   $d/@xml:base, (:in case there already exists one:)
   &quot;rest of the processing&quot;
  }

I hope this helps.

. . . . . . . . . . . Ken

At 2012-05-13 13:58 +0000, David Lee wrote:
&gt;<i>I noticed somewhat of a hole in XQuery ... hoping I am wrong.
</I>&gt;<i>I can find no way to set the base URI of a constructed document e.g
</I>&gt;<i>
</I>&gt;<i>document {  &lt;root/&gt; }
</I>&gt;<i>
</I>&gt;<i>such that fn:document-uri() would return it.
</I>&gt;<i>
</I>&gt;<i>It seem this is one of those properties that must come from the 
</I>&gt;<i>outside environment.
</I>&gt;<i>I know if I were to store the document to a file then re-read it, 
</I>&gt;<i>likely the XML processor would pick it up ... I also know how to do 
</I>&gt;<i>this programmatically in API's like say Saxon.
</I>&gt;<i>But it seems missing from XQuery itself.   My guess is that since 
</I>&gt;<i>XQuery doesnt support storing documents it was thought unimportant 
</I>&gt;<i>to set the document URI.
</I>&gt;<i>
</I>&gt;<i>Why I ask ?
</I>&gt;<i>I'm still looking at Streaming XDM formats, including pure in-memory 
</I>&gt;<i>streaming.
</I>&gt;<i>But it seems like I cannot directly encode and pass on a document 
</I>&gt;<i>(or base) URI through XQuery by itself to the output.   So any 
</I>&gt;<i>constructed documents would have none or undefined URI's to the 
</I>&gt;<i>receiver.   this leads me to think I need a meta encoding for XDM 
</I>&gt;<i>much like proposed at Balisage (XDML).   basically passing the URI 
</I>&gt;<i>information as seperate XDM values and a convention for interpreting 
</I>&gt;<i>them.  This seems like it could not be done in pure XQuery however 
</I>&gt;<i>because the target even if it got say  a sequence ( &quot;uri&quot; , document 
</I>&gt;<i>) has no way to apply the uri to the document using XQuery so it 
</I>&gt;<i>must be done by external code.
</I>&gt;<i>
</I>&gt;<i>Thanks for any commentary.
</I>&gt;<i>-David
</I>&gt;<i>
</I>

--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012
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:http://x-query.com/mailman/listinfo/talk
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201205/003883.html</link><pubDate>Sun, 13 May 2012 07:19:47 GMT</pubDate></item><item><title>  5 summer interns for the FLWOR Foundation
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Dear all,

The XML community has spend oozes of time building languages, technology and platform software, that are at this time
sufficiently mature.

 It's time now to build more killer apps in order to make people aware of what could be achieved using this technology.

The FLOWR foundation is looking for 5 summer interns with XML, XQuery, database and application 
development knowledge, with creativity and initiative, to build a series of XML-only information intensive 
web applications. The position offers between  3 and 6 month of competitive salary (length depending of the complexity of 
the application to be developed), and it is located in Palo Alto, CA, the heart of Sillicon Valley (part of the internship can be done
remotely, but not entirely).

In addition to the XML technologies, the internship will provide in depth knowledge in database cloud computing,  NOSQL,
full text search, complex optimization of large information processing platforms.

Please contact me for more information.

Finally, if anybody on this mailing list has an interesting idea about such an application, we are more then happy to
investigate financing the development (in open source only ! ).

Best regards
Dana



</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201205/003882.html</link><pubDate>Mon, 07 May 2012 11:45:38 GMT</pubDate></item><item><title>  talk
   </title><description><![CDATA[<!--beginarticle-->
<PRE>hello talk all of the goals you have set for yourself are reachable stop what youre doing http://t.co/GA6RznIL

</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201204/003881.html</link><pubDate>Sat, 28 Apr 2012 22:32:31 GMT</pubDate></item><item><title>  [ANN] BaseX 7.2.1: The Spring Edition
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Dear all,

once more, we are proud to announce a new version of BaseX!
And once more, we can provide you with a whole bunch of
new features:

* Our value indexes now support string-based range queries:
&#160;http://docs.basex.org/wiki/Indexes#Value_Indexes
&#160;A big thank you to our sponsors who made this possible!

* Our new XQJ API is based on Charles Foster's implementation.
&#160;It fully utilizes the client/server architecture:
&#160;http://xqj.net/basex

* Import of XQuery modules has been simplified:
&#160;http://docs.basex.org/wiki/Repository

* Simplified invocation of Java code from XQuery:
&#160;http://docs.basex.org/wiki/Java_Bindings

* Full support for the XQuery 3.0 Regular Expressions syntax:
&#160;http://www.w3.org/TR/xpath-functions-30/#regex-syntax

* Updating functions can now return values:
&#160;http://docs.basex.org/wiki/Database_Module#db:output

* Unified handling of document and database URIs:
&#160;http://docs.basex.org/wiki/Databases#Access_Resources

* Pinning of opened database replaced by filesystem locking:
&#160;http://docs.basex.org/wiki/Transaction_Management#Locking

* REST, RESTXQ, WebDav: concurrency issues fixed

As usual, we are looking to your feedback. Have fun,

Christian
BaseX Team
http://basex.org

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201204/003880.html</link><pubDate>Fri, 27 Apr 2012 08:35:45 GMT</pubDate></item><item><title>  XML and the US Congress
   </title><description><![CDATA[<!--beginarticle-->
<PRE>In addition to NIEM.gov, Wikipedia has a very good NIEM overview page:
http://en.wikipedia.org/wiki/National_Information_Exchange_Model

As for agency adoption, you can get an idea from the 13 &quot;domains&quot; currently participating in NIEM:
https://www.niem.gov/faq/Pages/what-domains-are-currently-participating-in-niem.aspx

The US Federal CIO Council published a report in June 2010 that some may find informative:
AGENCY INFORMATION EXCHANGE FUNCTIONAL STANDARDS EVALUATION:
Adoption and Use of the NATIONAL INFORMATION EXCHANGE MODEL https://www.niem.gov/documentsdb/Documents/Other/AssessmentReport.pdf

For those wanting to see how exchanges are modeled and implemented in NIEM, I recommend a 4-article series written by Priscilla Walmsley, a very familiar name to many of you:
Creating a NIEM IEPD
http://www.ibm.com/developerworks/xml/library/x-NIEM1/index.html

Finally, the NIEM Naming and Design Rules share similarities with other NDRs such as those for UBL and UNCEFACT standards.
https://www.niem.gov/documentsdb/Documents/Technical/NIEM-NDR-1-3.pdf
Standards such as ISO/IEC 11179 (parts 4 &amp; 5) and CCTS were leveraged too.

Ken Sall
Data Architect / Sr. XML Data Analyst
202-261-9045 (office)
410-952-2076 (cell)
http://x-query.com/mailman/listinfo/talk

&gt;<i> -----Original Message-----
</I>&gt;<i> From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On
</I>&gt;<i> Behalf Of daniela florescu
</I>&gt;<i> Sent: Sunday, April 22, 2012 4:02 PM
</I>&gt;<i> To: Michael Sokolov
</I>&gt;<i> Cc: XQuery Talk ML; Andrew Welch
</I>&gt;<i> Subject: Re:  XML and the US Congress
</I>&gt;<i> 
</I>&gt;<i> MIchael,
</I>&gt;<i> 
</I>&gt;<i> while XML isn't obviously the panacea for the world's evil, I don't
</I>&gt;<i> think anybody can deny the fact that a uniform use of XML through the
</I>&gt;<i> IT layers would allow MUCH more information to flow among participants.
</I>&gt;<i> 
</I>&gt;<i> And that can be golden in many circumstances...
</I>&gt;<i> 
</I>&gt;<i> Best
</I>&gt;<i> Dana
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> On Apr 22, 2012, at 12:56 PM, Michael Sokolov wrote:
</I>&gt;<i> 
</I>&gt;<i> &gt; I love how her eyes light up when she says &quot;XML&quot; as if - how could it
</I>&gt;<i> be simpler for those poor, underfunded state and local governments?
</I>&gt;<i> All they have to do is put XML behind, under and through the PDF!
</I>&gt;<i> Maybe we've hit on the solution for underfunded government programs at
</I>&gt;<i> last - just interlard them with XML - and hey presto! - you've got
</I>&gt;<i> compliance, or whatever it was she's supposed to be talking about.
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; -Mike
</I>&gt;<i> &gt;
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; On 4/20/2012 3:34 PM, daniela florescu wrote:
</I>&gt;<i> &gt;&gt; :-)
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; http://pinarbilgin.wordpress.com/2011/08/13/what-ginger-hears/
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt; On Apr 20, 2012, at 12:14 PM, Andrew Welch wrote:
</I>&gt;<i> &gt;&gt;
</I>&gt;<i> &gt;&gt;&gt; On 20 April 2012 18:36, daniela florescu&lt;http://x-query.com/mailman/listinfo/talk&gt;  wrote:
</I>&gt;<i> &gt;&gt;&gt;&gt;
</I>&gt;<i> http://www.youtube.com/watch?v=P65skr3OiXk&amp;feature=plcp&amp;context=C4a
</I>&gt;<i> &gt;&gt;&gt;&gt; b6fefVDvjVQa1PpcFNiJcNuH75TWCzgaADQ6XFKPxMyj5siNfc%3D
</I>&gt;<i> &gt;&gt;&gt; I heard &quot;blah blah blah embed xml in this pdf blah blah&quot;...
</I>&gt;<i> &gt;&gt;&gt;
</I>&gt;<i> &gt;&gt;&gt;
</I>&gt;<i> &gt;&gt;&gt;
</I>&gt;<i> &gt;&gt;&gt; --
</I>&gt;<i> &gt;&gt;&gt; Andrew Welch
</I>&gt;<i> &gt;&gt;&gt; http://andrewjwelch.com
</I>&gt;<i> &gt;&gt; _______________________________________________
</I>&gt;<i> &gt;&gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> &gt;&gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; _______________________________________________
</I>&gt;<i> &gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> &gt; http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201204/003879.html</link><pubDate>Mon, 23 Apr 2012 12:30:04 GMT</pubDate></item><item><title>  XML and the US Congress
   </title><description><![CDATA[<!--beginarticle-->
<PRE>I thought the best bit was her waving a piece of printed paper and 
saying &quot;this is a PDF&quot;. But when she said it had XML behind it, I was 
disappointed that she didn't turn it over and show us that there were 
angle brackets printed on the other side of the sheet.

Mike

On 22/04/2012 20:56, Michael Sokolov wrote:
&gt;<i> I love how her eyes light up when she says &quot;XML&quot; as if - how could it 
</I>&gt;<i> be simpler for those poor, underfunded state and local governments?  
</I>&gt;<i> All they have to do is put XML behind, under and through the PDF!  
</I>&gt;<i> Maybe we've hit on the solution for underfunded government programs at 
</I>&gt;<i> last - just interlard them with XML - and hey presto! - you've got 
</I>&gt;<i> compliance, or whatever it was she's supposed to be talking about.
</I>&gt;<i>
</I>&gt;<i> -Mike
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> On 4/20/2012 3:34 PM, daniela florescu wrote:
</I>&gt;&gt;<i> :-)
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> http://pinarbilgin.wordpress.com/2011/08/13/what-ginger-hears/
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> On Apr 20, 2012, at 12:14 PM, Andrew Welch wrote:
</I>&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> On 20 April 2012 18:36, daniela florescu&lt;http://x-query.com/mailman/listinfo/talk&gt;  wrote:
</I>&gt;&gt;&gt;&gt;<i> http://www.youtube.com/watch?v=P65skr3OiXk&amp;feature=plcp&amp;context=C4ab6fefVDvjVQa1PpcFNiJcNuH75TWCzgaADQ6XFKPxMyj5siNfc%3D 
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> I heard &quot;blah blah blah embed xml in this pdf blah blah&quot;...
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> -- 
</I>&gt;&gt;&gt;<i> Andrew Welch
</I>&gt;&gt;&gt;<i> http://andrewjwelch.com
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i>
</I></PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201204/003878.html</link><pubDate>Mon, 23 Apr 2012 01:07:32 GMT</pubDate></item><item><title>  XML and the US Congress
   </title><description><![CDATA[<!--beginarticle-->
<PRE>On 4/22/2012 4:02 PM, daniela florescu wrote:
&gt;<i> MIchael,
</I>&gt;<i>
</I>&gt;<i> while XML isn't obviously the panacea for the world's evil, I don't think anybody can deny the fact that a uniform use
</I>&gt;<i> of XML through the IT layers would allow MUCH more information to flow among participants.
</I>&gt;<i>
</I>&gt;<i> And that can be golden in many circumstances...
</I>&gt;<i>
</I>&gt;<i> Best
</I>&gt;<i> Dana
</I>&gt;<i>
</I>Oh I completely agree.  A standardized XML format (is it NEIM?) will be 
far more useful in many ways than mere PDFs, I'm sure.  I just think 
it's a bit funny how the effort required from the information 
*providers* tends to get glossed over.  I don't really know much about 
the adoption of this standard - I just know that starting from PDF, 
generating useful XML is a nontrivial task.

-Mike
</PRE>



]]></description><link>http://www.stylusstudio.com/xquerytalk/201204/003877.html</link><pubDate>Sun, 22 Apr 2012 15:16:58 GMT</pubDate></item><item><title>  XML and the US Congress
   </title><description><![CDATA[<!--beginarticle-->
<PRE>Another note: She is advocating NEIM.  It is a set of standards for tags within an XML document.

On Apr 22, 2012, at 3:02 PM, daniela florescu &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:

&gt;<i> MIchael,
</I>&gt;<i> 
</I>&gt;<i> while XML isn't obviously the panacea for the world's evil, I don't think anybody can deny the fact that a uniform use
</I>&gt;<i> of XML through the IT layers would allow MUCH more information to flow among participants.
</I>&gt;<i> 
</I>&gt;<i> And that can be golden in many circumstances...
</I>&gt;<i> 
</I>&gt;<i> Best
</I>&gt;<i> Dana
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> On Apr 22, 2012, at 12:56 PM, Michael Sokolov wrote:
</I>&gt;<i> 
</I>&gt;&gt;<i> I love how her eyes light up when she says &quot;XML&quot; as if - how could it be simpler for those poor, underfunded state and local governments?  All they have to do is put XML behind, under and through the PDF!  Maybe we've hit on the solution for underfunded government programs at last - just interlard them with XML - and hey presto! - you've got compliance, or whatever it was she's supposed to be talking about.
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> -Mike
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> On 4/20/2012 3:34 PM, daniela florescu wrote:
</I>&gt;&gt;&gt;<i> :-)
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> http://pinarbilgin.wordpress.com/2011/08/13/what-ginger-hears/
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> On Apr 20, 2012, at 12:14 PM, Andrew Welch wrote:
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;&gt;<i> On 20 April 2012 18:36, daniela florescu&lt;http://x-query.com/mailman/listinfo/talk&gt;  wrote:
</I>&gt;&gt;&gt;&gt;&gt;<i> http://www.youtube.com/watch?v=P65skr3OiXk&amp;feature=plcp&amp;context=C4ab6fefVDvjVQa1PpcFNiJcNuH75TWCzgaADQ6XFKPxMyj5siNfc%3D
</I>&gt;&gt;&gt;&gt;<i> I heard &quot;blah blah blah embed xml in this pdf blah blah&quot;...
</I>&gt;&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;&gt;<i> -- 
</I>&gt;&gt;&gt;&gt;<i> Andrew Welch
</I>&gt;&gt;&gt;&gt;<i> http://andrewjwelch.com
</I>&gt;&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>

</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201204/003876.html</link><pubDate>Sun, 22 Apr 2012 13:33:09 GMT</pubDate></item><item><title>  XML and the US Congress
   </title><description><![CDATA[<!--beginarticle-->
<PRE>MIchael,

while XML isn't obviously the panacea for the world's evil, I don't think anybody can deny the fact that a uniform use
of XML through the IT layers would allow MUCH more information to flow among participants.

And that can be golden in many circumstances...

Best
Dana



On Apr 22, 2012, at 12:56 PM, Michael Sokolov wrote:

&gt;<i> I love how her eyes light up when she says &quot;XML&quot; as if - how could it be simpler for those poor, underfunded state and local governments?  All they have to do is put XML behind, under and through the PDF!  Maybe we've hit on the solution for underfunded government programs at last - just interlard them with XML - and hey presto! - you've got compliance, or whatever it was she's supposed to be talking about.
</I>&gt;<i> 
</I>&gt;<i> -Mike
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> On 4/20/2012 3:34 PM, daniela florescu wrote:
</I>&gt;&gt;<i> :-)
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> http://pinarbilgin.wordpress.com/2011/08/13/what-ginger-hears/
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> 
</I>&gt;&gt;<i> On Apr 20, 2012, at 12:14 PM, Andrew Welch wrote:
</I>&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> On 20 April 2012 18:36, daniela florescu&lt;http://x-query.com/mailman/listinfo/talk&gt;  wrote:
</I>&gt;&gt;&gt;&gt;<i> http://www.youtube.com/watch?v=P65skr3OiXk&amp;feature=plcp&amp;context=C4ab6fefVDvjVQa1PpcFNiJcNuH75TWCzgaADQ6XFKPxMyj5siNfc%3D
</I>&gt;&gt;&gt;<i> I heard &quot;blah blah blah embed xml in this pdf blah blah&quot;...
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> 
</I>&gt;&gt;&gt;<i> -- 
</I>&gt;&gt;&gt;<i> Andrew Welch
</I>&gt;&gt;&gt;<i> http://andrewjwelch.com
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> 
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201204/003875.html</link><pubDate>Sun, 22 Apr 2012 13:02:23 GMT</pubDate></item><item><title>  XML and the US Congress
   </title><description><![CDATA[<!--beginarticle-->
<PRE>I love how her eyes light up when she says &quot;XML&quot; as if - how could it be 
simpler for those poor, underfunded state and local governments?  All 
they have to do is put XML behind, under and through the PDF!  Maybe 
we've hit on the solution for underfunded government programs at last - 
just interlard them with XML - and hey presto! - you've got compliance, 
or whatever it was she's supposed to be talking about.

-Mike


On 4/20/2012 3:34 PM, daniela florescu wrote:
&gt;<i> :-)
</I>&gt;<i>
</I>&gt;<i> http://pinarbilgin.wordpress.com/2011/08/13/what-ginger-hears/
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> On Apr 20, 2012, at 12:14 PM, Andrew Welch wrote:
</I>&gt;<i>
</I>&gt;&gt;<i> On 20 April 2012 18:36, daniela florescu&lt;http://x-query.com/mailman/listinfo/talk&gt;  wrote:
</I>&gt;&gt;&gt;<i> http://www.youtube.com/watch?v=P65skr3OiXk&amp;feature=plcp&amp;context=C4ab6fefVDvjVQa1PpcFNiJcNuH75TWCzgaADQ6XFKPxMyj5siNfc%3D
</I>&gt;&gt;<i> I heard &quot;blah blah blah embed xml in this pdf blah blah&quot;...
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> -- 
</I>&gt;&gt;<i> Andrew Welch
</I>&gt;&gt;<i> http://andrewjwelch.com
</I>&gt;<i> _______________________________________________
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>&gt;<i> http://x-query.com/mailman/listinfo/talk
</I>
</PRE>


]]></description><link>http://www.stylusstudio.com/xquerytalk/201204/003874.html</link><pubDate>Sun, 22 Apr 2012 12:56:39 GMT</pubDate></item><item><title>  XML and the US Congress
   </title><description><![CDATA[<!--beginarticle-->
<PRE>:<i>-)
</I>
http://pinarbilgin.wordpress.com/2011/08/13/what-ginger-hears/


On Apr 20, 2012, at 12:14 PM, Andrew Welch wrote:

&gt;<i> On 20 April 2012 18:36, daniela florescu &lt;http://x-query.com/mailman/listinfo/talk&gt; wrote:
</I>&gt;&gt;<i> http://www.youtube.com/watch?v=P65skr3OiXk&amp;feature=plcp&amp;context=C4ab6fefVDvjVQa1PpcFNiJcNuH75TWCzgaADQ6XFKPxMyj5siNfc%3D
</I>&gt;<i> 
</I>&gt;<i> I heard &quot;blah blah blah embed xml in this pdf blah blah&quot;...
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> -- 
</I>&gt;<i> Andrew Welch
</I>&gt;<i> http://andrewjwelch.com
</I>
</PRE>

]]></description><link>http://www.stylusstudio.com/xquerytalk/201204/003873.html</link><pubDate>Fri, 20 Apr 2012 12:34:15 GMT</pubDate></item></channel></rss>