Re: xml versus xhtml

"Paul" <valen@nic.com> wrote:

	<h1>start of  heading
	  <p>paragraph within</p>
	        end of heading
	</h1>
	
	tidy returns
	
	<h1>start of heading</h1>
	<p>paragraph within</p>
	<p>end of heading</p>
	
As it should.  No version of HTML since 2.0 has ever allowed
a paragraph within a heading.

	This seems consistent with earlier observed tidy behavior,
	namely that xhtml1.0 dtd disallows <p> within <h1>. So tidy
	closes the <h1>, etc.  But I didn't specify output-xhtml.  I
	specified output-xml.  Isn't the input to tidy valid h1 'xml'?
	If so, why does tidy seem to force compliance with the xhtml dtd?
	
Because it is an *HTML* tidier, and it doesn't make sense to put a
<p> element inside an <h[1-6]> element, _whatever_ the output is.

While the input was _well-formed_ XML, to count as "valid", an
XML document must provide a DOCTYPE and conform to it.

Received on Monday, 3 September 2001 02:20:10 UTC