4 ms·
could you elaborate on A? What's the problem of using "<" in an enclosing html document that wouldn't also be a problem for ">", which already exists?
by bps4484 15y ago
could you elaborate on A? What's the problem of using "<" in an enclosing html document that wouldn't also be a problem for ">", which already exists?
- saurik 15y agoI'm confused by your comment: ">" only has special meaning in the context of a tag, or after "]]"; "<" has special meaning meaning anywhere in a document you are not inside of a tag.
- bps4484 15y agothat actually answered my question. I don't know the html spec that well so I didn't know if both "<" and ">" were reserved characters. From what I understand of what you're saying, it's only when ">" comes after a "<" that is has special meaning.
- saurik 15y agoCorrect. From the XML specification (which is easier to obtain than SGML, more prescriptive than HTML4, and capable of being understood by humans in a way the HTML5 "document IE" specification is unable to support), 2.4 "Character Data and Markup" (note the "may" and "MUST"): The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they MUST be escaped using either numeric character references or the strings " & " and " < " respectively. The right angle bracket (>) may be represented using the string " > ", and MUST, for compatibility, be escaped using either " > " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end of a CDATA section.