Project

Profile

Help

Bug #3842

closed

Whitespace added before paragraph end tag in HTML serialization

Added by Michael Kay over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Serialization
Sprint/Milestone:
-
Start date:
2018-07-16
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
trunk
Fix Committed on Branch:
trunk
Fixed in Maintenance Release:
Platforms:

Description

With indentation enabled, using the HTML output method, the content

<p>Another &#xa; para</p>

is serialized as

<p>Another 
 para
</p>

Which contravenes the serialization specification. This states (for both XQ1.0/XT2.0 and XQ3.1/XT3.0)

Whitespace MUST NOT be added other than before or after an element, or adjacent to an existing whitespace character.

(It is allowed however by XSLT 1.0, where the equivalent rule is

"If the indent attribute has the value yes, then the html output method may add or remove whitespace as it outputs the result tree, so long as it does not change how an HTML user agent would render the output."

Actions #1

Updated by Michael Kay over 6 years ago

Although this is clearly a non-conformance, changing the output here would affect the output of many queries and transformations (and might, for example, cause users' XSpec test suites to fail). Since no-one has complained about the problem, I think it's probably safest to defer fixing it until the next major release.

Actions #2

Updated by Michael Kay over 6 years ago

Added QT3 test case Serialization-html-47

Actions #3

Updated by Michael Kay over 6 years ago

Similarly, indenting whitespace is not permitted before or after a comment or processing instruction unless there happens to be adjacent whitespace or an adjacent start/end tag.

Actions #4

Updated by Michael Kay over 6 years ago

  • Category set to Serialization
  • Status changed from New to Resolved
  • Priority changed from Low to Normal
  • Applies to branch trunk added
  • Fix Committed on Branch trunk added

I decided to continue indenting the paragraph end tag on the 9.8 branch in the interests of stability, but I have made the change for 9.9.

Actions #5

Updated by O'Neil Delpratt about 6 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.9.0.1 added

Bug fix applied in the Saxon 9.9.0.1 major release.

Please register to edit this issue

Also available in: Atom PDF