Questions tagged [xquery-3.1]

32 questions
1
vote
2 answers

Concat adds double quotes

concat adds another double quote if an input string includes one. I am using XQuery 3.1 on eXide. A̶F̶A̶I̶K̶,̶ ̶e̶X̶i̶d̶e̶ ̶u̶s̶e̶s̶ ̶S̶a̶x̶o̶n̶ ̶a̶s̶ ̶X̶Q̶u̶e̶r̶y̶ ̶e̶n̶g̶i̶n̶e̶.̶ (it doesn't, see joewiz answer below). The bug occurs when I…
Justin P.
  • 183
  • 1
  • 1
  • 16
1
vote
1 answer

exist-db how to access a pdf

I am sure it is very simple ... I just cannot get my head around this... the exist-db Documentation is a bit fuzzy on content extraction... http://exist-db.org/exist/apps/doc/contentextraction. I have a pdf-file, containing of about 162 high-res…
user9813195
1
vote
1 answer

If-statement: Incomplete FLWOR expression

I have the following XQuery code in the BaseX editor, but it errors on the if-clause, stating Incomplete FLWOR expression: expecting 'return' The code that I am trying to use: import module namespace functx = 'http://www.functx.com'; declare…
Bram Vanroy
  • 27,032
  • 24
  • 137
  • 239
0
votes
1 answer

XQuery 3.1 evaluation using SaxonJS 2.5 (browser)

What I want I need to create a Javascript function that allows to get the result of evaluating an XQuery 3.1 expression against an XML. The function: Must receive two parameters: the XML document (String) and the XQuery expression (String). Must…
cespon
  • 5,630
  • 7
  • 33
  • 47
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
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

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

xquery typeswitch introduces spaces?

I’m having a small issue with extra spaces in the output of typeswitch (eXist 5.3) that I don’t know how to solve. Given this small example: xquery version "3.1"; declare namespace tei="http://www.tei-c.org/ns/1.0"; declare function…
jbrehr
  • 775
  • 6
  • 19
0
votes
2 answers

Functx module and long strings with end of chars

I faced a problem with functx module dealing with strings with end of line characters. The following code should work (?) declare %unit:test function test:substring-before-last() { let $title := 'Something blah other' let $expected-title :=…
Gandalf
  • 155
  • 1
  • 12
0
votes
1 answer

Query failed with dynamic error: Cannot serialize a map using this output method

This has to be a noob issue, as I'm just starting with XQuery. I was successfully able to build a simple XQuery for eXist that runs an XSL transform. But I have been unsuccessful in building a similar XQuery for Saxon (9.9.1.5J) that runs an XSL…
lschult2
  • 588
  • 2
  • 5
  • 16
0
votes
1 answer

XQuery how to count with "where" condition

I'm just starting to learn XQuery and I want that it shows me the number of festivals with genre (genero) is the same as "metal". I can't get the total number of them, only separately. Xquery for $b in //festival where $b/@genero="Metal" return…
inwi
  • 1
  • 1
0
votes
1 answer

Why does xquery allow local variable redeclaration?

This will not even raise a warning: xquery version "3.1"; let $a := 1 let $a := 2 return $a (: yields 2 in all runtimes I tested :) Why would a (functional) programming language allow variable re-declarations? I really just want to get the…
line-o
  • 1,885
  • 3
  • 16
  • 33
0
votes
1 answer

Select document as root context from a BaseX database by URI

Might not be difficult, but i cannot find the correct command and syntax: I have a BaseX database opened that holds several XML documents: /document-uri() looks like…
user5924595
0
votes
1 answer

How to expose functions defined in XSLT 2 stylesheet module to fn:transform?

The XPath 3.1 transform functions allows you to apply templates or call a named template or call a stylesheet function. However, when I try to use an existing XSLT 2.0 stylesheet module (like, for instance, the functx module documented at…
Martin Honnen
  • 160,499
  • 6
  • 90
  • 110