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
1
vote
1 answer

Do not return output

I am very new to xquery, I am trying to check if the attribute exists in the element using xquery, if exists return, return only for the b element which has id. I tried the following: Input text text
VSe
  • 919
  • 2
  • 13
  • 29
1
vote
1 answer

xquery group by not elimilate duplicated items

I have an XML document, Georgi Facello Bezalel Simmel
Judah Flynn
  • 544
  • 1
  • 8
  • 20
1
vote
1 answer

How to write a xQuery to extract two fields based on the conditions of others value?

I have an XML document: 10001 Georgi Facello 10002
Judah Flynn
  • 544
  • 1
  • 8
  • 20
1
vote
0 answers

Error while trying to serialize as JSON in XQuery 3.1 with Saxon 9.7.0.19

I am trying to run the example 24-12 in Priscilla Walmsley's XQuery book. xquery version "3.1"; declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; declare option output:method "json"; declare option output:indent…
Loren Cahlander
  • 1,257
  • 1
  • 10
  • 24
1
vote
1 answer

How to re arrange nodes using XQuery flwor

I want to rearrange the Order tags in the input xml given below such that the nodes follow this sequence BUY_ONLY, BOGO, GET_ONLY This is my sample Orders.xml The Order tags have to be re arranged based on the OrderType tag inside them (:…
Beginner
  • 335
  • 2
  • 6
  • 17
1
vote
1 answer

Joining elements in separate sequences based on their position in Xquery 3.0

I have 2 sequences as shown below: let $city := ('London', 'Tokyo') let $country := ('England', 'Japan') let $region := ('Europe','Asia') I would like to do is manipulate the 2 sequences so that it appears as so:
Jay1927
  • 35
  • 2
1
vote
1 answer

Process XML using XQuery - incorrect output

I have an XML document describing a car mart. The car mart is a collectiion of parkings. In each parking, there are many cars. Each car belongs to one category - new/used/rent. The document looks like this:
arcus
  • 11
  • 1
1
vote
2 answers

Marklogic App server 8001- connection Refused Error

I have installed MarkLogic server on the Windows operating system. I am able to access the query console and Dashboard applications. However, I cannot access the admin server on port 8001. I receive a connection refused error. Can someone help me…
Aswanikumar
  • 115
  • 1
  • 9
1
vote
1 answer

XQUERY 3.0 Multi-level SORT / ORDER BY

I have an XQUERY 3.0 as follows on an XML file with 3 Purchase Order recs with 5 items: for $PurchaseOrder in doc("C:\Users\thebluephantom\Desktop\order.xml")//PurchaseOrder order by xs:integer($PurchaseOrder/Item/Quantity) ascending return…
thebluephantom
  • 16,458
  • 8
  • 40
  • 83
1
vote
1 answer

XQuery multi-filter search algorithm

I am new to XQuery 3.0 and trying to create a simple multi-filter search algorithm. What I want to do is, check if a parameter is supplied and if so, add it to the query. This is what I have in my mind: let $query :=…
yenerunver
  • 416
  • 1
  • 5
  • 26
1
vote
1 answer

XQuery to generate DROP TABLE IF EXISTS + INSERT INTO statements

I'm using XQuery to go over a bunch of XML files and extract indexed terms and turn them into SQL insert statements. This is very straightforward: xquery version "3.0"; declare namespace output =…
Tench
  • 485
  • 3
  • 18
1
vote
2 answers

Multiple keyword search in xquery with tokenize and match

My attempt to ask this before was apparently too convoluted, trying again! I am composing a search in Xquery. In one of the fields (title) it should be possible to enter multiple keywords. At the moment only ONE keyword works. When there is more…
Lissy
  • 61
  • 5
1
vote
2 answers

how to find the XML document size in MarkLogic

I am trying to calculate the doc size of the XML in MarkLogic in part of performance. Could someone please help me with any inbuilt functions or any query where I can calculate my accurate size of the document? I have a formula…
Aswanikumar
  • 115
  • 1
  • 9
1
vote
2 answers

How to get each item in a sequence in Xquery?

Hi I have an XML which looks like $#*! My Dad Says 2010 Beep My Dad Says 2010
user2775042
  • 509
  • 2
  • 6
  • 21
1
vote
1 answer

Namespace for map in Saxon-EE

I am trying to run the following code in saxon map:merge(for $mov in doc("movies.xml")/movies/movie return map:entry($mov/@id, avg($mov/ratings/child::node()))) However, I am getting the error as follows: XPST0081: Namespace prefix 'map' has not…
Echchama Nayak
  • 971
  • 3
  • 23
  • 44