The serialization spec says (HTML Output Method: the version and html-version Parameters):
If the html-version serialization parameter is not absent, the requested HTML version is the value of the html-version serialization parameter; otherwise, it is the value of the version serialization parameter.
fn:serialize defines the following defaults:
html-version: 5
version: 1.0
I wonder whether these rules cover all possible cases:
- Is it correct that HTML will be serialized as HTML5 if no options are supplied?
(: html-version=5 :)
serialize(<html/>, { 'method': 'html' })
- If only
version is supplied, is it correct that it is ignored because of html-version defaulting to 5?
(: html-version=5 ? :)
serialize(<html/>, { 'method': 'html', 'version': '4.01' })
- If no, i.e., if
{ 'version': '4.01' } is expected to overwrite the default for html-version, how can we know at which stage the default values are to be considered?
In addition, the serialization specification mentions versions HTML 4.01 and HTML5 various times, but it seems to be up to the implementation to decide which HTML versions to support. However, we seem to have test cases for 4.0 and 5. Would it make sense to define a miminum set of versions that need to be supported?
Finally, for some reason, the html-version parameter was defined to be a decimal, whereas version is defined as a string (since XQFO 3.1). Maybe this leads to the surprising result that Saxon seems to accept the option { 'version': '4.0' }, but rejects { 'html-version': 4 }.
The serialization spec says (HTML Output Method: the version and html-version Parameters):
fn:serialize defines the following defaults:
html-version:5version:1.0I wonder whether these rules cover all possible cases:
versionis supplied, is it correct that it is ignored because ofhtml-versiondefaulting to5?{ 'version': '4.01' }is expected to overwrite the default forhtml-version, how can we know at which stage the default values are to be considered?In addition, the serialization specification mentions versions HTML 4.01 and HTML5 various times, but it seems to be up to the implementation to decide which HTML versions to support. However, we seem to have test cases for
4.0and5. Would it make sense to define a miminum set of versions that need to be supported?Finally, for some reason, the
html-versionparameter was defined to be a decimal, whereasversionis defined as a string (since XQFO 3.1). Maybe this leads to the surprising result that Saxon seems to accept the option{ 'version': '4.0' }, but rejects{ 'html-version': 4 }.