fn:normalize-space question, BaseX v8.4.1
Monday, 21 March 2016 · 2 messages
CG
Hi Bridger,
Thanks for your mail. It’s just a guess, but I assume that this is due to whitespace chopping, which is enabled by default in BaseX [1,2].
This default may be a little unfortunate, in particular for
mixed-content, but it was introduced at a very early stage, and it’d be tricky to simply change 'yes' to 'no'. And interestingly, the XML specification defines the xml:space attribute, but the only allowed values are "preserve" and "default" (I have no idea why there is no "strip" value).
Hope this helps,
Christian
[1] http://docs.basex.org/wiki/Options#CHOP
[2] http://docs.basex.org/wiki/Full-Text#Mixed_Content
Quoted text · Bridger Dyson-Smith · 25 lines
> I'm running into what looks some odd behavior with fn:normalize-space -- or > a gross user/operator error :) -- and was hoping to get some clarification. > > I've attached a Very Simple Sample Query, as well as an example input > document. Note: I'm using BaseX as a query processor, not as a db, but maybe > this has to do with a whitespace setting (thanks to the xml IRC channel for > the help with this). > > When I run the attached xq with Saxon (9.1.0.8J), I get the following > expected result: > fn:normalize-space: Letter, William H. Dennis in Knoxville, TN, to his > brother David, 1863 December 12 > > When I run the attached xq with BaseX (v8.4.1, gui), I get the following > unexpected result: > fn:normalize-space: > Letter,William H. DennisinKnoxville, TN, to his brother David,1863 December > 12 > > Could someone give me an idea about what is happening with this? I'm not > sure why the whitespace is chopped like this. > > Thanks in advance for your time and trouble. > Best, > Bridger
BD
Bridger Dyson-Smith21 Mar 2016 18:21 #
Hi all,
I'm running into what looks some odd behavior with
fn:normalize-space -- or a gross user/operator error :) -- and was hoping to get some clarification.
I've attached a Very Simple Sample Query, as well as an example input document. Note: I'm using BaseX as a query processor, not as a db, but maybe this has to do with a whitespace setting (thanks to the xml IRC channel for the help with this).
When I run the attached xq with Saxon (9.1.0.8J), I get the following expected result:
fn:normalize-space: Letter, William H. Dennis in Knoxville, TN, to his brother David, 1863 December 12
When I run the attached xq with BaseX (v8.4.1, gui), I get the following unexpected result:
fn:normalize-space:
Letter,William H. DennisinKnoxville, TN, to his brother David,1863 December 12
Could someone give me an idea about what is happening with this? I'm not sure why the whitespace is chopped like this.
Thanks in advance for your time and trouble.
Best,
BridgerWritten for BaseX 8.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery