By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,333 Members | 1,843 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,333 IT Pros & Developers. It's quick & easy.

XHTML - Doctype and output

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
johkar wrote:
What is the proper doctype syntax for XHTML transitional??? Strict?
http://www.w3.org/QA/2002/04/valid-dtd-list.html
How come XSLT doesn't preserve XHTML when it is compiled (Xalan)?
Meaning, <br /> tags become <br> <input /> tags become <input> etc.


Maybe you have it set to generate HTML output.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 20 '05 #2

P: n/a


johkar wrote:
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:output 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:output 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.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #3

P: n/a
Thank you both for the replies and good info.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.