This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5993 - [SER] HTML indent and the CSS white-space property
Summary: [SER] HTML indent and the CSS white-space property
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Serialization 1.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Henry Zongaro
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
Reported: 2008-08-26 15:47 UTC by Michael Kay
Modified: 2009-06-16 15:26 UTC (History)
0 users

See Also:


Description Michael Kay 2008-08-26 15:47:18 UTC
For the indent attribute of the XHTML and HTML output methods we say:

the (X)HTML output method MAY add or remove whitespace as it serializes the result tree, so long as it does not change the way that a conforming HTML user agent would render the output.

There is also a Note saying "This rule can be satisfied by observing the following constraints: ..."

The way that a conforming HTML user agent renders the output may depend on the CSS white-space property for the style in question. (This has values "normal", "pre", and "nowrap"). In the presence of white-space:pre or white-space:nowrap, a serializer that follows all the rules given in the Note will nevertheless cause a change in the visible appearance of the HTML in the browser.

It does not seem to me appropriate to expect the serializer to know anything about the CSS styles in use by the HTML user agent. This suggests that we should make the set of constraints in the Note normative, rather than the intent of not changing the visible appearance.

We might also want (in a future version) to consider adding a serialization attribute along the lines of saxon:suppress-indentation - see

(this was actually introduced for a different reason, to handle islands of narriative content within a data-oriented document, as seen for example in our errata documents)
Comment 1 Henry Zongaro 2008-10-02 15:49:14 UTC
I agree with Michael's assessment and his suggestion for resolving the problem.  I'd like to propose the following revisions:

. In the first paragraph of section 6.1.3,[1] replace the phrase "so long as it does not change the way that a conforming HTML user agent would render the output" with "if it observes the following constraints."

. Replace the first paragraph in the Note in 6.1.3 that reads "This rule can be satisfied by observing the following constraints:" with "The effect of the above constraints is to ensure any insertion or deletion of whitespace would not affect how a conforming HTML user agent would render the output, assuming the serialized document does not refer to any HTML style sheets."

. Remove the bulleted list from the Note in 6.1.3 and place it in normative text after the first paragraph.

. In section 7.4.3,[2] make exactly the same changes as above, except that, instead of a bulleted list, it is the second, third and fourth paragraphs in the Note in 7.4.3 that should be moved to normative text after the first paragraph of 7.4.3.  They should be made into a bulleted list in so doing.

Comment 2 Henry Zongaro 2009-02-05 17:56:29 UTC
At its teleconference of 2009-02-05, the XSL WG considered and approved the
substantive changes proposed in comment 1.  XQuery WG consideration of the bug
is still pending.

The XSL WG directed Michael Kay to submit a request for enhancement against a future revision of the Serialization recommendation for the suppress-indentation serialization parameter he mentions in comment 0.
Comment 3 Henry Zongaro 2009-02-10 18:39:50 UTC
At the joint teleconference of 2009-02-10, the XQuery WG concurred with the decision of the XSL WG.  This will be erratum SE.E9.
Comment 4 Henry Zongaro 2009-06-16 15:26:16 UTC
Published in "Errata for XSLT 2.0 and XQuery 1.0 Serialization"[1] and PER draft of "XSLT 2.0 and XQuery 1.0 Serialization (Second Edition)."[2]