default concatenation of strings? BaseX 10.5
Greetings!
I'm converting Hebrew text, word by word, into code points, which is returned as:
1493 1463 1497 1468 1463 1513 1473 1456 1499 1468 1461 1448 1501
1500 1464 1489 1464 1436 1503
.... (the file is quite long)
What I expect is described at: https://www.w3.org/TR/xslt-xquery-serialization/#sequence-normalization
"If the |item-separator| serialization parameter is absent, then for each subsequence of adjacent strings in /S_2 /, copy a single string to the new sequence equal to the values of the strings in the subsequence concatenated in order, each separated by a single space."
I maybe very wrong but shouldn't that render the strings as?:
1493 1463 1497 1468 1463 1513 1473 1456 1499 1468 1461 1448 1501
and,
1500 1464 1489 1464 1436 1503
I've tried using replace($a, "\n", " ") but it complains that $a is a sequence, which it is.
Then I tried:
for $char in $areturn ($char, " ")
Now I get:
1493
1463
1497
etc.
I saw the new line settings under serialization but there didn't appear to be any way to defeat them altogether.
Thanks!
Patrick
Quoted text · Patrick Durusau · 9 lines
On Wed, 2023-04-05 at 16:01 -0400, Patrick Durusau wrote: > Greetings! > > I'm converting Hebrew text, word by word, into code points, which is > returned as: > > 1493 > 1463 > 1497
etc
When you say returned as, i am guessing you mean that's what shows up in the BaseX "results" window, which uses "adaptive" serialization.
You could use string-join(your query here, ' ') of course, to make a single string; in that window sequences are shown one item per line.
liam
Liam,
Thanks!
Yes, in the response window and I didn't know it used "adaptive" serialization.
No promises but I hope to remember that!
Hope you are having a great week!
Patrick
Quoted text · Patrick Durusau · 22 lines
On 4/5/23 16:25, Liam R. E. Quin wrote: > On Wed, 2023-04-05 at 16:01 -0400, Patrick Durusau wrote: >> Greetings! >> >> I'm converting Hebrew text, word by word, into code points, which is >> returned as: >> >> 1493 >> 1463 >> 1497 > etc > > When you say returned as, i am guessing you mean that's what shows up > in the BaseX "results" window, which uses "adaptive" serialization. > > You could use string-join(your query here, ' ') of course, to make a > single string; > in that window sequences are shown one item per line. > > > liam >
Written for BaseX 10.5. BaseX may have changed since: please check the current documentation.