I'm using PHP5 and SOAP to display data from a web service on a web page.
Unfortunately, a second doctype is appearing in the generated page at the point where the data from the web service starts. The HTML ends up looking like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>PHP Course Search</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" media="screen">
@import "css/styles.css";
</style>
</head>
<body>
<div id="header"><h1>Course Details</h1></div>
<div id="content">
<p>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
Content goes here...
Any suggestions what might be going wrong?
The PHP which handles the XML is
//2: transform main details
$xml = new DOMDocument();
//TODO for testing
$xml->loadXML($res);
//load xslt
$xslDom = new DOMDocument();
$xslDom->load($this->courseTransform);
//create processor and do transform
$proc = new XSLTProcessor();
$proc->setParameter('','courseId',$courseID);
$proc->setParameter('','detailsPage',$this->detailsPage);
$proc->importStyleSheet($xslDom);
echo $proc->transformToXML($xml);
The first few lines of the XSLT are:
<?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" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:param name="rootUrl"/>
<xsl:param name="courseId"/>
<xsl:param name="detailsPage" />
<xsl:template match="/">
If it makes any difference, the application is running on IIS6 on Windows Server 2003.