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.

BaseX focuses on storing, querying, and visualizing large XML and JSON documents and collections. A visual frontend allows users to interactively explore data and evaluate queries in realtime (i.e., with each key click). BaseX is platform-independent and distributed under the free BSD License.

BaseX provides several methods of accessing a database and executing queries, among them:


Workflow (when using the native BaseX Java API)

More examples can be found in the BaseX Documentation

  • First of all, a BaseX database server must be running, which will process the client requests.
  • Each client provides a session class or script with methods to connect to and communicate with the database server. A socket connection will be established by the constructor, which expects a host, port, user name and password as arguments.
  • The execute() method is called to launch a database command. It returns the result or throws an exception with the received error message.
  • The query() method creates a query instance. Variables can be bound to that object, and the result can either be requested via execute(), or in an iterative manner with the more() and next() functions. If an error occurs, an exception will be thrown.
  • The create(), add(), replace() and store() method pass on input streams to the corresponding database commands.
  • To speed up execution, an output stream can be specified by some clients; this way, all results will be directed to that output stream.
  • Most clients are accompanied by some example files, which demonstrate how database commands can be executed or how queries can be evaluated.
486 questions
3
votes
2 answers

BaseX XQuery error: root(): no context value bound

I am trying to run the following XQuery expression in BaseX to extract elements between two succeeding headings. (as an article section). xquery for $x in doc("test.xq")//h2, $y in $x/following-sibling::h2[1] return //*[$x/following::* and…
Ahmad
  • 8,811
  • 11
  • 76
  • 141
3
votes
1 answer

Java EE realm with BaseX?

I'm developing a Web application on Java EE with BaseX as Database System. In the Web application I need an user authentification and would like to store the informations in a BaseX collection like the one below: myUser
Michel Sahli
  • 1,059
  • 10
  • 14
3
votes
2 answers

inserting millions of xml files into basex

Is it possible to store a million of records(xml files) into Basex database? for(int j=1;j<1000000;j++) { String id=String.valueOf(j); String[]…
manish payasi
  • 77
  • 1
  • 10
3
votes
2 answers

BaseX attributes cannot be serialized

I have this simple XML file: 557 Fleece Pullover navy black 563
MrIcyBalls
  • 83
  • 1
  • 9
3
votes
2 answers

XQuery Full text searching over mixed content

Following is the XML structure - (i have given a very small piece of the entire document with limited data. I have a XML DB of 6 GB, with proper FULL TEXT Index.) No - 1 departmental…
John
  • 2,820
  • 3
  • 30
  • 50
3
votes
4 answers

How can I write an XQuery that can test what version of XQuery is being used?

I am writing an XQuery that needs to check what version of XQuery is being run (eXist, Saxon, etc.). Is there a standard function that will return the system properties of an XQuery such as version, vendor etc? I know there are some system specific…
Dan McCreary
  • 411
  • 3
  • 13
3
votes
1 answer

XQuery not inserting child node

Below is the XML structure. Its a specimen of my original structure, not the exact.

Constants : The value of pi is 3.14

pi is a geometric term.

John
  • 2,820
  • 3
  • 30
  • 50
3
votes
1 answer

java BaseX XQJ executeQuery()-method with insert returns Exception

I am trying to use the Java BaseX XQJ API to insert data into a XML-file. The code is as follows (imports are ommited): public class BaseXTest { public static void main(String[] args) throws Exception { // obtain an XQDataSource instance …
kiltek
  • 3,183
  • 6
  • 47
  • 70
3
votes
2 answers

AJAX origin null is not allowed by access-control-allow-origin

I am working with BASEX (an XML Database) and i am trying to connect to the http server for performing REST request using Ajax. My code work well in IE but doesn't work with Firefox or Chrome. I tried two ways for the ajax query. Here is the first…
Ronan sistema
  • 31
  • 1
  • 2
3
votes
1 answer

Where can I find a list of logical operators for BaseX?

I'm using the official documentation: http://docs.basex.org/wiki/Commands#String_Syntax, and I haven't been able to locate a list of logical operators. I want to be able to query text contains 'A' or 'B'. Along these same lines, I'm also trying to…
Wolfpack'08
  • 3,982
  • 11
  • 46
  • 78
3
votes
1 answer

what is the difference between these two XQueries

I have a huge XML file stored in BaseX. Following is the structure of XML nodes Datas (Parent Node) - Data (Child of above) - Desc (Child of above) - P (Child of above) and contains the actual text P tag contains all the…
user1388575
3
votes
2 answers

BaseX RESTXQ "hello world" example

I'm strugging to get started with the BaseX RESTXQ API. I've downloaded and installed the latest version of BaseX for Windows. I have started the BaseX Server by clicking the "BaseX Server (Start)" icon that the BaseX installation adds to the…
Nigel Alderton
  • 2,265
  • 2
  • 24
  • 55
3
votes
4 answers

XQuery returning error in baseX

Below is the XML file - Introduction 1 History of Internet ..............
user1388575
2
votes
1 answer

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

XML: how can I search in whole xml and find nodes by id and delete them?

A simple example of a xml file Harry Potter 29.99 <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/bash" class="post-tag grid--cell" title="show questions tagged 'bash'" rel="tag">bash</a> <a href="../../questions/tagged/xquery" class="post-tag grid--cell" title="show questions tagged 'xquery'" rel="tag">xquery</a> <a href="../../questions/tagged/xmlstarlet" class="post-tag grid--cell" title="show questions tagged 'xmlstarlet'" rel="tag">xmlstarlet</a> <a href="../../questions/tagged/basex" class="post-tag grid--cell" title="show questions tagged 'basex'" rel="tag">basex</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Mar 20 '21 at 07:29">asked Mar 20 '21 at 07:29</time> <a href="../../users/8210201/gjf" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/8210201.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="GJF" /> </a> <div class="s-user-card--info"> <a href="../../users/8210201/gjf" class="s-user-card--link">GJF</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">77</li> <li class="s-award-bling s-award-bling__bronze" title="7 bronze badges">7</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/basex_page=3" rel="prev" title="Go to page 3">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/basex_page=1" rel="" title="Go to page 1">1</a> <a class="s-pagination--item" href="../../questions/tagged/basex_page=2" rel="" title="Go to page 2">2</a> <a class="s-pagination--item" href="../../questions/tagged/basex_page=3" rel="" title="Go to page 3">3</a> <div class="s-pagination--item s-pagination--item__clear">…</div> <a class="s-pagination--item" href="../../questions/tagged/basex_page=32" rel="" title="Go to page 32">32</a> <a class="s-pagination--item" href="../../questions/tagged/basex_page=33" rel="" title="Go to page 33">33</a> <a class="s-pagination--item" href="../../questions/tagged/basex_page=5" rel="next" title="Go to page 5"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>