<?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>11905</bug_id>
          
          <creation_ts>2011-01-28 12:04:35 +0000</creation_ts>
          <short_desc>Escaping of &quot;&lt;&quot; and &quot;&amp;&quot; in Polyglot Markup</short_desc>
          <delta_ts>2011-08-04 05:07:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML/XHTML Compatibility Authoring Guide (ed: Eliot Graff)</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Leif Halvard Silli">xn--mlform-iua</reporter>
          <assigned_to name="Eliot Graff">eliotgra</assigned_to>
          <cc>davidc</cc>
    
    <cc>eliotgra</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>shadow2531</cc>
    
    <cc>xn--mlform-iua</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>44827</commentid>
    <comment_count>0</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2011-01-28 12:04:35 +0000</bug_when>
    <thetext>It is a well-formed requirement in XML 1.0 that &quot;&lt;&quot; and &quot;&amp;&quot; are escaped whenever they are not used in entities or in tags or occur inside CDATA sections.

In contrast, in HTML, the &quot;&amp;&quot; in general does not need to be escaped. Whereas the &quot;&lt;&quot; does not need escaping inside attributes. 

Exact XML rules: http://www.w3.org/TR/REC-xml/#syntax

Conclusion: State that &quot;&lt;&quot; and &quot;&amp;&quot;, when used as  character, always needs to be escaped, except when inside CDATA.

(You may also want to see Bug 11904.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44828</commentid>
    <comment_count>1</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2011-01-28 12:19:46 +0000</bug_when>
    <thetext>(In reply to comment #0)

&gt; Conclusion: State that &quot;&lt;&quot; and &quot;&amp;&quot;, when used as  character, always needs to be
&gt; escaped, except when inside CDATA.


I don&apos;t think this document should try to explain the requirements of being xml well formed (or of being html valid) If it states such rules in full, it becomes vastly larger and if just summarizes them it will get details wrong in edge cases.

I think the document should just state the _additional_ constraints that need to be met given a document that is xml well formed and html valid, for it to give equivalent DOM trees whether parsed as xml or html.

David</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44843</commentid>
    <comment_count>2</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2011-01-28 16:43:45 +0000</bug_when>
    <thetext>(In reply to comment #1)

&gt; I don&apos;t think this document should try to explain the requirements of being xml
&gt; well formed (or of being html valid) If it states such rules in full, it
&gt; becomes vastly larger and if just summarizes them it will get details wrong in
&gt; edge cases.
&gt; 
&gt; I think the document should just state the _additional_ constraints that need
&gt; to be met given a document that is xml well formed and html valid, for it to
&gt; give equivalent DOM trees whether parsed as xml or html.

Then perhaps you should look at what Polyglot Markup already says, right now, and file bugs if you think it says too much already? Are there things that it should take out?

I must say that it becomes - to myself - illogicall if the document goes into the nittygritty of how to make sure that attributes are kept DOM equal (by taking into consideration XML whitespace normalization in attributes) on one side, but on the other side ignores to say the farm more important thing that &quot;&lt;&quot; and &quot;&amp;&quot; have to be escaped. I think that for most authors that want to use polyglot markup, the DOM equality of attributes, is not of very great importance.

However, I do think that it would be nice if Polyglot Markup summed up its principles in one section of the document, including pointing to the definining specs (XML 1.0 and HTML5) for its principles.

You did not comment on bug 11904 regarding &lt;plaintext&gt; and &lt;xmp&gt;. That Polyglot Markup gives special (but incorrect) rules for how to use &lt;&gt;&amp; inside those elements, is an example - IMHO - on what happens because the entire Polyglot Markup document is lacking a) guiding principles and b) looks at the details instead of listing the general rules. 

In my view, the need to escape &lt; and &amp; is - by the way - so basic, that we do no need to land in the error of failing ot be accurate enough just because we say it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45427</commentid>
    <comment_count>3</comment_count>
    <who name="Eliot Graff">eliotgra</who>
    <bug_when>2011-02-12 00:46:43 +0000</bug_when>
    <thetext>In the Editor&apos;s Draft of 11 February 2011, I have added the following content to section 8. Named Entity References:

]]
Polyglot markup always uses character references for the less than sign (&lt;) and ampersand (&amp;) when they are used as characters, except when those characters appear inside a CDATA section. 
[[

Thanks very much for this feedback.

Cheers,

Eliot</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45454</commentid>
    <comment_count>4</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2011-02-13 19:36:04 +0000</bug_when>
    <thetext>Satisfied. Closing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53185</commentid>
    <comment_count>5</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:07:24 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53213</commentid>
    <comment_count>6</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:07:44 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>