What are reserved characters in (X) HTML?

Yes, I was looking for him and unexpectedly got confused answers.

One page says that they < > & "are the only reserved characters in (X) HTML. Sure, that makes sense.

This page says < > & " ' are reserved characters in (X) HTML. It’s a little confusing, but everything is in order, it also makes sense.

And then this page comes in, which says that the < > & " © ° £inextricable space (  ) is all reserved characters in (X) HTML. This makes no sense, and pretty much adds to my confusion.

Can anyone who knows who really knows this material clarify which characters are actually reserved in (X) HTML?

EDIT . Also, should all reserved characters in the code be escaped when the tag ends <pre>? or is it just these three - < > &??

+3
source share
5 answers

Only screens <and & need . Internal attributes must also be escaped "or '(depending on which quote style you use for the attribute value).

<a href="#" onclick="here you can use ' safely"></a>
<a href="#" onclick='here you can use " safely'></a>
+7
source

The XHTML 1.0 specification states http://www.w3.org/TR/2002/REC-xhtml1-20020801/#xhtml :

XHTML 1.0 [...] is a reformulation of the three types of HTML 4 documents as XML 1.0 [XML] applications.

XML 1.0 http://www.w3.org/TR/2008/REC-xml-20081126/#syntax:

: . [...] (&) (<) , , , CDATA. , , "&amp;" "&lt;" . (>) "&gt;" , , "&gt;" , "]]>" , CDATA.

, XHTML escape &, <, > .

, . & ; uuml; u. , , , UTF-8 0xc3bc, u.

(col. "tags" ) . "," , , CDATA .. , . XML, : , "-", "_". ( ) "".

XML/XHTML, - , , . . &

+7

"(X) HTML", ( ) .

HTML, "HTML" HTML HTML 4.01, "<" "&" . . , , . , , "A B" "A < B" ( A&B , A<B).

XHTML, XML, , : "<" "&" .

ASCII " ASCII" , , , , "foo" foo " 'foo' foo " ".

+1

< > & " XML.

  • , < > (<mytag></mytag>).

  • (") (<mytag attribute="value" />)

  • (&) (&amp; , , NOT &). , url XML-, &amp;, &: www.aaa.com?a=1&b=2 - ; www.aaa.com?a=1&amp;b=2 - !

XHTML XML, , , XHTML.

© ° £ - . , XHTML, XML.

XML ©. XHMTL © &copy; &00A9;.

0

In addition to other answers, this can help to find out that there are also forbidden characters: all control characters in ASCII and ISO-8859-1, except for TAB, LF and CR.

https://www.w3.org/MarkUp/html3/specialchars.html

0
source

All Articles