[xquery-talk] Adaptive serialization and indendation
joewiz at gmail.com
Tue May 30 13:24:16 PDT 2017
Thanks for your reply. Would it be accurate to say, then, that the indent
parameter is delegated to the JSON output method when serializing map and
array items under the Adaptive output method?
I ask because I don't see anything explicitly stating that the JSON output
method is the delegate for serialization parameters affecting map and array
items under Adaptive output method. But since no other output method
claims to be able to serialize map and array items, the spec makes this
On Tue, May 30, 2017 at 3:45 PM, Michael Kay <mike at saxonica.com> wrote:
> I think the key to this is the word "directly". For many things the
> adaptive methods delegates to other output methods, and in cases where the
> adaptive method does not itself use a serialization parameter, but the
> method to which it delegates does, the phrase "is not directly applicable"
> is used. This is explained in section 10.1 of the serialization spec.
> Michael Kay
> On 30 May 2017, at 20:18, Joe Wicentowski <joewiz at gmail.com> wrote:
> Hi Liam,
> Many thanks for this helpful response about the "spirit" of the spec
> here. I have one last question - do you have a sense why section 10.1.4
> makes this statement?
> > The indent and suppress-indentation parameters are not directly
> applicable to the Adaptive output method. 
> (What throws me off a bit here, of course, is that Adaptive is the only
> output method that serializes maps *as* maps, so there isn't anywhere else
> to look for direct guidance on indentation of maps.)
> I may well proceed with the bugzilla request, but if you have any further
> insight on this question, it would help me understand whether the current
> phrasing was an unintentional oversight or whether there was some other
> consideration that led the WG to state the above.
> Thanks again,
>  https://www.w3.org/TR/xslt-xquery-serialization-31/#ADAPTIVE_INDENT
> On Sun, May 28, 2017 at 3:13 AM, Liam R. E. Quin <liam at w3.org> wrote:
>> On Sat, 2017-05-27 at 22:36 -0400, Joe Wicentowski wrote:
>> > [...]
>> > Is there room for implementations to use such indentation and still
>> > call it "adaptive"? If so, what basis is there in the spec for such
>> > behavior?
>> Here's a personal response - use bugzilla (see the status section of
>> the spec,
>> for details) if you want a Working Group response.
>> The Working Group will probably close soon, however.
>> has, for JSON,
>> The indent parameter controls whether the serializer adjusts the
>> whitespace in the serialized result so that a person will find it
>> easier to read.
>> (the spec doesn't say _which_ person!).
>> OK, and now we see, in 10.1,
>> For some item types the Adaptive output method will delegate
>> serialization to other output methods. [...] serialization parameters,
>> if set, will be passed down to the serialization method that is
>> applied to each item in the supplied sequence.
>> So as I read it you have as implementor a license to pass the indent
>> parameter down and to use JSON serialization for maps and arrays and
>> hence to allow the readable indenting.
>> Certainly that's in the _spirit_ of the adaptive method. And using a
>> serialization parameter would also let you pass the tests :) although
>> I don't know how important that is to you.
>> Again, this is based on my own reading of the spec, and being at the
>> meetings and on the calls, but it's not an "official" response.
>> Liam R. E. Quin <liam at w3.org>
>> The World Wide Web Consortium (W3C)
> talk at x-query.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the talk