Re: [basex-talk] Command line options not working with update operation on input file

2018-12-07 Thread Christian Grün
Hi Daniel.

The argument order is important in BaseX; you could try the following variant:

  basex.bat -u -w -ifile.xml -sindent=no update.xquery

If this doesn’t help, you could append the CHOP=true in your .basex
configuration file.

Hope this helps
Christian



On Fri, Dec 7, 2018 at 3:40 PM Zimmel, Daniel  wrote:
>
> Hello,
>
> can anyone give me a hint on the behaviour of the command line options in 
> BaseX 9.0.2?
>
> When I try an update operation on a file given with "-i", neither the option 
> "-w" nor any serialisation option gets evaluated; while the update operation 
> with "-u" is working correctly, my whitespace gets happily chopped.
>
> CCL:
> $ basex.bat -ifile.xml -sindent=no -u -w update.xquery
>
> XQ:
> for $c in doc(document-uri())//element
> return replace value of node $c with "TEST"
>
> A workaround is using fetch:xml() with document-uri(), which does leave any 
> whitespace intact and does no indentation (no parameters necessary).
>
> declare variable $doc := document-uri();
> for $c in fetch:xml($doc)//element
> return replace value of node $c with "TEST"
>
> Unfortunately my requirement is I cannot use specific BaseX-functions in this 
> specific update script.
>
> My XML:
>
> 
>   
> Kennung
>  eins
> 
>  Test fett 
> kursiv Text Text.
>   
> 
>
> Thanks, Daniel
>
>


[basex-talk] Command line options not working with update operation on input file

2018-12-07 Thread Zimmel, Daniel
Hello,

can anyone give me a hint on the behaviour of the command line options in BaseX 
9.0.2?

When I try an update operation on a file given with "-i", neither the option 
"-w" nor any serialisation option gets evaluated; while the update operation 
with "-u" is working correctly, my whitespace gets happily chopped.

CCL:
$ basex.bat -ifile.xml -sindent=no -u -w update.xquery

XQ:
for $c in doc(document-uri())//element
return replace value of node $c with "TEST"

A workaround is using fetch:xml() with document-uri(), which does leave any 
whitespace intact and does no indentation (no parameters necessary).

declare variable $doc := document-uri();
for $c in fetch:xml($doc)//element
return replace value of node $c with "TEST"

Unfortunately my requirement is I cannot use specific BaseX-functions in this 
specific update script.

My XML:


  
Kennung
 eins

 Test fett 
kursiv Text Text.
  


Thanks, Daniel




Re: [basex-talk] Strange response from Docker BaseXDBA

2018-12-07 Thread Michael Seiferle
Hi Huib, 

Thanks for the pointer to stackoverflow, I missed that one!
I added an answer over there: 
https://stackoverflow.com/questions/53462688/docker-basex-dba/53667345#53667345 

 — his problem somehow unrelated to your problem as the question refers to an 
older DBA version.

However the solution presented there should work well.
The docker build in our root folder will not add the DBA, so that’s most 
probably the issue?
> I did a "docker build -t basexdba ." in de root of the source folder of BaseX 
> as per the DBA example in http://docs.basex.org/wiki/Docker.

You may validate if the dba folder is present in your running container via 
`docker exec $CONTAINER-ID` — you can find the container id using `docker ps`:

Below I have to containers, one contains  the dba folder, the other does not.

> michael@mbp:~/tmp|⇒  docker exec 99f650b42036 ls '/srv/basex/webapp'
>> WEB-INF
> michael@mbp:~/tmp|⇒  docker exec 3a4eb9927c90 ls '/srv/basex/webapp'
>> WEB-INF
>> chat
>> dba
>> restxq.xqm
>> static


Hope this helps! Let me know if I can shed some more light on this issue!

Best
Michael

> Am 06.12.2018 um 13:29 schrieb Christian Grün :
> 
> Hi Huib,
> 
> I’ve never tried our docker images, but as far as I know, the last DBA
> docker images are based on 8.5.4. Are you still working with BaseX 8?
> 
> Best,
> Christian
> 
> 
> 
> On Thu, Nov 29, 2018 at 5:29 PM Huib Verweij  wrote:
>> 
>> Hi,
>> 
>> I have a strange case of receiving a “No function found that matches the 
>> request” message from BaseXDBA.
>> 
>> I did a "docker build -t basexdba ." in de root of the source folder of 
>> BaseX as per the DBA example in http://docs.basex.org/wiki/Docker.
>> 
>> I got a basexdba:latest image and started it with “docker run -p 8984:8984 
>> basexdba:latest”.
>> 
>> According to the documentation I should get the dba page with: 
>> http://localhost:8984/dba but the server returns "No function found that 
>> matches the request.".
>> 
>> There’s also a recent question on Stackoverflow about this: 
>> https://stackoverflow.com/questions/53462688/docker-basex-dba/53543130#53543130
>> 
>> Regards,
>> 
>> Huib.