<?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>5458</bug_id>
          
          <creation_ts>2008-02-07 13:42:00 +0000</creation_ts>
          <short_desc>[SER] indentation with xml output method</short_desc>
          <delta_ts>2008-04-10 15:20:50 +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 1.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</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="Tim Mills">tim</reporter>
          <assigned_to name="Henry Zongaro">zongaro</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>18816</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-02-07 13:42:00 +0000</bug_when>
    <thetext>Given the statement

&quot;Whitespace characters SHOULD NOT be added in places where the characters would constitute significant whitespace, for example, in the content of an element whose content model is known to be mixed.&quot;

when serializing the result of an XQuery, does this mean that an implementation SHOULD NOT add any whitespace unless the elements are known to have  element-only content models, or simple content with the &quot;whiteSpace&quot; facet set to &quot;collapse&quot;?  

Specifically, if an XQuery produces an untyped document, since xs:untyped is mixed, does this mean that an implementation SHOULD NOT perform any indentation?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18818</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-02-07 14:00:36 +0000</bug_when>
    <thetext>&gt;or simple content with the &quot;whiteSpace&quot; facet set to &quot;collapse&quot;?

You&apos;re not allowed to add whitespace to elements with a simple content model under rule 2: Whitespace characters MUST NOT be added other than adjacent to an element node, that is, immediately before a start tag or immediately after an end tag.

I think it&apos;s reasonable to interpret &quot;whose content model is known to be mixed&quot; as meaning that there is a known content model and it is explicitly mixed; the word &quot;known&quot; must mean something, and my interpretation is &quot;not xs:untyped and not xs:anyType&quot;. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18819</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-02-07 14:11:01 +0000</bug_when>
    <thetext>Thanks Mike.  So under your interpretation, a serialization of a query such as

&lt;mixed-text-and-elements&gt;
  &lt;element /&gt;
  &lt;element /&gt;
  &lt;element /&gt;
  &lt;element /&gt;
  &lt;element /&gt;text&lt;element /&gt;
&lt;/mixed-text-and-elements&gt;

could be indented as above, even though mixed-text-and-elements mixes text and elements?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18820</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-02-07 14:30:03 +0000</bug_when>
    <thetext>Yes. The actual Saxon output is:

&lt;mixed-text-and-elements&gt;
   &lt;element/&gt;
   &lt;element/&gt;
   &lt;element/&gt;
   &lt;element/&gt;
   &lt;element/&gt;text&lt;element/&gt;
&lt;/mixed-text-and-elements&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18823</commentid>
    <comment_count>4</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2008-02-07 15:37:22 +0000</bug_when>
    <thetext>I believe Mike&apos;s interpretation in comment #1 was the intended interpretation.  The particular statement Tim quotes in comment #0 was first introduced in response to public comment qt-2004Feb0930-01.  See [1] for the comment and the official response.  I think some clarification of the text is in order.

[1] http://lists.w3.org/Archives/Public/public-qt-comments/2004Sep/0004.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19416</commentid>
    <comment_count>5</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2008-03-11 17:29:00 +0000</bug_when>
    <thetext>At the joint teleconference of 2008-03-11, the working groups discussed a general approach to resolving this issue in which an element would be subject to indentation if it is annotated with a user-defined type (neither xs:untyped nor xs:anyType); that would be in accordance with the response to qt-2004Feb0930-01.  To ensure the type annotation is preserved, the sequence normalization process described in section 2 of the Serialization Recommendation needs to make it explicit that type annotations are preserved.

I would like to propose the following changes to Serialization:

1. In the third paragraph of section 2, after the first sentence, add &quot;Where a step in the sequence normalization process indicates that a node should be copied, the copy is performed in the same way as an XSLT xsl:copy-of instruction that has a validation attribute whose value is preserve and has a select attribute whose effective value is the node, as described in Section 11.9.2 &quot;Deep Copy&quot; of XSLT 2.0, or equivalently in the same way as an XQuery content expression as described in Step 1e of Section 3.7.1.3 &quot;Content&quot; of XQuery 1.0, where the construction mode is preserve.&quot; (with appropriate cross-document links to the relevant sections of XSLT and XQuery and to the definitions of &quot;content expression&quot; and &quot;construction mode&quot;.)

2. In the Note in Section 2, in the first example box add the attribute  &quot;validation=&apos;preserve&apos;&quot; to both the xsl:document and xsl:copy-of instructions, and in the second example box add the declaration &quot;declare construction preserve;&quot; to the start of the example.

3. In Section 5.1.3, in the fourth item in the bulleted list, change &quot;in the content of an element whose content model is known to be mixed&quot; to &quot;in the content of an element that is annotated with a type other than xs:untyped or xs:anyType, and whose content model is mixed.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19460</commentid>
    <comment_count>6</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2008-03-13 19:11:04 +0000</bug_when>
    <thetext>At its teleconference of 2008-03-13,[2] the XSL WG approved the response
proposed in comment #5.  This now needs the approval of the XQuery WG.

[2] http://lists.w3.org/Archives/Member/w3c-xsl-wg/2008Mar/0015.html
(Members-only link)
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19565</commentid>
    <comment_count>7</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2008-03-20 13:33:02 +0000</bug_when>
    <thetext>At joint teleconference 360 of the XSL and XQuery working groups on 2008-03-18,[3] the XQuery WG concurred with the decision of the XSL WG.

Tim Mills, I trust you will find this response satisfactory.

Henry Zongaro, on behalf of the XSL and XQuery working groups

[3] http://lists.w3.org/Archives/Member/w3c-xml-query-wg/2008Mar/0059.html (Members-only link)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19648</commentid>
    <comment_count>8</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2008-03-31 13:51:12 +0000</bug_when>
    <thetext>This will be published as Serialization erratum SE.E6.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19765</commentid>
    <comment_count>9</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-04-10 15:20:50 +0000</bug_when>
    <thetext>Great.  Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>