<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>30086</bug_id>
          
          <creation_ts>2017-04-12 20:56:08 +0000</creation_ts>
          <short_desc>[SER31] Indent=yes does not allow adding document-level whitespace</short_desc>
          <delta_ts>2017-04-12 21:01:59 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Serialization 3.1</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="C. M. Sperberg-McQueen">cmsmcq</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>128529</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2017-04-12 20:56:08 +0000</bug_when>
    <thetext>The serialization spec (3.0 and 3.1), XML method with indent=&quot;yes&quot;, does not allow addition of whitespace after the XML declaration or at the end of the document, or before or after document-level comments and processing instructions. The 2.0 spec did allow such whitespace to be added.

I think this is probably an oversight rather than an intentional change.

I think users would be upset if I changed my product to conform to this rule. See for example:

http://stackoverflow.com/questions/43375117/transformer-transform-writes-the-first-tag-on-the-same-line-as-xml/43379194#43379194

I suggest adding to section 5.1.4:

Whitespace characters MAY be added, elided or replaced at any place where it is permitted by the XML grammar provided that it is not in the content of an element (for example, after the XML declaration, or between document-level comments).

(This is actually more liberal than the 2.0 spec which does not allow whitespace to be inserted between adjacent top-level comments.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128530</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2017-04-12 21:01:59 +0000</bug_when>
    <thetext>I missed part of rule 2:

Whitespace characters MAY be added ... outside the content of any element.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>