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 - Sum attributes for all element which have another specific attribute value

I need to add balance for each prod "type" such that what remains is one element with the total balance for the prod "type" This is what I have let $input :=
Haukland
  • 677
  • 8
  • 25
1
vote
1 answer

Generate XML file with document constructor from xquery

I have problem to generate .xml file from xquery. Here is my code: document { , { for $a in doc("Artists.xml")//ARTIST return
A.G
  • 41
  • 4
1
vote
3 answers

Xquery: getting unique blocks with based on multiple values

I'm trying to get unique set of data from the XML below DB Database systems Smith John Adam DB Database…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/xpath" class="post-tag grid--cell" title="show questions tagged 'xpath'" rel="tag">xpath</a> <a href="../../questions/tagged/xquery" class="post-tag grid--cell" title="show questions tagged 'xquery'" rel="tag">xquery</a> <a href="../../questions/tagged/xquery-3.0" class="post-tag grid--cell" title="show questions tagged 'xquery-3.0'" rel="tag">xquery-3.0</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked May 15 '20 at 09:10">asked May 15 '20 at 09:10</time> <a href="../../users/7574876/rachithr" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/7574876.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="rachithr" /> </a> <div class="s-user-card--info"> <a href="../../users/7574876/rachithr" class="s-user-card--link">rachithr</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">23</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> <li class="s-award-bling s-award-bling__bronze" title="5 bronze badges">5</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-61103134"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>1</strong></span> <div class="viewcount">vote</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/61103134/how-do-i-get-count-of-records-using-xquery" class="question-hyperlink">How do I get count of records using XQuery</a></h3> <div class="excerpt">I have "Library.xml" file containing book records as <?xml version="1.0" encoding="UTF-8"?> <library> <book> <title>DBMS Korth Pragati 500
1
vote
2 answers

Generic XQuery to recursively traverse the XML

I am trying to convert the XML input given below to the output format using generic Xquery without calling any parent/child elements. If the parent has two or more recurring child then that should be grouped as an array.…
VSe
  • 919
  • 2
  • 13
  • 29
1
vote
2 answers

No updating expression allowed Basex

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

XSLT template outputting differently under different Saxon installs? (eXist-db)

In my site I use XQuery 3.1 (under eXist-db 4.4) to output XSLT 2.0 transformations of TEI-XML documents. Take for example this document http://medieval-inquisition.huma-num.fr/doc/MS609-0176 In my function I get the tei-xml document MS609-0176.xml…
jbrehr
  • 775
  • 6
  • 19
1
vote
2 answers

xQuery - fill custom array

I got some dataset with ads of diffrent companys. for example A Testvalue A Testvalue
Snackaholic
  • 590
  • 7
  • 27
1
vote
1 answer
1
vote
1 answer

Quarterly Dates Calculation [XQuery]

I am trying to generate a report which fetches quarterly report i.e. based on startDate and endDate. How to calculate startDate and endDate of any quarter if I have quarter name as Q1 and year as parameters in XQuery or Marklogic. Example: if I…
mpuram
  • 149
  • 9
1
vote
0 answers

eXist-DB / XQuery - XSL transform unable to set up transformer: no protocol

Environment: eXist-db 4.2.1 , XQuery 3.1, XSLT 2.0 I am firing off a transformation of an XML document in eXist-DB - XQuery which produces the following error: exerr:ERROR Unable to set up transformer: no protocol:…
jbrehr
  • 775
  • 6
  • 19
1
vote
1 answer

eXist-DB / Query XSL transform: undefined context sequence

Environment: eXist-db 4.2.1 , XQuery 3.1, XSLT 2.0 I am attempting to transform an XML document with an XSLT 2.0 stylesheet, triggered by eXist-DB/Query 3.1. I am receiving the following error err:XPDY0002 Undefined context sequence for…
jbrehr
  • 775
  • 6
  • 19
1
vote
2 answers

XQuery to retrieve values from child nodes of an element node having name changes for every XML record

XML Response payload as below <_1> description,lead,url,projectKeys ABC 12631 <_2> description,lead,url,projectKeys XYZ 12632 <_3> …
Tom George
  • 29
  • 1
  • 1
  • 7
1
vote
1 answer

Return the count of courses using satisfies contains XQuery

I have been struggling to return the count of courses from this XML file that contain "Cross-listed" as their description. The problem I encounter is because I am using for, it iterates and gives me "1 1" instead of "2". When I try using let instead…
Pitagora
  • 47
  • 1
  • 9
1
vote
2 answers

Is there dynamic binding in XQuery?

I am studying XQuery and how it is used to query XML documents along with SQL and I learned that XQuery version 1.0 does not support dynamic binding or object oriented design which means XQuery is not very useful for large programs. I might be…
Red Eyez
  • 187
  • 3
  • 16