Re: [xsl] XHTML html validation

Subject: Re: [xsl] XHTML html validation
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 16 Feb 2007 12:38:33 +0100
Abel Braaksma wrote:
method="xml" does not output the doctype-public if you do not also supply a doctype-system
method="xhtml" does not output the doctype-public if you do not also supply a doctype-system


I am not sure if this is according to the W3 specs of xsl:output, I'll have to check. It strucks me as a bit odd that the doctype-public is ignored for xml and xhtml, unless there's also a doctype-system. But I thought that these are not needed together, but my doctype knowledge is a bit rusty.


Seems like I remembered wrongly, it isn't odd at all. This is what the specs say about it for XML and XHTML (only read for XSLT 2, but my guess is, for XML it is the same for both):


http://www.w3.org/TR/xslt-xquery-serialization/#XML_DOCTYPE says:
"The doctype-public parameter MUST be ignored unless the doctype-system parameter is specified."


this behavior is equal for XHTML and XML (logically so: XHTML *is* XML, so they obey the same rules for most parts).

I don't know what processor you are using, but it is clearly doing the wrong thing. About the first element the spec says:

"The name following <!DOCTYPE MUST be the name of the first element, if any"

which clears the clouds on that one.

I can only talk for Saxon, which does the correct thing there. Your best bet is to check the mailing lists or buglists of the processor you are using, or try another processor.

HTH,
-- Abel Braaksma

Current Thread