[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XHTML html validation

Subject: Re: XHTML html validation
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 16 Feb 2007 12:21:08 +0100
Re:  XHTML html validation
Hi John,

If you go XHTML, you don't want to use the method HTML, as it will not produce legal XHTML, which Andrew already pointed out.

I did some tests with Saxon 8, and found that when the doctype is output, the case is "html", not "HTML" for the root element declaration. You may want to switch to a more conformant processor (i.e., Saxon):

XSLT version 1.0:
method="xml" does not output the doctype-public if you do not also supply a doctype-system
method="html" correctly outputs the doctype public, but will render your document as HTML and not as XHTML.


XSLT version 2.0:
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
method="html" correctly outputs the doctype public, but will render your document as HTML and not as XHTML.


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.

Of course, XHTML does not require a doctype. You can output without one, and add the correct namespace to the root element. However, this may (or may not) trigger the browser's infamous quirks mode, which you definitely don't want when you pursue XHTML.

One more thing: if you want to force a certain string on the beginning of your file, you can use a trick with character-maps in XSLT 2 to get it there. I've put a workaround on this or saxon's list a while ago, but it is easy enough to implement.

Cheers!
-- Abel Braaksma
  http://www.nuntia.nl

John Steel wrote:

<xsl:output method="html"
doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'/>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.