Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why was the xmp HTML tag deprecated? [duplicate]

Possible Duplicate:
<XMP> Tag

I know that it is deprecated of course, and I know how to work around it by using the <pre> tag, <code> tag, and escapes for <>.

My question is, why was it deprecated? The solution of having real code in an <xmp> tag seems so much more elegant than all this escaping we do nowadays, and yet, the one was neglected in favour of the other.

Any idea? Is there a reason for favouring <pre> with escapes over <xmp>?

like image 284
cumquaz Avatar asked Nov 29 '11 08:11

cumquaz


People also ask

Why is XMP tag deprecated?

The <xmp> tag is deprecated since HTML version 3 because it is conflicts with SGML. The <pre> or <code> tags should be used instead. Additionally, if text in the tag contains the characters < and &, they should be replaced with &lt; and &amp; respectively.

What is XMP tag in HTML?

Summary. The <xmp> HTML element renders text between the start and end tags without interpreting the HTML in between and using a monospaced font.


2 Answers

This article has a detailed decription on the depreciation of xmp.

tl; dr; to remove ambiguity in parsing html.

like image 176
OnesimusUnbound Avatar answered Sep 21 '22 21:09

OnesimusUnbound


The most compelling reason for me is that the use of the tag would make it impossible to consider html as a well-formed xml.

That is, the special meaning behind one tag that alters the way the document is processed is a bad precedent making it impossible to account for newer versions. For instance, there's no way you can skip unknown tag with its content if you can't tell when it's over without knowing this particular markup specs.

like image 35
Michael Krelin - hacker Avatar answered Sep 18 '22 21:09

Michael Krelin - hacker