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>
?
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 < and & respectively.
Summary. The <xmp> HTML element renders text between the start and end tags without interpreting the HTML in between and using a monospaced font.
This article has a detailed decription on the depreciation of xmp
.
tl; dr; to remove ambiguity in parsing html.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With