[Bug 28140] Options of fn:serialize

https://www.w3.org/Bugs/Public/show_bug.cgi?id=28140

--- Comment #2 from Michael Kay <mike@saxonica.com> ---
So, how to do it?

Doing some examples is not difficult. The four "boxed" examples in
Serialization ยง3.1 become:

map {
  "method" : "xml",
  "version" : 1.0,
  "indent" : true()
}

map {
  "cdata-section-elements" : ["heading", "Q{http://example.org/book}footnote"]
}

map {
  "method" : "html"
}

map {
  "method" : "Q{http://example.org/ext}jsp"
  "use-character-maps" : map {
     "&#xAB;" : "&lt;%",
     "&#xBB;" : "%&gt;"
}

This suggests the following decisions:

* boolean values represented as booleans, not as "yes" and "no"

* lists represented as arrays, not as whitespace-separated strings

* QNames: we should accept bare names for names in no namespace, and for
namespaced names, either an EQName as a string, or an xs:QName value. This
applies equally to keys and values.

* Character maps: a nested map

The next question is how to specify it. We could either define a mapping
directly to the serialization parameters defined in the table at the start of
serialization section 3, or we could define a transformation to the XML format
for serialization parameters. The latter has attractions because it
automatically extends when new parameters are added, but I think it's going to
be very long-winded and difficult to get to grips with, so I'm inclined to do
the former.

Rather than defining the format within the fn:serialize function, I think it
makes sense to rename Serialization 3.1 as "Setting serialization parameters by
means of an XDM document or element node", and adding a new section 3.2 as
"Setting serialization parameters by means of an XDM map". I will go on to
draft the content of that section.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 10 March 2015 18:14:47 UTC