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

compare two xml file contents using xquery in java

I am trying to compare new xml file with existing xml inside the basex database('db') but it checks only the existence of the file within 'db' and it is returning true whether contents are same or not. I also want to check contents of xml file…
manish payasi
  • 77
  • 1
  • 10
0
votes
3 answers

BaseX XQuery does not return the root element

I am trying to use an XQuery search like this with BaseX: XQUERY doc("ann-20140201.xml")//xbrl I am submitting a small excerpt from the original instance:
Codo
  • 271
  • 3
  • 10
  • 24
0
votes
1 answer

BaseX XQuery No context item defined to evaluate 'root()'

I am trying this XQuery on BaseX: xquery //Bookstore/Book/Title Although in the tutorial at 2:01 it works in me it throws this error: Error: Stopped at ., 1/2: [XPDY0002] No context item defined to evaluate 'root()'. Compiling: - simplifying…
ExoticBirdsMerchant
  • 1,466
  • 8
  • 28
  • 53
0
votes
2 answers

XQuery resulting in Out Of Memory Error

Following is the XML file - Tomy John P2 Tomy John P1 Rojer Messi P2
John
  • 2,820
  • 3
  • 30
  • 50
0
votes
1 answer

Why can't you query database paths/files using REST?

I have a database like so
Vigrond
  • 8,148
  • 4
  • 28
  • 46
0
votes
1 answer

Why does my range search in XQuery not work and returns too many elements?

New to XQuery and probably a noob q. I installed a BaseX db as my sandbox (which included a sample file etc/factbook.xml). I constructed a simple query which I thought would return all 'cities' with population > 10million. for $x in…
yamori
  • 1,213
  • 4
  • 14
  • 27
0
votes
1 answer

xquery for grouping data from xml file

I am trying to run an xquery for my xml file. This is my input xml file: Steven advanced TCPIP George
star2014
  • 173
  • 2
  • 5
  • 14
0
votes
2 answers

XQuery to insert data of same nodes

Following is the structure of my XML File -

blah blah blah. Pg-1

blah blah blah. Pg-2

I have to change it to -

blah blah blah. Pg-1

blah…

John
  • 2,820
  • 3
  • 30
  • 50
0
votes
2 answers

XQuery - Why there is difference in result?

Electromagnetic Fields 2006 blah blah blah.

blh blah blah.

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

Xquery to fetch distinct data from two XML DBs

Below is the sample structure of 2 XML DBs - Subject DB Physics Biology Maths Algebra Classification DB
John
  • 2,820
  • 3
  • 30
  • 50
0
votes
1 answer

XQuery cannot parse function argument of type item()*

I have a function which returns item()*. The output of this function is something like the following: 1999 50 100 2000 50 100
user2548144
  • 87
  • 1
  • 7
0
votes
2 answers

how to extract an XPATH from an html page with Saxon-PE commandline

I would like to extract the XPATH //DIV[@id="ps-content"] out from this web page: http://www.amazon.com/dp/1449319432 (saved as a local file) I would like to do it with a single line of command-line with one of the best parsers, like Saxon-PE or…
Imbuter
  • 17
  • 5
0
votes
1 answer

Modifying all element attribute values with Xquery

How to modify all wanted attribute values in the way that is expressed in the XML examples with Xquery? I'm using Basex 7.6 Xquery and XML database engine. My purpose so far has been only to process XML files with it. That structure I have…
sailfish
  • 43
  • 6
0
votes
1 answer

Unable to perform multiplication with XQuery in BaseX

Consider an xml file defined as: Knights London Dukes
xs2dhillon
  • 23
  • 4
0
votes
1 answer

How to find values using XQuery and plist XML files

The following sample Plist file is used for my question below.
Just a coder
  • 15,480
  • 16
  • 85
  • 138