<!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.
<?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.