Set - 3

Question 11 :

How does HTML differ from XHTML ? 

Answer :

XHTML has a small number of differences. The most noticeable being the requirement for elements to be lowercase (e.g. <p> and not <P>) and elements to be closed (e.g. paragraphs must end with a </p>).


Question 12 :

Why to type a tags in uppercase, and never bother closing the paragraphs ? 

Answer :

For reasons on internationalisation XML elements are case sensitive. A choice had to be made, and lowercase won on the day. 
Tags may not overlap 
This is <em> emphasized text and <b>bold </em>text</b> 
becomes 
This is <em>emphasized text </em> is <b>bold text</b> 
Only certain tags may nest inside other tags 
Looking at the dtd for xhtml, the definition of the "ol" element is:

<!ELEMENT ol (li)+>
<!ATTLIST ol %attrs; type %OLStyle; #IMPLIED compact (compact) #IMPLIED start %Number; #IMPLIED >
This implies that an order list, "ol", element may not contain paragraph tags or body text, just list items. 
<ol>

These are some of my favorite animals:

<li>octopus</li>
<li>shrew</li>
<li>lemur</li>
and my most favorite
<li>meerkats</li>
</ol>

becomes

<p>These are some of my favorite animals:</p>
<ol>
<li>octopus</li>
<li>shrew</li>
<li>lemur</li>
<li>meerkats</li>
</ol>