xhtml| Difference | problem
the document must be well choreographed
Elements must be nested, although the SGML rules stack illegally, but existing browsers generally allow cascading.
Correct: nested elements.
<p>here is a emphasized <em>paragraph</em>.</p>
Incorrect: cascading elements.
<p>here is a emphasized <em>paragraph.</p></em>
Nesting and cascading
Element and attribute names must be lowercase
XHTML documents must use lowercase for all HTML element and attribute names. Because XML is case sensitive, this difference is necessary. such as < li > and < li > are different labels.
for non-null elements, the end tag must be used
In SGML based HTML, some implicitly end-meaning elements allow the end tag to be ignored. In xml-based XHTML, this omission is not allowed. All elements must have an end tag, except for elements declared empty in the DTD.
Correct: The end of the element.
<p>here is-a paragraph.</p><p>here is another paragraph.</p>
Incorrect: element not closed.
<p>here is a paragraph.<p>here is another paragraph.
XHTML requires code writing to be very standard, and may sometimes be allowed by browsers, but not through XHTML validation.
property value must be in quotation marks
All attributes must be in quotes, even numbers.
Correct: attribute value in quotation marks
<table rows= "3" >
Incorrect: property value not in quotation marks.
<table rows=3>
Very basic specification, which should be the same in HTML.
attribute Minimization
XML does not support the minimization of attributes. Attribute value pairs must be fully written. Property names such as compact,checked cannot be specified in an element without specifying a property value.
Correct: No properties minimized
<DL compact= "compact" >
Incorrect: Minimizing properties
<DL compact>
The default properties also need to be fully written out.
empty Element
An empty element must either have an end tag, or the start tag ends with/>.
Correct: An empty element that ends
<br/>
Error: Empty label not closed
<br>
This is very important and it is easy to make mistakes.
Choreography Good (well-formedness) is a new concept introduced in XML. Essentially, this means that the element must have an end tag, or it must be written in a special way.