Welcome to WebmasterWorld Guest from 3.80.38.5

Forum Moderators: open

Message Too Old, No Replies

XSL for RSS creating quirksmode in IE

Can't insert Doctype in XSL

     
8:16 am on Sep 9, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 23, 2003
posts:165
votes: 0


I've created an XSL file that converts an RSS file into a HTML file that look sidenticla to the rest of a website - it therefore uses most of the website's template.

This works fine except the XSL throws an error if I insert the DOCTYPE, thus I've left it out and triggered Quirksmode in IE6.

Any ideas how I can get a doctype in their preferably XHTML 1.0 strict?

a watered-down version of the code I've used:


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<style type="text/css" media="screen, projection">
@import url("/recruitment/css/css.css");
</style>
<title>RSS</title>
<body>
<table>
<xsl:for-each select="rss/channel/item">
<xsl:sort select="pubDate" order="ascending"/>
<tr>
<td><a href="{link}" title="view this article in more detail"><xsl:value-of select="title"/></a></td>
<td><xsl:value-of select="substring(pubDate,5,12)"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
4:08 pm on Sept 9, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:May 18, 2002
posts:126
votes: 0


Check out
[w3schools.com...]


<xsl:output
method="xml多tml宇ext好ame"
version="string"
encoding="string"
omit-xml-declaration="yes好o"
standalone="yes好o"
doctype-public="string"
doctype-system="string"
cdata-section-elements="namelist"
indent="yes好o"
media-type="string"/>
6:22 pm on Sept 9, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 23, 2003
posts:165
votes: 0


thanks athinktank, I've cracked it with this


<xsl:output method="xml" version="1.0"
encoding="iso-8859-1" indent="yes" omit-xml-declaration="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members