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
3
votes
1 answer

Xquery Node returns HTML code and browser don't read it

I have a XML code looking like this: <div style="text-align: justify;">El Casino de Asturias alberga una sala polivalente para cualquier tipo de acto desde conferencias, convenciones o reuniones de trabajo, hasta…
Santanor
  • 566
  • 1
  • 7
  • 20
2
votes
2 answers

How to return last node having namespace in it using Xquery

I have this file, which have namespaces in it, I am trying to write a Xquery which will return, the last node having the namespace, but unabe to find the logic to return the namespace node(PS: I am new to Xquery) XML File -
2
votes
1 answer

XQuery to remove all elements with attribute onlyChannels="print" from XML file

Trying to remove all elements with attribute onlyChannels="print" from XML Using XQuery the element with onlyChannels="print" can be anywhere and at different levels. Input XML
Ahmad Al-Kurdi
  • 2,248
  • 3
  • 23
  • 39
2
votes
0 answers

speed of different ways of a full-text search in XQuery (BaseX)

I am using BaseX 9.3.1 for accessing about 45.000 entries of a dictionary with about 1 million examples etc., having a full-text index as well as one for all text nodes and attributes. So far, so bad. Accessing the nodes for grammar or the meaning…
meistermuh
  • 393
  • 3
  • 11
2
votes
0 answers

XQuery: filter large amounts of data

I do have a xml file (at about 3gb) containing 150k entrys. sample entry: .... lots of data here .... 1 Each of theese entrys do have a specific customer-id. I have to filter the dataset based on a…
Snackaholic
  • 590
  • 7
  • 27
2
votes
1 answer

Logging with XQuery

I'm using XQuery 3.0 to transform an incoming message to fit my system. The XQuery is called from an Apache Camel Route via the transform EIP. Example: transform().xquery("resource:classpath:xquery/myxquery.xquery",String.class) While the…
the hand of NOD
  • 1,639
  • 1
  • 18
  • 30
2
votes
1 answer

Positive lookbehind in xquery

I am writing a Porter stemmer in xQuery and as the first step I need to match consonant and vowel patterns. The consonant matching sequence from the Perl example I'm using as a basis for this is (?:[^aiueoy]|(?:(?<=[aiueo])y)|\by), and the vowel…
medievalmatt
  • 427
  • 2
  • 12
2
votes
1 answer

How to use the xslt-xquery-serialization namespace to export to JSON

I'm trying to use the "Convert XML to JSON" example from WikiBooks here https://en.wikibooks.org/wiki/XQuery/Convert_XML_to_JSON xquery version "3.0"; declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare option…
Joseph McCarthy
  • 897
  • 2
  • 19
  • 41
2
votes
2 answers

xQuery how to use variables in the path expression

I have an XML document: 10001 Georgi Facello 10007
Judah Flynn
  • 544
  • 1
  • 8
  • 20
2
votes
1 answer

exist-db cardinality for parameter

I am new in exist-db and XQuery. In exist-db I have this site map: The catalog "registranten" contains the catalog "data" (with xml-files) and the two files "regBasic.xql" and "regSearch.xql". I am trying to search in the xml-files using the script…
KSR
  • 29
  • 4
2
votes
1 answer

How to write an inquiry flwor xquery?

I have 5 cars, each car with 5 owners, I need to return those owners whose nation does not appear in the owners of other cars (can appear in the owners of the same car): 1 George Smith
Leon
  • 23
  • 2
2
votes
2 answers

XQuery 3: Conditionally add map entry

Example XQuery (using Saxon-HE, version 9.8.0.6) xquery version "3.1"; let $xml := Hello World! return fn:serialize(map{ 'greeting': data($xml/hello), 'number': data($xml/number) (: ? how to add this entry…
rmuller
  • 12,062
  • 4
  • 64
  • 92
2
votes
1 answer

XQuery: best way to convert node sequence to array

I am using Saxon, version 9.8.0.6 with this input document: Hello World! 42 abc def ghi And this query xquery version…
rmuller
  • 12,062
  • 4
  • 64
  • 92
2
votes
1 answer

XQuery: Inserting a XML document into a second XML document

I have 2 separate XML files as shown below. The first XML document only contains a single tag. HeadOffice And the second document: London England
Jay1927
  • 35
  • 2
2
votes
2 answers

xquery order by with results from fn replace

I'm ordering search results (from many XML files) according to the contents of the XML element . Tricky thing is I need to order the results according to only a part of the string found in this element, namely the number following the string 'Rep.'.…
Lissy
  • 61
  • 5
1
2
3
10 11