[
https://issues.apache.org/jira/browse/VXQUERY-189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15255893#comment-15255893
]
Riyafa Abdul Hameed commented on VXQUERY-189:
---------------------------------------------
When trying to implement this I thought I could do it this way:
When the result is a sequence the printSequence(PrintStream ps,
SequencePointable seqp, String between) method (line 428) in the class
XMLSerializer would be called and it could be changed to create textnodes for
sequences of atomic values before printing them.
But the issue is that this method doesn't get called, instead the contents of
the sequence are printed using the print(byte[] b, int s, int l, PrintStream
ps) method which is called directly for each item in the sequence by the method
printTuple(IFrameTupleAccessor tAccess, int tIdx) of the class
org.apache.hyracks.algebricks.runtime.writers.PrinterBaseWriterFactory.
So as I understand the when the byte array is passed to the print(byte[] b, int
s, int l, PrintStream ps), the array with SEQUENCE_TAG is omitted.
Can you please suggest if you could think of any way to resolve this? I shall
also attempt to find a way if I can.
> 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)