Questions tagged [basex]
BaseX is a robust, high-performance XML database engine and a highly compliant XQuery 3.1 processor with full support of the W3C Update and Full Text extensions. It serves as excellent framework for building complex data-intensive web applications.
467
questions
0
votes
1
answer
33
views
Returning an element and count of element for an xquery
I am new to xquery and I have been tasked with getting a list of how many section listings each instructor has been assigned.
So for example I'd want to return a list with the instructor and the count ...
-1
votes
1
answer
40
views
Can a BaseX database span multiple folders?
New to BaseX. Working on a project where 100's or sometimes 1000's of XML files are generated each day. Due to other exogenous factors, the preferred file structure would look like:
blah/20220714/
...
0
votes
1
answer
48
views
Problem with exercise with Xquery on Basex
I really need your help with a query in BaseX.
The problem is that I really do not understand the logic behind this language which is Xquery.
So I have this first exercise and it is asking me:
"...
1
vote
1
answer
38
views
XSD schema not validating in basex
I am tasked with adding type="DeptType" to an xsd file and validating it in basex against an xml document. I have validated both in notepad++ but I get an error in basex when trying to ...
0
votes
1
answer
39
views
XQuery tumbling window: group by start item of first window
Using BaseX 9.7.3, I have a sorted list of names that has been produced using a tumbling window clause.
A snippet of the data looks like this:
<data>
<group>
<key id="...
0
votes
1
answer
15
views
Toolbar options are disabled in BaseX
I am using BaseX 9.7.2 and I don't know why most of my toolbar options are disabled so I can't use them except for the "New","Open & Manage", "Editor", "Result&...
0
votes
0
answers
59
views
XQuery "Cannot conver to xs:double"
Im new to learning XQuery and im not sure why i get the error "Cannot conver to xs:double" for the
following code:
for $element in db:open("data", "restaurants_basex.json"...
0
votes
0
answers
23
views
How read with xQuery several similar nodes?
Let's imagine I have an XML with the following structure:
<book>
<title>My car is red</title>
<author>Jhon Doe</author>
<date>05-21-2021</date>
<...
0
votes
1
answer
36
views
First steps: Analyze directory hierarchy of XMLs
I am just getting started on using BaseX. For that I downloaded basex97.zip and extracted it.
My xml data files reside in a directory I will call DATA, and in there are multiple directories with the ...
0
votes
1
answer
36
views
How do I prevent duplication of my root xml during my for loop
for $i in doc(test.xml)//hosptial
return file:append(filepath\dirTest.xml,
<studentID>
<hospitalName>
<ambo>{$i//ambo}</ambo>
</hospitalName&...
0
votes
1
answer
64
views
BaseX GUI Command Bar Error Unknown Command
I occassionally use BaseX GUI for examining XML files and trying XSL transforms. I don't know what has happened but I can no longer run one-liners in the Command/Find/XQuery bar that sits below the ...
0
votes
0
answers
15
views
Plot query results in BaseX GUI
It seems that plotting in BaseX GUI is only available for databases, plotting XQuery results or XML files set to context (right-click on an XML document in the Project view, and choose Set as context) ...
0
votes
1
answer
102
views
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 ...
0
votes
1
answer
65
views
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 ...
0
votes
0
answers
38
views
compound queries (composed from separate sources) in basex
I am trying to conceive of a way to use BaseX to process a compound query that incorporates an external query.
The core idea is a very simple application, expressed as an XQuery file, that results in ...
0
votes
1
answer
133
views
How to escape square bracket, curly bracket for "contains text" query in xQuery (BaseX)?
I'm working with a BaseX in which we integrate TEI files.
We are looking for results that contain items with the following text:
"{AAXX}".
The braces are part of the text. (Note that ...
1
vote
1
answer
298
views
How to merge in memory XML documents?
I have 2 batches of documents. In batch 1, I need to merge pit/score when its SPID equals to characteristic/score/SPID. The expected merge looks like batch 2 documents, characteristic/score/default is ...
0
votes
0
answers
24
views
Annotation %rest:Reservas is unknown
I wrote this XQUERY script, according with my XML also the XSD who has gotten validated.
I have to create 3 scripts for this college projetct which is about booking trips:
Adding a booking
See the ...
1
vote
0
answers
30
views
Store unwellformed XHTML in Basex DB
I have to store XHTML which is not wellformed e.g.(<img href"tes.jpg">) so there is no closing element for element or self close.
I am using the REST service to store data into ...
0
votes
1
answer
99
views
BaseX for Wikipedia Dumps: feature_secure_processing Problem
I try to use BaseX (basex.org, no forum, paid help for commercial use cases, no occurrence of the above search term within the help file) db for creating an offline db for a wikipedia text dump (.xml ...
0
votes
1
answer
84
views
Why the where clause doesn't work with count on xQuery?
I'm currently working at a project that requires me some xQueries with a certain dataset. This is a fraction of the said dataset:
<root>
<Transaction>
<Person>
<Full_Name>...
0
votes
0
answers
64
views
Merge/combine BaseX databases with upserts in memory constrained environment
I have two databases in BaseX, source_db and target_db, and would like to merge them by matching on the id attribute of each element and upserting the element with a replace or an insert depending on ...
0
votes
0
answers
48
views
Search for single punctuation character (full-text indexed basex)
There is an entity in my basex database that basically looks like this (I added wrapping):
<Paragraph>
mRNA made from thyroid carcinoma, cDNA made by oligo-dT priming.
Non-directionally ...
0
votes
1
answer
49
views
Filtering based on an attribute in deep level
Running Xquery on BaseX.
I want to filter based on an attribute in a deep level (/BLA1/BLA2/BLA3) but return attribute from both the filtering level and from one above it (/BLA1/BLA2).
So, as far as I ...
1
vote
1
answer
88
views
How to insert XML Content in db using SQL Module
I am a beginner in XQuery and
I could use some help on how to insert XML elements in my MySQL database. So far, it only inserts pieces of fragments of an xml file but I'd like to fetch the full ...
0
votes
2
answers
74
views
Error parsing html with extended unicode characters with basex
I have been facing issue with parsing html with extended unicode characters using the basex html parser. Is it possible to make the parser support special characters?
Code:
let $htmlRaw := '<span ...
0
votes
1
answer
33
views
variables undeclared when wrapped with CSV serialization
I have a query that runs over ftp://ftp.ncbi.nlm.nih.gov//biosample/biosample_set.xml.gz in Basex 9.5.1
for $bsattrib in doc(
'biosample_set'
)/BioSampleSet/BioSample/Attributes/Attribute
let $...
0
votes
2
answers
117
views
XQuery 3: Count occurrences of element names across document
Building on Count number of elements with same tag
I will be running this query with BaseX 9.5.2.
Given the data
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
&...
2
votes
1
answer
49
views
read non-xml file from BaseX database
How can I read a non-XML (specifically CSV) file that is stored in a BaseX database from a query?
csv:doc() expects a URI, how do I point it to a file inside the database?
1
vote
3
answers
198
views
BaseX XQUERY selecting nodes with the value of a specific attribute
XML sample:
<mondial>
<continent id="f0_119" name="Europe"/>
<continent id="f0_123" name="Asia"/>
<continent ...
0
votes
1
answer
50
views
2 problems in Xquery with similar XML files and XMLNS
I'ld enquire multiple xml with Basex (file1.xml, file2.xml,....) downloaded from https://www.rna.gov.it/RegistroNazionaleTrasparenza/faces/pages/OpenDataAiuti.jspx
but I'm not able to write the query ...
2
votes
2
answers
92
views
XML: how can I search in whole xml and find nodes by id and delete them?
A simple example of a xml file
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<speklap name="gj">
<book>
<title lang="...
0
votes
1
answer
55
views
XPath make output of whole XML by multiple ID's
<bookstore>
<book>
<title lang="en" id="1">Harry Potter</title>
<price>29.99</price>
</book>
<book>
...
3
votes
2
answers
692
views
How can I configure BaseX for use in VS Code
What's the problem
I am trying to get XQuery to work in VS Code using BaseX, but every time I try to execute a query using XML Tools, it fails because its execution in the command is returning an ...
0
votes
1
answer
73
views
Is there something in XQuery similar to LIMIT x, y in SQL?
I need to paginate the results of queries in XQuery. Is there something similar to LIMIT X,y in SQL?
0
votes
1
answer
132
views
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 ...
0
votes
1
answer
49
views
Is there an issue with the BaseX 9.5.1 build?
Getting this message in .log:
!ENTRY org.eclipse.help.base 2 0 2021-03-02 16:03:03.323
!MESSAGE Unable to consume Lucene index from bundle 'org.eclipse.wst.dtdeditor.doc.user_1.1.0.v201903222120 [425]'...
0
votes
1
answer
106
views
Does BaseX support running a basex script file (.bxs) with the jobs module or a combination of query with proc module and jobs module?
This has been a thorn in my side and I'm wondering if I'm missing something simple or not. I need to run .bxs scripts from the jobs scheduler.
I tried to start a service with a .bxs script file from ...
0
votes
1
answer
94
views
XQuery get distinct values
Im new to XQuery and are trying to learn how to use it with BaseX.
I have this xml containing multiple elements of program:
<program id="4565">
<name>Musiken i P3</...
0
votes
1
answer
162
views
BaseX - XQuery - Out of memory when writing results to CSV file
I am trying to write an XQuery-result to a CSV-file, see attached code (resulting in at least 1.6 millions lines, will problably become a lot more..).
However several minutes into execution the ...
1
vote
1
answer
278
views
Handle JSON-only API with BaseX XQuery code
I recently took over an older code project for a new job, and this project extensively uses XML databases stored in BaseX. The core project is a Node web application delegating various database ...
0
votes
3
answers
125
views
Splitting a sequence and incrementing using Xquery
I have an xml like below , am trying to convert the xml in to csv
<module>
<content>
<catalouge SC="25" item="200">
<Number id="...
1
vote
0
answers
37
views
BaseX: Query request error : Extra content at the end of the document
I have installed a BaseX server to allow creation of database on my computer.
I have the following XML database managed by BaseX :
<config>
<datas>
<datas_types>
<...
0
votes
1
answer
54
views
splitting a range using xquery
I have an xml as below
<content>
<customer id="250">
<assert PropertyType="product" PropertyValues="0009~0013" DisplayClass="confirmed"/>
<...
0
votes
1
answer
196
views
XPTY0004 Item expected, sequence found, How to find whether a value is present in a sequence or not using Xquery
Hi.. I would like to find whether a value is present in a sequence or not ,for example If I have an XML which looks like below
<module>
<content>
<customer SC="25" item="...
1
vote
1
answer
102
views
How to get same attribute values of a node, in a sequence using Xquery?
Hi..I would like to print attribute values in a sequence ,for example If have an XML which looks like below
<module>
<content>
<catalouge SC="25" item="200">
<...
0
votes
0
answers
59
views
reading multiple XQuery files from BaseX command line?
I have an existing project running on some other XQuery processor/platform and would like to try it out with BaseX.
Basically I have Xquery query expressions defined in multiple files to have some ...
1
vote
1
answer
293
views
External entity reference declaration: entities are referenced but not declared (although they are)
I am trying to reference several entities such as ampersands, hyphens, etc. To do that, I already have a URL where an .ent document is deposited. Unfortunately, I have no DTD document and assuming ...
-1
votes
1
answer
40
views
Querying XML data with a long, multi special character, path name
Just getting started with XQuery using BaseX.
The XML structure that I did not create and have no control over, looks like this:
2002test.xml:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap....
0
votes
1
answer
91
views
Is there a basex function to randomly erase parts of an XML file?
I have an XML file with an X number of annotations, and I would like to edit it to have less than X of these, randomly. For practical matters: I have 40 annotations and I would like to end up with ...