W3C home > Mailing lists > Public > public-html@w3.org > December 2007

Re: Reanimate <xmp>

From: Thomas Broyer <t.broyer@gmail.com>
Date: Mon, 10 Dec 2007 10:25:45 +0100
Message-ID: <a9699fd20712100125w7391988fkdab51b6f37327d0@mail.gmail.com>
To: public-html@w3.org
2007/12/10, Karl Dubost:
>
> Le 9 déc. 2007 à 17:03, j.j. a écrit :
> > CON
> > <xmp><![CDATA[   XHTML needs CDATA section.   ]]></xmp>
>
> 1. that makes it more difficult to go from HTML to XHTML format to the
> other.

Agreed.

However, it should be supported at the parser level for backwards
compatibility (it already is).

> 3. You can't use xmp inside xmp
>     <!DOCTYPE html>
>     <html>
>     <title>boo</title>
>     <xmp> Using <xmp>html code</xmp> to show the source code</xmp>
>     </html>
>     Rendered view:
>          Using <xmp>html code to show the source code

Not convinced.

Same as CDATA sections in XML:
    <![CDATA[Using a <![CDATA[CDATA section]]> to show the source code]]>
  Parsed as:
    Using &lt;[CDATA[CDATA section to show the source code ]]&gt;

You'd have to write:
    <xmp>Using <xmp>html code</</xmp>xmp<xmp>> to show the source code</xmp>
(and variations around those lines)
similar to the following in XML:
    <![CDATA[Using a <![CDATA[CDATA section]]>]]><![CDATA[ to show the
source code]]>


That being said, I'm really not convinced that XMP is needed at all:
you only have to do a search/replace for & to &amp; (you're already
doing it anyway) and < to &lt; (other characters don't need any
special treatment).
That XMP be supported in the parser, yes, for backwards compatibility,
but made compliant ?!

(Regarding j.j.'s arguments: if XMP is given the same semantics as
<pre><code> (first of his arguments), then the following two arguments
don't apply, and vice versa; having an element with varying semantics
depending on the attributes used is IMO a Bad Thing; we already have
it with <a name=> vs. <a href=> and <a name=> is actually being
replaced with "any element with an id attribute")

-- 
Thomas Broyer
Received on Monday, 10 December 2007 09:26:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:11 GMT