13

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>?

5
  • I think it is going to be unlikely that you'll get an answer, given the decision was made in a closed environment over 15 years ago … it's off-topic anyway. Might be suitable for programmers.stackexchange.
    – Quentin
    Nov 29, 2011 at 8:39
  • It's not just deprecated, it was completely removed in the HTML5 (and I believe in HTML4) specification and should no longer be supported.
    – animuson
    Nov 29, 2011 at 8:40
  • 2
    I understand both those points you're making, but on the decision being made in a closed circle: still they must've had their reasons, which were rooted in the way the element was being used (not by an enclosed group); and on the point of it being completely removed, I'm not trying to use it, I'm just trying to understand if there is anything wrong with the tag or the concept itself. Did it, for instance, pose security threats? (don't see how) Did people not want to have their code copy-pasted? That's still possible. The pre tag brings no advantages. Why remove something good?
    – cumquaz
    Nov 29, 2011 at 8:44
  • 5
    @animuson - It's not completely removed from HTML5. It's listed as non-conforming here: dev.w3.org/html5/spec/obsolete.html#non-conforming-features and more importantly, its parsing rules are described at dev.w3.org/html5/spec/… - search down from there for A start tag whose tag name is "xmp"
    – Alohci
    Nov 29, 2011 at 15:18
  • 1
    This was going to be an answer, but the question got closed. See w3.org/Bugs/Public/show_bug.cgi?id=12235 It was, according to the HTML5 editor (comments 11 and 12), a very close call either way.
    – Alohci
    Nov 29, 2011 at 15:29

2 Answers 2

6

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

tl; dr; to remove ambiguity in parsing html.

5

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.

12
  • 2
    It is marked as deprecated in HTML 3.2. XML would not have been a consideration.
    – Quentin
    Nov 29, 2011 at 8:42
  • 1
    But the same reasons behind xml processing have already been there. (think SGML). Nov 29, 2011 at 8:44
  • That actually makes sense, the only reason I've yet heard that does. Perhaps they wanted to kill it before people got too accustomed to it. Thank you, Michael.
    – cumquaz
    Nov 29, 2011 at 8:48
  • 1
    They left <script> and <style> alone though.
    – Quentin
    Nov 29, 2011 at 9:01
  • 1
    "In particular, you can use external references for scripting and styling", you can, but so what? The inline stuff still works.
    – Quentin
    Nov 29, 2011 at 9:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.