I have created a simple XSL->XML solution (see below). The problem is I cannot get IE to see the DOCTYPE setting. I want the HTML 4.01 Transitional doctype to come through or else IE ignores my positioning I have setup in the css file. It works fine in FireFox but not in IE. In IE the page is displayed but the positioning information is ignored. (This is when I access the file
http://server/test.xml)
I also wrote an ASP script to return the page as XHTML - this has the same result as above - but I did notice the file has the header shown below when it comes down (this is the file generated by the asp script - see below for code). If I remove the first line of the returned XHTML file (<?xml version ... ?>) save the file to the webserver and load it all is well.
Any ideas - I did spend some time googling this - but did not really find much - any ideas
[Returned header from test.asp]
<?xml version="1.0" encoding="UTF-16"?> <-- This appears to be the offending item
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
[TEST.XML]
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<stuff>
<config>
...
</config>
[END TEST.XML]
The XSL file
[TEST.XSL]
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl=
"
http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"
doctype-system="
http://www.w3.org/TR/html4/loose.dtd"
doctype-public="-//W3C//DT
D HTML 4.01 Transitional//EN" indent="yes" />
<xsl:template match="/">
<html>
<head>
...
<link type="text/css" rel="stylesheet" href="css/layout.css" />
</head>
<body>
....
</body>
[END TEST.XSL]
[TEST.ASP]
<%
'Load XML
set xml = Server.CreateObject("Micro
soft.XMLDO
M")
xml.async = false
xml.load(Server.MapPath("t
est.xml"))
'Load XSL
set xsl = Server.CreateObject("Micro
soft.XMLDO
M")
xsl.async = false
xsl.load(Server.MapPath("t
est.xsl"))
'Transform file
Response.Write(xml.transfo
rmNode(xsl
))
%>
[END TEST.ASP]
Start Free Trial