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

xquery- how to obtain min/max value from a set of values that are obtained by subtracting consecutive members from a list

In an xquery expression, I have obtained a set of values within a for-expression, and one value is in a separate variable. Now, I want to subtract the single value from first value of the list, and then subtract consecutive members of the list from…
Arvind
  • 6,404
  • 20
  • 94
  • 143
1
vote
2 answers

xquery- how to get difference between successive values in a list of numeric values

I have extracted successfully one value in one variable, and a list of values in another variable (as part of my XQuery expression). Now, suppose the single-value variable is x=1 and the list variable is named y with values 2,4,7,11,16 I want…
Arvind
  • 6,404
  • 20
  • 94
  • 143
0
votes
0 answers

Write and read document in the same run

I am using BaseX version 9.5 and trying to ingest docs into database and read it in the same run: let $result := for $i in 1 to 10 return ( db:replace('test','/content/'||$i||'.xml',
0
votes
1 answer

how to sum all of the count items in xquery

My problem is i want to display the count of all genre that is equals to actions `
0
votes
2 answers

How to convert string to XPATH in BaseX

How can i convert string into XPATH, below is the code let $ti := "item/title" let $tiValue := "Welcome to America" return db:open('test')/*[ $tiValue = $ti]/base-uri()
0
votes
1 answer

Dynamic combination search on specific path in BaseX

I want to perform dynamic combination (AND OR) search on the basis of the provided parameter by the user. Search Combination Example: ( (title = "United States" or isbn = "2345371242192") and author ="Jhon" ) In the above query each parameter will…
0
votes
1 answer

XQUERY: Create elements with given names and values

I've a requiremnet to generate dynamic elements and values based on two xmls. How can I achieve using XQUERY. I have data like in two…
Learner
  • 5
  • 1
0
votes
1 answer

XQuery - using GROUP BY with WHERE condition to retrieve XML file names

I am having trouble creating an XQuery 3.0 (using BaseX 9.7) to retrieve names of XML files in a collection which satisfies certain conditions: Having more than 1 occurrence of the same 'type' element if another element ('author') has a certain…
kDjakman
  • 116
  • 5
0
votes
1 answer

Replace text node with element if text match in the document BaseX

I am trying to replace text node with element if document matches that text, below query I have tried but it is giving error "Target is not an element, text, attribute, comment or pi" below is my query. inputXML:

Isn't it lovely here?…

0
votes
1 answer

Count number of word occurrences working slow BaseX xquery

I want to count occurrences of the words in the XML document, query giving the actual count but it is working slow. There are only two xml files size (236 KB, 155 KB) and it is taking 17 sec to produce result. Below is the query: let $doc :=…
0
votes
1 answer

Performance Issue of a Join in Xquery

I have a strange performance issue while performing joins at multiple levels, say I have a huge xml out of which I need to perform joins(on the records inside that huge xml, approx few thousands) and define 4 hierarchy levels (Parent/Child…
Learner
  • 5
  • 1
0
votes
1 answer

Split a string based on Pipe delimiter and except inside brackets ()

I want to split a string by '|' delimiter and exclude those inside the brackets (). I used tokenize function to split by delimiter and have some issue with exclusion part(RegEx format). Please help. Input:…
Learner
  • 5
  • 1
0
votes
1 answer

Query .evtx converted to .xml

Having used evtx_dump.py to convert .evtx files to .xml i seek to learn how to query it using XQuery or whatever helps me datamine the document using BaseX. At this point whatever i try i can only query the whole document using //Events When i…
0
votes
1 answer

In xquery when fn:upper-case() with apostrophe ", single quote receiving error

In Xquery for the using the function fn:upper-case when we use apostrophe (') and double quotes (") getting below parser error. please let me know if any inputs on this error. earch failed to execute, please check XQuery for possible issues:…
vinod krishna
  • 101
  • 1
  • 9
0
votes
1 answer

Combine two for loops and union results in XQuery

Let's say we have this folders not_my_files collections collection1.xml collection2.xml collection3.xml etc... my_files my_documents mydoc1.xml mydoc2.xml mydoc3.xml …
ag_1812
  • 158
  • 2
  • 10