XHTML - Doctype and output

johkar

Usenet Archive
Joined
Dec 8, 2001
Messages
186
Reaction score
0
What is the proper doctype syntax for XHTML transitional??? Strict? How come XSLT doesn't preserve XHTML when it is compiled (Xalan)? Meaning, <br /> tags become <br> <input /> tags become <input> etc. It seems I am dazed and confused? Any hints or clear online resources appreciated.

John
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
johkar said:
What is the proper doctype syntax for XHTML transitional??? Strict? How come XSLT doesn't preserve XHTML when it is compiled (Xalan)? Meaning, <br /> tags become <br> <input /> tags become <input> etc. It seems I am dazed and confused? Any hints or clear online resources appreciated.

Well the XSLT 1.0 output method html is supposed to output according to HTML rules and not XHTML rules thus if you have <xsl:eek:utput method="html" /> or you happen to have a root result element <html> then the XSLT processor uses the html output method and in HTML a br element in the tree needs to be serialized as <br>, an input element in the tree needs to be serialized as <input>. See http://www.w3.org/TR/xslt#section-HTML-Output-Method

Thus if you want to have XHTML as the result of an XSLT 1.0 transformation you need to use <xsl:eek:utput method="xml" />

Some processors (like Saxon for instance, I don't know about Xalan) also know a special output method called xhtml that outputs XHTML according to the HTML 4.01 backwards compatibility rules given in the XHTML 1.0 specification.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top