I think it has to do with Tomcat webapps' context settings [1]. It
states that there is some kind of default context that will be used if
no other contexts are matched. I'm reading it now and will try some
experimenting.
I also note that my Tomcat setup is not configured for multiple
instance
Attached are two more solutions that might show you how it could work as well.
On Wed, May 27, 2015 at 10:51 PM, Noam Green wrote:
> OK. Solved it.
>
> Below is the final query:
>
> declare variable $in external;
> declare variable $out external;
> declare variable $vendor external;
>
>
> fil
> The input file is quite large, so I tried to edit it and leave only 4 lines.
> The strangest thing happened: when trying to run the shortened file in the
> editor, I now get the same error "Content is not allowed in prolog.".
This sounds still strange to me. Feel free to send me the zipped file
OK. Solved it.
Below is the final query:
declare variable $in external;
declare variable $out external;
declare variable $vendor external;
file:write-text-lines($out, 'Name,Host,Path,Count,Time'),
let $text := file:read-text($in)
let $xml := csv:parse($text, map { 'header': true() })
fo
Hi Christian,
The input file is quite large, so I tried to edit it and leave only 4
lines. The strangest thing happened: when trying to run the shortened file
in the editor, I now get the same error "Content is not allowed in prolog.".
Below is my query code:
declare variable $in external;
decla
> Why does it work in the editor [...]
This surprises me. Could you attach me your input file and the query?
In general, the input of doc() must always be an XML document.
However, you can use csv:parse for that (once again, please check out
our Wiki for an example).
>
> On Wed, May 27, 2015 at
Well, I'm trying to use XQuery to parse a CSV file, perform queries, and
save a CSV file.
Why does it work in the editor, and not from the command line?
On Wed, May 27, 2015 at 10:33 PM, Christian Grün
wrote:
> > C:\Temp>basex -b in=export_new.csv -b out=output.csv -b vendor=IID
> > CSV_Query.x
> C:\Temp>basex -b in=export_new.csv -b out=output.csv -b vendor=IID
> CSV_Query.xq
It looks as if you are trying to parse a CSV file (export_new.csv) as
XML. Is this really what you wanna do?
Christian
>
> I get the follwing error:
> Stopped at C:/Temp/CSV_Query.xq, 6/15:
> [FODC0002] "C:/Temp
Hi Christian,
Actually, this was very interesting :)
So, I managed to create a functional XQuery:
declare variable $in external;
declare variable $out external;
declare variable $vendor external;
file:write-text-lines($out, 'Name,Host,Path,Count,Time'),
for $x in doc($in)//record[contains(vend
Hi Noam,
> I missed the option of adding a comma after the initial file:write command
> (the editor was constantly asking for a return command).
In XQuery, multiple expressions can always be separated with commas.
For example, the following XQuery expression returns 4 items as
results:
1, "str
Thanks Christian.
I missed the option of adding a comma after the initial file:write command
(the editor was constantly asking for a return command).
Thanks again. It worked perfectly (although I must admit I used the dirty
option, as the CSV examples are mainly on adapting CSV into XML, while I
n
Hi Noam,
> let $csv := csv:serialize($result)
> return file:write-text($out, $csv)
>
> The CVS that comes out only includes one line [...]
As there are unlimited ways to represent XML nodes as CSV, there is no
way to automatically a representation that always works best. For more
information o
Hi again,
I've run into a small problem when using:
let $csv := csv:serialize($result)
return file:write-text($out, $csv)
The CVS that comes out only includes one line, and if I change the
file:write-text to file:append-text-lines, the result doesn't really
include all the information I need.
James,
I used it with ojdcs6 driver and it worked perfectly but I have not tested
with 1.7 driver. I guess it should work.
Nice thing with Basex SQL module is that you can export any size of sql
table to an xml file, there is no limitation.
I had to export huge SQL tables and BaseX did it perfectl
Hey Everyone,
I am having issues with using the Oracle 1.7 JDBC driver.
I copied the ojdbc7.jar file into the lib directory
Ran the basexgui.bat to add to class path
Tried to run this script:
let $conn := sql:init('jdbc:oracle:thin:pnm/pnm@orc1n.giants')
return
(sql:execute($conn, 'SELECT owne
Hi Kristian,
> I previously had BaseX 8.1.1 working as a Tomcat webapp and it all worked
> fine. I know tried to simply put BaseX82.war as another webapp, but the
> second webapp seems to connect to the BaseX instance in the first webapp.
True, same on my machine. It doesn't seem to be due to 8.2
Hi Ankit,
> I just wanted to know that, is there any limitation of no of database
> created in main memory mode using Java Application.
There is no fixed limit. How many databases are you planning to create
in your application? Thousands? Millions?
> Am i able to open multiple database in main
Hi,
I just wanted to know that, is there any limitation of no of database
created in main memory mode using Java Application. Also if it is possible
to create no of databases, Am i able to open multiple database in main
memory mode at a time ?.
Thanks,
Ankit
Hello!
I previously had BaseX 8.1.1 working as a Tomcat webapp and it all
worked fine. I know tried to simply put BaseX82.war as another webapp,
but the second webapp seems to connect to the BaseX instance in the
first webapp.
For example:
the address
http://tomcat.myhost.ee/BaseX82/rest/
li
19 matches
Mail list logo