Skip to content

HTML serialization: html-version and version parameters; allowed values #1889

Description

@ChristianGruen

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:

  1. Is it correct that HTML will be serialized as HTML5 if no options are supplied?
(: html-version=5 :) 
serialize(<html/>, { 'method': 'html' })
  1. 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' })
  1. 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 }.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething that doesn't work in the current specificationEditorialMinor typos, wording clarifications, example fixes, etc.PR PendingA PR has been raised to resolve this issueSerializationAn issue related to the Serialization specXQFOAn issue related to Functions and Operators

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions