Hopsel: HTML-eigene Zeichen

Beitrag lesen

Hi Tom!

wo finde ich die offiziellen Bestimmungen zu den HTML-eigenen Zeichen?

Ich verstehe nicht, wofür das gut sein soll.

Es geht mir darum, eine offizielle Aussage darüber zu bekommen, warum die vier Zeichen < > & " auf jeden Fall ersetzt werden müssen.

Unabhängig von den Zeichen und der Ausgabe dieser müssen Metazeichen (also die Zeichen, denen eine besondere Bedeutung zukommt), maskiert werden.

Das ist in HTML genauso der Fall wie in regulären Ausdrücken und Beschreibungen mit EBNF und Formatstrings für die Funktion printf() in C und einfachen Anführungszeichen in SQL und ...

Wozu also eine "offizielle" Aussage, wenn die Logik allein ausreicht?

Vielleicht hilft dir ja das schon mal weiter:
Using Ampersands in Attribute Values (and Elsewhere)
Character entity references for markup-significant and internationalization characters

Ha! Bitte schön:
———————————————————————————————————————————————————————————————————————
Authors wishing to put the "<" character in text should use "&lt;" (ASCII decimal 60) to avoid possible confusion with the beginning of a tag (start tag open delimiter). Similarly, authors should use "&gt;" (ASCII decimal 62) in text instead of ">" to avoid problems with older user agents that incorrectly perceive this as the end of a tag (tag close delimiter) when it appears in quoted attribute values.

Authors should use "&amp;" (ASCII decimal 38) instead of "&" to avoid confusion with the beginning of a character reference (entity reference open delimiter). Authors should also use "&amp;" in attribute values since character references are allowed within CDATA attribute values.

Some authors use the character entity reference "&quot;" to encode instances of the double quote mark (") since that character may be used to delimit attribute values.
———————————————————————————————————————————————————————————————————————
Quelle: Character entity references

MfG H☼psel

--
"It's amazing I won. I was running against peace, prosperity, and incumbency."
George W. Bush speaking to Swedish Prime Minister unaware a live television camera was still rolling, June 14, 2001
Selfcode: ie:% fl:( br:> va:) ls:& fo:) rl:? n4:& ss:| de:] js:| ch:? sh:( mo:) zu:)