Content deleted Content added
SGML-based versus XML-based HTML: Same note as previous edit.
Citation bot (talk | contribs)
Altered template type. Removed Template redirect. | Use this bot. Report bugs. | Suggested by Dominic3203 | Linked from User:Dominic3203/sandbox | #UCB_webform_linked 104/168
Line 406:
Like HTML 4.01, XHTML 1.0 has three sub-specifications: strict, transitional, and frameset.
 
Aside from the different opening declarations for a document, the differences between an HTML 4.01 and XHTML 1.0 document—in each of the corresponding DTDs—are largely syntactic. The underlying syntax of HTML allows many shortcuts that XHTML does not, such as elements with optional opening or closing tags, and even empty elements which must not have an end tag. By contrast, XHTML requires all elements to have an opening tag and a closing tag. XHTML, however, also introduces a new shortcut: an XHTML tag may be opened and closed within the same tag, by including a slash before the end of the tag like this: {{code|lang=html|code=<br/>}}. The introduction of this shorthand, which is not used in the SGML declaration for HTML 4.01, may confuse earlier software unfamiliar with this new convention. A fix for this is remove the slash preceding the closing angle bracket, as such: {{code|lang=html|code=<br>}}.<ref>{{citecitation|title=HTML Standard - The br Element|url=https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-br-element|publisher=WHATWG}}</ref>
 
To understand the subtle differences between HTML and XHTML, consider the transformation of a valid and well-formed XHTML 1.0 document that adheres to Appendix C (see below) into a valid HTML 4.01 document. Making this translation requires the following steps: