Re: [basex-talk] Losing some space entities

2017-01-18 Thread France Baril
When I serialize these from a restxq to file with file:write

I get the  as  and  as  but I get none of the
other entities.

On Wed, Jan 18, 2017 at 6:59 PM, France Baril 
wrote:

> Import works, playing with webdav is giving good results so far. I still
> want to see how it outputs html through file:write with html5 serialization
> and if I can retain the entites in my pdfs. That's my next step.
>
> On Wed, Jan 18, 2017 at 6:02 PM, Christian Grün  > wrote:
>
>> Entities will only be serialized when using WebDAV. Did you try that as
>> well?
>>
>>
>> Am 19.01.2017 12:00 vorm. schrieb "France Baril" <
>> france.ba...@architextus.com>:
>>
>> I haven't run many tests yet, but importing the file and exporting the
>> files again from the gui only retains  Also, when the entity is in
>> decimal (&8332;), it gets transformed to hex (not a big deal in my book).
>> Other entities are 'applied', but not retained.
>>
>> I'm on BaseX 8.6 beta 4c3daeb
>>
>> On Sun, Jan 15, 2017 at 11:17 AM, Christian Grün <
>> christian.gr...@gmail.com> wrote:
>>
>>> Hi France,
>>>
>>> > why not implement all the space and joiner entities  to ?
>>>
>>> Good idea. I have added even some more characters (see [1]):
>>>
>>>   8192 – 8207
>>>   8232 – 8239
>>>   8287 – 8303
>>>
>>> A new snapshot (close to the final version 8.6) is online [2]; I’be
>>> grateful for some testing feedback!
>>>
>>> Christian
>>>
>>> [1] http://docs.basex.org/wiki/WebDAV#Resources
>>> [2] http://files.basex.org/releases/latest/
>>>
>>>
>>>
>>> > On Sat, Jan 14, 2017 at 4:34 AM, Christian Grün <
>>> christian.gr...@gmail.com>
>>> > wrote:
>>> >>
>>> >> Hi France,
>>> >>
>>> >> In the database, all Unicode characters will be stored in their
>>> >> standard (decoded) representation. As a result, it is not possible to
>>> >> preserve entities from an original document. For XML serialization via
>>> >> WebDAV, we have one special rule for converting non-breaking spaces
>>> >> (xA0) to entities. Which other Unicode characters would you like to
>>> >> have converted to entities?
>>> >>
>>> >> Cheers,
>>> >> Christian
>>> >>
>>> >>
>>> >> On Fri, Jan 13, 2017 at 7:45 PM, France Baril
>>> >>  wrote:
>>> >> > Hi,
>>> >> >
>>> >> > When I serialize content to HTML5, I lose some entities.
>>> >> >
>>> >> > xquery: adds '' in front of some content and outputs html
>>> >> > html: should have '', but doesn't. I've tried with 8204 and
>>> even
>>> >> > the
>>> >> > half space 8201.
>>> >> >
>>> >> > The only special space that seems to work is , but it won't
>>> do for
>>> >> > what I need right now.
>>> >> >
>>> >> > Code sample:
>>> >> >
>>> >> > let $target-table :=
>>> >> >   copy $copy := $base-table
>>> >> >   modify(
>>> >> >  for $td in $copy//tr/td[position()=$column-to-filter-by]
>>> >> >  let $new-value := ('', for $node in $td/node()
>>> return
>>> >> > $node)
>>> >> >  return replace value of node $td with $new-value
>>> >> >   )
>>> >> >   return $copy
>>> >> >
>>> >> > return
>>> >> >   $target-table
>>> >> >
>>> >> >
>>> >> > Is there any way to solve this?
>>> >> >
>>> >> >
>>> >> > --
>>> >> > France Baril
>>> >> > Architecte documentaire / Documentation architect
>>> >> > france.ba...@architextus.com
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > France Baril
>>> > Architecte documentaire / Documentation architect
>>> > france.ba...@architextus.com
>>>
>>
>>
>>
>> --
>> France Baril
>> Architecte documentaire / Documentation architect
>> france.ba...@architextus.com
>>
>>
>>
>
>
> --
> France Baril
> Architecte documentaire / Documentation architect
> france.ba...@architextus.com
>



-- 
France Baril
Architecte documentaire / Documentation architect
france.ba...@architextus.com


Re: [basex-talk] Losing some space entities

2017-01-18 Thread France Baril
Import works, playing with webdav is giving good results so far. I still
want to see how it outputs html through file:write with html5 serialization
and if I can retain the entites in my pdfs. That's my next step.

On Wed, Jan 18, 2017 at 6:02 PM, Christian Grün 
wrote:

> Entities will only be serialized when using WebDAV. Did you try that as
> well?
>
>
> Am 19.01.2017 12:00 vorm. schrieb "France Baril" <
> france.ba...@architextus.com>:
>
> I haven't run many tests yet, but importing the file and exporting the
> files again from the gui only retains  Also, when the entity is in
> decimal (&8332;), it gets transformed to hex (not a big deal in my book).
> Other entities are 'applied', but not retained.
>
> I'm on BaseX 8.6 beta 4c3daeb
>
> On Sun, Jan 15, 2017 at 11:17 AM, Christian Grün <
> christian.gr...@gmail.com> wrote:
>
>> Hi France,
>>
>> > why not implement all the space and joiner entities  to ?
>>
>> Good idea. I have added even some more characters (see [1]):
>>
>>   8192 – 8207
>>   8232 – 8239
>>   8287 – 8303
>>
>> A new snapshot (close to the final version 8.6) is online [2]; I’be
>> grateful for some testing feedback!
>>
>> Christian
>>
>> [1] http://docs.basex.org/wiki/WebDAV#Resources
>> [2] http://files.basex.org/releases/latest/
>>
>>
>>
>> > On Sat, Jan 14, 2017 at 4:34 AM, Christian Grün <
>> christian.gr...@gmail.com>
>> > wrote:
>> >>
>> >> Hi France,
>> >>
>> >> In the database, all Unicode characters will be stored in their
>> >> standard (decoded) representation. As a result, it is not possible to
>> >> preserve entities from an original document. For XML serialization via
>> >> WebDAV, we have one special rule for converting non-breaking spaces
>> >> (xA0) to entities. Which other Unicode characters would you like to
>> >> have converted to entities?
>> >>
>> >> Cheers,
>> >> Christian
>> >>
>> >>
>> >> On Fri, Jan 13, 2017 at 7:45 PM, France Baril
>> >>  wrote:
>> >> > Hi,
>> >> >
>> >> > When I serialize content to HTML5, I lose some entities.
>> >> >
>> >> > xquery: adds '' in front of some content and outputs html
>> >> > html: should have '', but doesn't. I've tried with 8204 and even
>> >> > the
>> >> > half space 8201.
>> >> >
>> >> > The only special space that seems to work is , but it won't do
>> for
>> >> > what I need right now.
>> >> >
>> >> > Code sample:
>> >> >
>> >> > let $target-table :=
>> >> >   copy $copy := $base-table
>> >> >   modify(
>> >> >  for $td in $copy//tr/td[position()=$column-to-filter-by]
>> >> >  let $new-value := ('', for $node in $td/node() return
>> >> > $node)
>> >> >  return replace value of node $td with $new-value
>> >> >   )
>> >> >   return $copy
>> >> >
>> >> > return
>> >> >   $target-table
>> >> >
>> >> >
>> >> > Is there any way to solve this?
>> >> >
>> >> >
>> >> > --
>> >> > France Baril
>> >> > Architecte documentaire / Documentation architect
>> >> > france.ba...@architextus.com
>> >
>> >
>> >
>> >
>> > --
>> > France Baril
>> > Architecte documentaire / Documentation architect
>> > france.ba...@architextus.com
>>
>
>
>
> --
> France Baril
> Architecte documentaire / Documentation architect
> france.ba...@architextus.com
>
>
>


-- 
France Baril
Architecte documentaire / Documentation architect
france.ba...@architextus.com


Re: [basex-talk] Losing some space entities

2017-01-18 Thread Christian Grün
Entities will only be serialized when using WebDAV. Did you try that as
well?


Am 19.01.2017 12:00 vorm. schrieb "France Baril" <
france.ba...@architextus.com>:

I haven't run many tests yet, but importing the file and exporting the
files again from the gui only retains  Also, when the entity is in
decimal (&8332;), it gets transformed to hex (not a big deal in my book).
Other entities are 'applied', but not retained.

I'm on BaseX 8.6 beta 4c3daeb

On Sun, Jan 15, 2017 at 11:17 AM, Christian Grün 
wrote:

> Hi France,
>
> > why not implement all the space and joiner entities  to ?
>
> Good idea. I have added even some more characters (see [1]):
>
>   8192 – 8207
>   8232 – 8239
>   8287 – 8303
>
> A new snapshot (close to the final version 8.6) is online [2]; I’be
> grateful for some testing feedback!
>
> Christian
>
> [1] http://docs.basex.org/wiki/WebDAV#Resources
> [2] http://files.basex.org/releases/latest/
>
>
>
> > On Sat, Jan 14, 2017 at 4:34 AM, Christian Grün <
> christian.gr...@gmail.com>
> > wrote:
> >>
> >> Hi France,
> >>
> >> In the database, all Unicode characters will be stored in their
> >> standard (decoded) representation. As a result, it is not possible to
> >> preserve entities from an original document. For XML serialization via
> >> WebDAV, we have one special rule for converting non-breaking spaces
> >> (xA0) to entities. Which other Unicode characters would you like to
> >> have converted to entities?
> >>
> >> Cheers,
> >> Christian
> >>
> >>
> >> On Fri, Jan 13, 2017 at 7:45 PM, France Baril
> >>  wrote:
> >> > Hi,
> >> >
> >> > When I serialize content to HTML5, I lose some entities.
> >> >
> >> > xquery: adds '' in front of some content and outputs html
> >> > html: should have '', but doesn't. I've tried with 8204 and even
> >> > the
> >> > half space 8201.
> >> >
> >> > The only special space that seems to work is , but it won't do
> for
> >> > what I need right now.
> >> >
> >> > Code sample:
> >> >
> >> > let $target-table :=
> >> >   copy $copy := $base-table
> >> >   modify(
> >> >  for $td in $copy//tr/td[position()=$column-to-filter-by]
> >> >  let $new-value := ('', for $node in $td/node() return
> >> > $node)
> >> >  return replace value of node $td with $new-value
> >> >   )
> >> >   return $copy
> >> >
> >> > return
> >> >   $target-table
> >> >
> >> >
> >> > Is there any way to solve this?
> >> >
> >> >
> >> > --
> >> > France Baril
> >> > Architecte documentaire / Documentation architect
> >> > france.ba...@architextus.com
> >
> >
> >
> >
> > --
> > France Baril
> > Architecte documentaire / Documentation architect
> > france.ba...@architextus.com
>



-- 
France Baril
Architecte documentaire / Documentation architect
france.ba...@architextus.com


Re: [basex-talk] Losing some space entities

2017-01-18 Thread France Baril
I haven't run many tests yet, but importing the file and exporting the
files again from the gui only retains  Also, when the entity is in
decimal (&8332;), it gets transformed to hex (not a big deal in my book).
Other entities are 'applied', but not retained.

I'm on BaseX 8.6 beta 4c3daeb

On Sun, Jan 15, 2017 at 11:17 AM, Christian Grün 
wrote:

> Hi France,
>
> > why not implement all the space and joiner entities  to ?
>
> Good idea. I have added even some more characters (see [1]):
>
>   8192 – 8207
>   8232 – 8239
>   8287 – 8303
>
> A new snapshot (close to the final version 8.6) is online [2]; I’be
> grateful for some testing feedback!
>
> Christian
>
> [1] http://docs.basex.org/wiki/WebDAV#Resources
> [2] http://files.basex.org/releases/latest/
>
>
>
> > On Sat, Jan 14, 2017 at 4:34 AM, Christian Grün <
> christian.gr...@gmail.com>
> > wrote:
> >>
> >> Hi France,
> >>
> >> In the database, all Unicode characters will be stored in their
> >> standard (decoded) representation. As a result, it is not possible to
> >> preserve entities from an original document. For XML serialization via
> >> WebDAV, we have one special rule for converting non-breaking spaces
> >> (xA0) to entities. Which other Unicode characters would you like to
> >> have converted to entities?
> >>
> >> Cheers,
> >> Christian
> >>
> >>
> >> On Fri, Jan 13, 2017 at 7:45 PM, France Baril
> >>  wrote:
> >> > Hi,
> >> >
> >> > When I serialize content to HTML5, I lose some entities.
> >> >
> >> > xquery: adds '' in front of some content and outputs html
> >> > html: should have '', but doesn't. I've tried with 8204 and even
> >> > the
> >> > half space 8201.
> >> >
> >> > The only special space that seems to work is , but it won't do
> for
> >> > what I need right now.
> >> >
> >> > Code sample:
> >> >
> >> > let $target-table :=
> >> >   copy $copy := $base-table
> >> >   modify(
> >> >  for $td in $copy//tr/td[position()=$column-to-filter-by]
> >> >  let $new-value := ('', for $node in $td/node() return
> >> > $node)
> >> >  return replace value of node $td with $new-value
> >> >   )
> >> >   return $copy
> >> >
> >> > return
> >> >   $target-table
> >> >
> >> >
> >> > Is there any way to solve this?
> >> >
> >> >
> >> > --
> >> > France Baril
> >> > Architecte documentaire / Documentation architect
> >> > france.ba...@architextus.com
> >
> >
> >
> >
> > --
> > France Baril
> > Architecte documentaire / Documentation architect
> > france.ba...@architextus.com
>



-- 
France Baril
Architecte documentaire / Documentation architect
france.ba...@architextus.com


Re: [basex-talk] Access-Control-Allow-Origin

2017-01-18 Thread Christian Grün
Hi Lambert,

Welcome to the list.

> %rest:header-param("Access-Control-Allow-Origin", "http://localhost:;)

With the %rest:header-param annotation, you can bind header parameters
from the client request to variables. An example:

  declare
%rest:path("/example1")
%rest:header-param("Access-Control-Allow-Origin", "{$origin}")
  function local:example1($origin) {
"Origin: " || $origin
  };

If you want to create a response with this parameter, you need to
build a custom response. In BaseX, you can either use the
web:response-header function for this, or add the XML response created
by this function instead (see [1] and [2]):

  declare
%rest:path("/example2")
  function local:example2() {
web:response-header(
  map {} ,
  map { "Access-Control-Allow-Origin": "http://localhost:; }
),

  };

Hope this helps,
Christian

[1] http://docs.basex.org/wiki/Web_Module#web:response-header
[2] http://docs.basex.org/wiki/RESTXQ#Custom_Response


>
> in my *.xqm file would have solved the problem. Instead, I'm getting this
> error:
>
> 400 (Stopped at /Users/shunting/basex/webapp/restxq.xqm, 395/14:
> [bxerr:BASX0003] Invalid path template: "http://localhost:;.)
>
>
> I'm stymied because I don't see how a URL could match a path template in the
> first place. Is the "Access-Control-Allow-Origin" not a supported parameter?
>
> All I want to do is get my two servers on my machine to talk to each other.
> If this isn't the right way, is there another one?
>
> Thank you!
>
> * * *
>
> Every communication from this account is off the record, unless explicitly
> put on the record.


[basex-talk] Access-Control-Allow-Origin

2017-01-18 Thread lambert strether
Hi:
This is probably an extremely newbie-ish question. I'm developing on localhost 
using MAMP/PHP at port , and basex at port 8984. So I am running into 
"Cross-Origin Resource Sharing" issues, apparently, when I have the PHP server 
issue an XMLHttpRequest to the Basex server.
I would have thought that this line in my REST GET function

%rest:header-param("Access-Control-Allow-Origin", "http://localhost:;)

in my *.xqm file would have solved the problem. Instead, I'm getting this error:

400 (Stopped at /Users/shunting/basex/webapp/restxq.xqm, 395/14: 
[bxerr:BASX0003] Invalid path template: "http://localhost:;.)

I'm stymied because I don't see how a URL could match a path template in the 
first place. Is the "Access-Control-Allow-Origin" not a supported parameter?
All I want to do is get my two servers on my machine to talk to each other. If 
this isn't the right way, is there another one? 
Thank you! * * *

Every communication from this account is off the record, unless explicitly put 
on the record.

Re: [basex-talk] Gravierende Performance-Einbüße bei Persistierung von mehr als 5000, 160 KB große XML Datenstrukturen.

2017-01-18 Thread Christian Grün
Hi Lucian,

Thanks for taking your time, rerunning the tests and do some profiling.

> When inserting a 160 KB xml structure 100.000 times, the persist operation 
> duration starts by  ~45 ms and reach ~2000 ms after 68.000 persist 
> invocations and 16 hours of run time (!)

Indeed this differs quite a lot from the tests I have made so far, and
from the patterns I am used to.

It was helpful to have a look into the Java profiling files: A plain
FileOutputStream.open call takes most of the time, while it’s hardly
measurable in my own tests. Do you work with a local file system?
Maybe the file listing of your database directory could shed some more
light here.

I would additionally assume that this that you were closing and
opening your database after each addition, right? Obviously this makes
sense if no bulk operations take place; it’s just different from what
I did in my tests.

> There are actually two AUTOFLUSH-related issues: […]

You are obviously right: AUTOFLUSH should only be used for bulk
operations, and avoided if persistency of data is critical. And the
addition of documents will always be faster if the database is small
(but it should definitely not take more than a second to add a single
small document).

Best,
Christian