BaseX

can xquery be run practically from the CLI?

限于喜欢 提交于 2019-12-08 07:02:49
问题 How is this sample xquery executed from the CLI? xquery version "1.0"; let $message := 'Hello World!' return <results> <message>{$message}</message> </results> Inspired from zx485's answer: Check the separate libxslt page XSL Transformations, is a language for transforming XML documents into other XML documents (or HTML/textual output). A separate library called libxslt is available implementing XSLT-1.0 for libxml2. This module "libxslt" too can be found in the Gnome SVN base. You can check

Auto increment with XQuery Update?

╄→尐↘猪︶ㄣ 提交于 2019-12-08 01:24:20
问题 Does XQuery Update support auto increment attributes, just like auto increment fields in SQL ? I'm using BaseX as my database. 回答1: Given an answer from Christian Grün on the BaseX mailing list, this is doable when the node one is adding is defined in the XQuery Update statement, and hence can be enhanced using an {enclosed expression} before inserting it: You might specify the attribute counter within your XML file/database and increment it every time when you insert an element. A simple

how to specify a BaseX database from a FLOWR xquery?

妖精的绣舞 提交于 2019-12-06 12:49:27
问题 How can I get all the titles with a FLOWR query against a specified database? Specifying a document works: thufir@dur:~/basex/microsoft$ thufir@dur:~/basex/microsoft$ basex titles.xq [warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java <title>Creepy Crawlies</title> <title>Lover Birds</title> <title>MSXML3: A Comprehensive Guide</title> <title>Maeve Ascendant</title> <title>Microsoft .NET: The Programming Bible</title> <title>Midnight Rain</title> <title

Auto increment with XQuery Update?

久未见 提交于 2019-12-06 10:03:56
Does XQuery Update support auto increment attributes, just like auto increment fields in SQL ? I'm using BaseX as my database. Arjan Given an answer from Christian Grün on the BaseX mailing list , this is doable when the node one is adding is defined in the XQuery Update statement, and hence can be enhanced using an {enclosed expression} before inserting it: You might specify the attribute counter within your XML file/database and increment it every time when you insert an element. A simple example: input.xml: <root count="0"/> insert.xq: let $root := doc('input.xml')/root let $count := $root/

Insertion of an data in an XML using Basex

安稳与你 提交于 2019-12-05 07:19:10
I am storing two XML documents, namely hospital and office, in BaseX. The following is the office xml: <Staff> <Employee Name="Brian"> <Personal> <SSN> 666-66-6666 </SSN> </Personal> <StaffInfo> <Position> Doctor </Position> <AccountableTo> David </AccountableTo> </StaffInfo> </Employee> <Employee Name="David"> <Personal> <SSN> 555-55-5555 </SSN> </Personal> <StaffInfo> <Position> Doctor </Position> <AccountableTo /> </StaffInfo> </Employee> </Staff> In this XML I want to add one or more employees. How can I add elements using BaseX? XQuery has an update facility, an official W3C

Execute XQuery with BaseX

大城市里の小女人 提交于 2019-12-04 20:19:01
I am trying to use BaseX to run an XQuery with no success. I have tried typing commands like: doc("Bookstore.xml")//Bookstore //Bookstore XQUERY[//Bookstore] and i am getting these error messages: Stopped at C:/tools/libxml/file, 1/32: Unknown command: doc("Bookstore.xml")//Bookstore. Try HELP. Stopped at C:/tools/libxml/file, 1/12: Unknown command: //Bookstore. Try HELP. Stopped at C:/tools/libxml/file, 1/20: Unknown command: XQUERY[//Bookstore]. Try HELP. whenever i try to hit Execute Query . How can i make this actually work? I am watching the Stanford tutorials but those commands that are

how to specify a BaseX database from a FLOWR xquery?

删除回忆录丶 提交于 2019-12-04 19:01:09
How can I get all the titles with a FLOWR query against a specified database? Specifying a document works: thufir@dur:~/basex/microsoft$ thufir@dur:~/basex/microsoft$ basex titles.xq [warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java <title>Creepy Crawlies</title> <title>Lover Birds</title> <title>MSXML3: A Comprehensive Guide</title> <title>Maeve Ascendant</title> <title>Microsoft .NET: The Programming Bible</title> <title>Midnight Rain</title> <title>Oberon's Legacy</title> <title>Paradox Lost</title> <title>Splish Splash</title> <title>The Sundered Grail<

How to handle recursion in XQuery?

牧云@^-^@ 提交于 2019-12-04 13:24:23
问题 I'm trying to find all countries which are reachable by land by traversing from one country to another via land borders using the mondial.sql database. It must be done recursively and I found some functions online which I thought would be useful for joining sequences and to be able to exclude countries which have already been found. The problem is I end up in a loop even though the countries that are to be excluded seems to be handled properly. So my thinking is that I might have to define a

How to handle recursion in XQuery?

旧城冷巷雨未停 提交于 2019-12-03 08:39:57
I'm trying to find all countries which are reachable by land by traversing from one country to another via land borders using the mondial.sql database. It must be done recursively and I found some functions online which I thought would be useful for joining sequences and to be able to exclude countries which have already been found. The problem is I end up in a loop even though the countries that are to be excluded seems to be handled properly. So my thinking is that I might have to define a base case in some way to make the recursion stop once all possible countries have been found. How to

XQuery returning an error..?

只谈情不闲聊 提交于 2019-12-02 06:27:44
问题 Below is the XML file - <Continents> <Continent n="Asia"> <Country n="Thailand"> <City> <Name>Bangkok</Name> <Desc>Capital on Thailand</Desc> </City> </Country> <Country n="India"> <City> <Name>New Delhi</Name> <Desc>Capital on India</Desc> </City> <City> <Name>Mumbai</Name> <Desc>Financial capital on India</Desc> </City> <City> <Name>Chennai</Name> <Desc>A very good city</Desc> </City> </Country> </Continent> </Continents> Using baseX, I am writing a query to display the Name of cities