[
https://issues.apache.org/jira/browse/VXQUERY-189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15227143#comment-15227143
]
Till Westmann commented on VXQUERY-189:
---------------------------------------
In theory we should implement the XQuery Serialization spec [1][2]. However
we're not closely following this so far. One of the reasons is that the result
for the serialization as described in the spec aims to produce a (single)
well-formed XML document while VXQuery aims to work on sequences of documents.
One option that I see to address our problem is to implement a part of the
sequence normalization [3] described in the serialization spec - up to the
point that text nodes get created for sequences of atomic values. That way we
could have a result that is a sequence of nodes - containing text nodes that
contain space separated atomic values. We could then pass the nodes to the
printer and thus introduce the newlines at node boundaries and not between
atomic values.
Would that work?
[1] https://www.w3.org/TR/xslt-xquery-serialization/
[2] https://www.w3.org/TR/xslt-xquery-serialization-3/
[3] https://www.w3.org/TR/xslt-xquery-serialization/#serdm
> Separate values in a sequence using single space when serializing
> ------------------------------------------------------------------
>
> Key: VXQUERY-189
> URL: https://issues.apache.org/jira/browse/VXQUERY-189
> Project: VXQuery
> Issue Type: Bug
> Reporter: Riyafa Abdul Hameed
>
> Current implementation of the serializer uses a new line(\n) character to
> separate the values in a sequence when printing them. In some cases it is
> necessary to have a single whitespace between values. It is essential to find
> out where the new line is introduced and to decide in which cases we want a
> single-space and in which one a new line is preferable.
> For an example consider the function fn:tokenize():
> The expected result for fn:tokenize("The cat sat on the mat", "\s+") is:
> The cat sat on the mat
> But the result generated and printed on the console is:
> The
> cat
> sat
> on
> the
> mat
> which is incorrect.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)