Questions tagged [xquery-3.0]

Use this tag for questions specific to XQuery version 3.0 and no other version.

XQuery 3.0 introduces the following new features:

  • Functions are first-class items which can be passed as parameters to other functions

  • Functions and variables support public and private annotations

  • Union types are allowed in function arguments

  • XML Schema 1.1 is supported

  • Clauses added to FLWOR expressions:

    • group by: assigns tuples in the input tuple stream to a group, returns a tuple for each group

    • tumbling window: destructing assignment of a sequence during iteration without intersection

    • sliding window: destructing assignment of a sequence during iteration with intersection

    • count clause: binds a variable to the position in each tuple in the tuple stream

    • allowing empty: facilitates outer joins as in SQL

  • decimal format declaration: adds a decimal format to the statically known decimal formats

  • try/catch expressions: allows for user defined recovery from errors

  • switch expressions: allows for user defined branching logic

References

159 questions
0
votes
1 answer

Is there a method to invoke xQuery function from a textlist using saxon?

I have the below XML ActivateAAA_Account holaaalib:activate($csmHeader, $component, $taskName,…
pavloskkr
  • 1
  • 1
0
votes
1 answer

Using global map variable with BaseX collection

I'm using BaseX (v9.3.2) XQuery v3.1. I have a XQuery script that evaluates all XML files in a BaseX collection. The collection has about 100 files, each one with a size between 30MB to 1.5GB and with the same XSD schema. The script for better…
user5924595
0
votes
1 answer

How to retrieve largest value from duplicate nodes in XQuery?

I have an XML file. I wanted to retrieve the largest value node from the duplicate values (in the case below, author, title, and genre fields are the same, but the number field is different).
0
votes
0 answers

No updating expression error while updating databse (BaseX)

I am using BaseX version 8.6.6 i am getting the error " expression must all be updating or return empty sequence" while updating database below is the code: declare %private %updating function local:ingest-job() { let $contentpath :=…
Manish Joisar
  • 1,256
  • 3
  • 23
  • 47
0
votes
0 answers

XQuery: Using xs:time($arg) vs cast as xs:time

In one of my projects I'm using XQuery 3.0 Saxon HE 9.8 (transitive because of Camel) Spring Boot 2.1.0 Apache Camel 2.22.0 I consume a XML message in which the following element occurs: As you can see it is empty…
the hand of NOD
  • 1,639
  • 1
  • 18
  • 30
0
votes
2 answers

eXist-db REST GET request for dynamic pdf - cannot read source file

(eXist 4.4, XQuery 3.1) I offer the user the ability to download PDF documents which are dynamically created at the moment of request. The request has two parameters: the document name (ie doc=MS609-0002.pdf) and the document language version (ie…
jbrehr
  • 775
  • 6
  • 19
0
votes
1 answer

building dynamic XSLT in XQuery - using HTML passed into parameter

In XQuery 3.1 I am dynamically creating an XSLT 2.0 stylesheet to transform a tei-xml document into HTML. In XQuery, I create a variable $docdate to store an HTML span: 2018-12-10 Then I pass this to a…
jbrehr
  • 775
  • 6
  • 19
0
votes
1 answer

XPATH 2.0 collection() with "?select=" (in eXist-db / XQuery)

Using XPath 2.0 in eXist 4.4 and XQuery. I have a series of documents in eXist-db directory /db/apps/deheresi/data which I want to retrieve with collection(), but using a wildcard or predicate to filter specifically-named documents. For example, I'd…
jbrehr
  • 775
  • 6
  • 19
0
votes
1 answer

eXist-DB / XQuery StringValue cannot be cast to AnyURIValue (using compression:zip)

In eXist 4.4/XQuery 3.1, I am building a function to compress a number of xml files into a zip using compression:zip. I have one function which collects all the URIs for the documents to be compressed, schedule:get-document-uris-for-zip(xmlid as…
jbrehr
  • 775
  • 6
  • 19
0
votes
1 answer

XQuery - replace empty element with a text value (on output to HTML)

I have nodes like these across a collection of xml:tei documents: [...] Willelmum de Canast-Brus
jbrehr
  • 775
  • 6
  • 19
0
votes
1 answer

XQuery and XPath - testing for child/attribute based on current attribute

I have numerous xml files structured Where is optional. Now in Xpath/Xquery 3.1, I need test for the existence of…
jbrehr
  • 775
  • 6
  • 19
0
votes
1 answer

number inside [] after in orderby in XQuery

Following is the query for $x in $books where $x/price>=38 order by ($x/price)[l] return ($x/title, $x/price) what is denoted by [1] located after order by($x/price)?
0
votes
1 answer

XQuery switch testing node

In XQuery 3.1 this (test) query checks for the presence of certain nodes by checking the name(): declare variable $doc := doc("/db/apps/deheresi/data/ms609_0013.xml")); let $ele := $doc//tei:sic | $doc//tei:surplus for $n in $ele let $output…
jbrehr
  • 775
  • 6
  • 19
0
votes
0 answers

eXist-db XQuery - XSLT transformation produces no result despite valid files and no errors

EDIT: solved - incorrect path to the XML document. I'll leave this embarrassing question up in the hope that it may help others. Environment: eXist-db 4.2.1 , XQuery 3.1, XSLT 2.0 I am building a webpage from a number of templates in eXist-DB, the…
jbrehr
  • 775
  • 6
  • 19
0
votes
2 answers