Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HTML DOCTYPE and meta charset
Message
De
19/04/2005 08:52:21
Filip Bruman
Kirschberg Holding
Copenhagen, Denmark
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
XML
Titre:
HTML DOCTYPE and meta charset
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01006123
Message ID:
01006123
Vues:
66
Hi!

I'm trying to include the
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
and
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
into my .xsl file for generating HTML-documents following the W3C guidlines.

I've tried to just putting the doctype and meta into the .xsl file like this :
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

<xsl:output method="html" />
	<xsl:template match="/">
		<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
		        "http://www.w3.org/TR/html4/loose.dtd">
		<html>
			<head>
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
				<title>Test</title>
				<style>
					body,td,th {font-family:Tahoma,Arial; font-size:7pt;}
				</style>
			</head> ...
and also through the "xsl:value-of select", like this :
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

<xsl:output method="html" />
	<xsl:template match="/">
		<xsl:value-of select="/NewDataSet/TestTable/HTMLDoctype" />
		<html>
			<head>
				<xsl:value-of select="/NewDataSet/TestTable/metaCharset" />
				<title>Test</title>
				<style>
					body,td,th {font-family:Tahoma,Arial; font-size:7pt;}
				</style>
			</head> ...
both resulting in the error (from VS .NET 2003) :
A first chance exception of type 'System.Xml.XmlException' occurred in system.xml.dll

Additional information: System error.
I have no problems generating HTML-documents not containing the doctype and meta, but that is not an option in this case.

Does anyone have any experience with this?
Répondre
Fil
Voir

Click here to load this message in the networking platform