Category Archives: Utility

ordering results

> Another nasty hack you could apply (if your return clause returns a single > item) is: While we are with nasty hacks, what about (assuming you know your input is e.g. only ASCII ): for $x in … order by if ($reverse) then translate(lower-case($x/key), ‘abcdefg…xyz0123456789′, ‘zyx…gfedcba9876543210′) else $x/key return $x Which is of course both a dirty hack and i18n averse.

See original here:
ordering results

Fwd: Filtering Problem

Hi Greg, How about declaratively building a two-dimensional boolean table (one value for each document and each find entry) and then filter those lines that only have true values? For example, it could look like the following query, provided $searchDocs and $find are defined (it can probably be simplified further): let $booleans := { for $doc at $d in $searchDocs return { for $f in $find return {count($doc/ent[@type = $f/@type]) > = $f/@count} } } for $d in 1 to count($searchDocs) where every $b in $booleans/document[@id=$d]/value satisfies xs:boolean($b) return $searchDocs[$d] Kind regards, Ghislain

See more here:
Fwd: Filtering Problem

[ANN] XQuery and XPath Full Text Test Suite version 1.0.2

The W3C ‘s XML Query Working Group and XSL Working Group are pleased to announce the availability of version 1.0.2 of the XQuery and XPath Full Text Test Suite (XQFTTS) at http://dev.w3.org/2007/xpath-full-text-10-test-suite/ The tests suite contains information about how to run the test suite and how to submit the results (anonymously, if you desire). XQFTTS 1.0.2 fixes two small bugs reported against XQFTTS 1.0.1.

Visit link:
[ANN] XQuery and XPath Full Text Test Suite version
1.0.2

[Newbie] What are the filename suffixes for XQuery files? For XQuery Update files?

At 2010-04-07 17:29 +0100, Adam Retter wrote: > > Come to think of it, it would make sense to give library modules > a different > > extension since they aren’t directly useable as a query. That way looking > > in a directory I would know “.xq” could be used directly but > “.xql” couldn’t > > be used directly because it doesn’t include a query, only declarations.

View post:
[Newbie] What are the filename suffixes for
XQuery files? For XQuery Update files?

Announce: Early-bird date extended for XSLT/XQuery training [XML-Dev]

Just a short note that the early-bird date for discounted registration for the upcoming North America west-coast XSLT / XQuery training is now April 12, 2010. The training is at the Mark Logic headquarters in San Carlos, CA April 26-30, 2010, the week before the developer conference: West-coast North America: April 26-30, 2010 – San Francisco area http://www.CraneSoftwrights.com/index.html#Crane201004MLC East-coast North America: May 10-14, 2010 – Ottawa, Canada http://www.CraneSoftwrights.com/index.html#Crane201005YOW Europe: June 7-11, 2010 – Trondheim, Norway http://www.CraneSoftwrights.com/index.html#Crane201006TRD Thanks! Have a happy Easter! . .

More here:
Announce: Early-bird date extended for XSLT/XQuery
training [XML-Dev]

[Newbie] Output contains space around each value — how do I delete the space?

At 2010-04-03 10:05 -0400, Costello, Roger L. wrote: > I have an XQuery that extracts all the data in a bookstore XML > document and formats the output as slash-delimited values. Here’s my XQuery: > > ——————————————————- > declare namespace saxon = “http://saxon.sf.net/”; > declare option saxon:output “indent=no”; > declare option saxon:output “method=text”; > > let $source := doc(“bookstore.xml”) > > return > ( > string($source/bookstore/@storename), > ” > “, > for $i in $source// book return > ( > string($i/title), > “/”, > string($i/author[1]), > “/”, > string($i/date), > “/”, > string($i/ISBN), > “/”, > string($i/ publisher ), > “/”, > string($i/cost[@currency='USD']), > ” > ” > ) > ) > ——————————————————- > > The XQuery does almost exactly what I desire.

Read this article:
[Newbie] Output contains space around each
value — how do I delete the space?

[Newbie] Can XQuery produce non-XML output?

Hi Folks, Every time I run an XQuery , the output has an XML declaration at the top, even if the output is not XML, e.g., The ABC Book Store The Origin of Wealth / Eric D. Beinhocker / 2006 / 1-57851-777-X / Harvard Business School Press / 29.95 DOM Scripting / Jeremy Keith / 2005 / 1-59059-533-5 / friends of ed / 34.99 Guns, Germs, and Steel / Jared Diamond / 2005 / 0-393-06131-0 / W

Read more here:
[Newbie] Can XQuery produce non-XML output?

XQuery and ACID transactions WAS Re: from Where 2.0

> If the XML community is slow and refuses to understand the > needs of the database community, and the need to evolve > faster, what can I say, many database people left already > XML, and I guess many more will leave the boat. In Prague it was said quite nicely: the value of standards is in its implementations (or something like that). I believe Sharon Adler was the first to mention this.

Read more:
XQuery and ACID transactions WAS Re: from Where 2.0