XSL and DTD
published 11 April 2006
A quick code snippet to include the right XHTML DTD in your XSL generated output. This took me a bit of reseach to find out:
<xsl:text disable-output-escaping="yes"> <![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]> </xsl:text>
Include this into you template and switch the output method to “xsl” and you should be fine.
Comment
- this is simpler:
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes" indent="no" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" />
— Anup Shah 11 April, 2:12pm # - Thanks a lot Anup, it definitely is … but even more important: it's way cleaner!
— Pascal 11 April, 2:22pm # - Another tidbit I found today was: exclude-result-prefixes="media" to exclude unwanted namespace declarations from the output. Handy…
— Mike Stenhouse 17 April, 3:58pm #
Quick links
Other people's articles that we think you might be interested in:
- Ajaxian » Web Inspector: Looking good, and profiling nicely
- smush it!
- cssdoc - Trac
- CSS Systems for writing maintainable CSS | Natalie Downe
- The PNG Gamma Dilemma - Trevor Morris Photographics
Want to buy a cheap laptop for your design work? read laptop reviews at laptopical.com