Hi Stefania,
Sorry for the delay.
If I run you example, I **think** it behaves as intended, all <a/>-Elements but the one marked with xml:space are chopped.
This is what it looks like here:
michael@mbp:~/tmp/ml|⇒ cat example.xq
db:create('test',
"<doc>
<a> stefy </a>
<a xml:space='preserve'> stefy </a>
<b> stefy </b>
</doc>",
"doc.xml"
)
michael@mbp:~/tmp/ml|⇒ basex example.xq
michael@mbp:~/tmp/ml|⇒ basex "db:open('test')"
<doc>
<a>stefy</a>
<a xml:space="preserve"> stefy </a>
<b>stefy</b>
</doc>%
…if I add CHOP=false, the whitespace will be kept on all elements:
I am sure we will eventually be able to solve this mystery :-)
Best
Michael
thanks MichaelI run your suggestion
and it seems to affect all the elements on my BaseX.I also verified
that the 'chop' property was still true after the execution of the xquery
(> open testDatabase 'test'
was opened in 7.29 ms.> get chopCHOP: true)db:create('test',"<doc> <a>
stefy </a> <a xml:space='preserve'>
stefy </a> <b>
stefy </b></doc>","doc.xml") ========>>>>><doc> <a>
stefy </a> <a xml:space="preserve"> stefy
</a> <b>
stefy </b></doc>db:replace("test",
"doc1.xml","<doc> <a>
stefy </a> <b>
stefy </b></doc>")========>>>>><doc> <a>
stefy </a> <b>
stefy </b></doc>Am i missing something?thanksStefaniaFrom:
Michael
Seiferle <ms@basex.org>To:
Gerrit
Imsieke <gerrit.imsieke@le-tex.de>, stefy@us.ibm.comCc:
BaseX
<basex-talk@mailman.uni-konstanz.de>Date:
01/29/2018
11:22 AMSubject:
Re:
[basex-talk] xml element beginning and end space loss
Hi & thanks Gerrit,Hi Stefania,You may even decide to chop-or-not on
a per-element basis:db:create('test',"<doc> <a> stefy </a> <a xml:space='preserve'>
stefy </a></doc>","doc.xml")Will preserve whitespace in the second
<a />-Element while chopping in the first one.=> http://docs.basex.org/wiki/Options#CHOPBest from Konstanz :-]MichaelAm 27.01.2018 um 01:06 schrieb Imsieke,
Gerrit, le-tex <gerrit.imsieke@le-tex.de>:Luckily you can switch it off.