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

How to select an element by a variable in xquery?

I know how to select an element like so: $table/foo However how do I do this if the element name is stored as a variable. For example: let $x = "foo" $table/[$x] I know how do this if it was a property from: How to select an attribute by a…
Yahya Uddin
  • 26,997
  • 35
  • 140
  • 231
0
votes
2 answers

XQuery - How to insert elements?

I have the following xml: and I have the following code: for $subject in…
Yahya Uddin
  • 26,997
  • 35
  • 140
  • 231
0
votes
1 answer

XQuery: How to deal with multiple if-then-elses in a nested FLWOR statement?

Having dealt with XQuery for the last couple of weeks, I'm sometimes still at odds with the XQuery syntax when mixing XQuery and (X)HTML code. I have a nested FLWOR statement, as a result of a more complex structure in my XML document. At some point…
smo
  • 89
  • 8
0
votes
1 answer

XQUERY/XSLT Advance Math

I'm trying to perform a more advanced calculation in an XSLT/XQuery but running into an issue. The formula is to aggregate sum but it performs operations before the sum. Assuming we have XML source file of:
warchitect
  • 397
  • 1
  • 4
  • 15
0
votes
3 answers

XQuery3.0 function not supported by Saxon EE 9.5 - how to use format-number?

I am trying to use the format-number function from XQuery/XPath 3.0. According to Saxon documentation, this is supported from v9.3-9.4. I'm using Saxon-EE 9.5: com.saxonica
XSen
  • 188
  • 1
  • 2
  • 9
0
votes
1 answer

How to perform a XPATH Conditional SUM

I'm trying to build an xpath sum expression with a filter that will some the seconds for filtered time frame and unit. I think this fairly simple but just can't seem to get my hands around it. Assuming I have a XML document like:
warchitect
  • 397
  • 1
  • 4
  • 15
0
votes
1 answer

How to load the xhtml document as a text and search the keyword in marklogic

I have loaded the XHTML files in marklogic. But need to perform the search on attributes, elements and text. So I need to get/load the document as a text and perform the search on document. Below is the XHTML file.
0
votes
1 answer

Writing updates to xml file with XQuery and BaseX

I have a file.xml storing protocols whose structure is the following: 1 2014-12-15 Trasmissione prospetti di…
SagittariusA
  • 5,289
  • 15
  • 73
  • 127
0
votes
2 answers

Why does BaseX not modify the file upon an insert node command?

I am executing the following XQuery code on BaseX 7.9 and am able to see the insertion on the results window. I even see the new node after closing and reopening the collection. However, when I go to the file directory I see it hasn't been modified.…
popen_2
  • 43
  • 5
0
votes
1 answer

How can I count child nodes based on their attribute values?

I want to create a summary using XQuery 3.0 to show how many parts of each type a obj has. I have the following XML code: Foo1
wizzkid
  • 187
  • 1
  • 3
  • 13
0
votes
1 answer

xQuery - BFS to find all paths between two nodes

I've asked a question 2 months or so where i needed help implementing the BFS algorithm in xquery to find the shortest path between two nodes in a directed graph, luckily someone helped me and the code they gave me worked with some minor…
HardCodeStuds
  • 407
  • 2
  • 11
  • 29
0
votes
2 answers

Return element name and value as key value pair

I am working on a requirement where I need to return element name and value as Key value pair as below using XQUERY. [code=123,px_last=value attribute of first data,last_update=value attribute of 2nd data and so on] There are 7 data element with…
0
votes
1 answer

How to Transform the Message Using XQuery in WSO2WSB 4.8.0

I am Using Wso2esb4.8.0 I wish to transform the messages as per the Adapter request requirement. My incoming messages in various ways. Like
user3595078
  • 273
  • 3
  • 17
0
votes
2 answers

XML and XQuery: Comparison between tag content and string

if I have this simple file.xml: Lorenzo Vinci
Via Rosa Luxemburg 68 A, Imola Italia
SagittariusA
  • 5,289
  • 15
  • 73
  • 127
0
votes
1 answer

Write an XQuery for given XML

I need to write an XQuery from a given XML but I cannot find the right way to do it. Here is the xml:
Argjent
  • 97
  • 8
1 2 3
10
11