BaseX

how to include the value of position() in an Xquery result?

六月ゝ 毕业季﹏ 提交于 2021-02-11 14:22:48
问题 Without using tumbling windows, how is the position itself included in a result? Obviously "$p" should be the "index" of each $item in $items. That being said, iteration isn't guaranteed to be sequential at all. output: <result> <items> <item pos="$p">5</item> <item pos="$p">3</item> <item pos="$p">7</item> <item pos="$p">2</item> <item pos="$p">7</item> <item pos="$p">3</item> </items> </result> query: xquery version "3.1"; let $items := (5,3,7,2,7,3) return <result> <items> { for $item in

How to add an XML string to an existing BaseX database?

蓝咒 提交于 2021-02-11 14:10:36
问题 Using org.json and, crucially, JSONArray rather than JSONObject , managed to, seemingly at least, get XML output through Twitter4J . However, it shows as: The Markup In The Document Following The Root Element Must Be Well-formed., Line '1', Column '98'. The Markup In The Document Following The Root Element Must Be Well-formed. When validation is attempted. It does, however, have at least the appearance of XML . Assuming that BaseX will wrangle the XML sufficiently, I'm looking to add the

how to get or acquire tweets as JSON or XML?

扶醉桌前 提交于 2021-02-11 14:08:48
问题 I'm intrigued by BaseX documention on Twitter utilizing a JSON module for converting to XML -- but how was the data acquired? To populate a database with tweets, for similar results, what's most expedient method? (For expediant, read quick-and-dirty without tokens.) 来源: https://stackoverflow.com/questions/58350152/how-to-get-or-acquire-tweets-as-json-or-xml

BaseX REST API: Set custom HTTP response header

冷暖自知 提交于 2021-02-08 04:54:09
问题 I want to include the following HTTP header to all responses by the BaseX REST API: Access-Control-Allow-Origin: * Is this possible? 回答1: BaseX uses Jetty below the hood. You can modify the web.xml file to make Jetty send CORS headers, but either use at least BaseX 8.6.3 which added the jetty-servlets library or have to add the jetty-servlets jar to your $CLASSPATH (BaseX already ships jetty-servlet , which is a different class; and be sure to fetch the appropriate version matching what's

Converting xml to csv from XQuery in BaseX

不想你离开。 提交于 2021-02-07 08:38:53
问题 The reason for which I'm writing is because I have a database of approx 1k of xmls in BaseX. I already cleaned it and got the info I wanted. Nevertheless, I want to be able to export that data in the CSV format. When I tried with the code given in the BaseX documentation it gave me this: Desc,Cantidad,Valor,Fecha,Lugar,UUID ,,,,, ,,,,, And it should show the data between the commas. What I am asking is how should I modify my code in order for the data to appear. My code is the following:

Converting xml to csv from XQuery in BaseX

非 Y 不嫁゛ 提交于 2021-02-07 08:37:41
问题 The reason for which I'm writing is because I have a database of approx 1k of xmls in BaseX. I already cleaned it and got the info I wanted. Nevertheless, I want to be able to export that data in the CSV format. When I tried with the code given in the BaseX documentation it gave me this: Desc,Cantidad,Valor,Fecha,Lugar,UUID ,,,,, ,,,,, And it should show the data between the commas. What I am asking is how should I modify my code in order for the data to appear. My code is the following:

how to add a flat text file to BaseX?

本秂侑毒 提交于 2021-02-04 21:43:08
问题 What does it mean "content is not allowed in prolog"? Perhaps the input method needs to be set first? I'm trying to add data to an empty database in Basex with dummy data as below: thufir@dur:~/flwor/people$ thufir@dur:~/flwor/people$ basex BaseX 9.0.1 [Standalone] Try 'help' to get more information. > open people Database 'people' was opened in 199.0 ms. > > add to people /home/thufir/flwor/people/people.txt "/home/thufir/flwor/people/people.txt" (Line 2): Content is not allowed in prolog. >

how to add a flat text file to BaseX?

人盡茶涼 提交于 2021-02-04 21:42:09
问题 What does it mean "content is not allowed in prolog"? Perhaps the input method needs to be set first? I'm trying to add data to an empty database in Basex with dummy data as below: thufir@dur:~/flwor/people$ thufir@dur:~/flwor/people$ basex BaseX 9.0.1 [Standalone] Try 'help' to get more information. > open people Database 'people' was opened in 199.0 ms. > > add to people /home/thufir/flwor/people/people.txt "/home/thufir/flwor/people/people.txt" (Line 2): Content is not allowed in prolog. >

How to connect mysql with Basex?

泪湿孤枕 提交于 2021-02-04 14:07:52
问题 I have a application with Mysql as Database which is using a lot XML/HTML. I would like to process mysql data in BaseX and update database through it. Is there any simple way to connect Database? I checked http://docs.basex.org/wiki/SQL but it is not working. Can you please give me simple example what I have to do to connect? I got error An SQL exception occurred: 'No suitable driver found for jdbc:mysql://localhost:3306/test' here is my code: let $conn := sql:connect("jdbc:mysql://localhost

How to connect mysql with Basex?

半世苍凉 提交于 2021-02-04 14:05:46
问题 I have a application with Mysql as Database which is using a lot XML/HTML. I would like to process mysql data in BaseX and update database through it. Is there any simple way to connect Database? I checked http://docs.basex.org/wiki/SQL but it is not working. Can you please give me simple example what I have to do to connect? I got error An SQL exception occurred: 'No suitable driver found for jdbc:mysql://localhost:3306/test' here is my code: let $conn := sql:connect("jdbc:mysql://localhost