I am transforming XHTML to XHTML using XSLT and Doctype part is giving me problem
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="LimeSurvey.xslt"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
and this is not valid xml, according to IE8, FF3. Is there any way to prevent generating DOCType, xmlns from php engine? Or is there any way to make XSLT ignore DOCTYPE and xmlns?
05-26-2009, 07:19 PM
It's likely that the DOCTYPE is fine but your XML is invalid. Run it through The Validator.
05-27-2009, 01:41 PM
XML document is fine, but it is not XHTML compliant(paragraph is embedded in font tag etc...), therefore with presense of DocType, the the validation fails and XSLT doesn't run properly. Therefore if i remove DocType, the XSLT transformation succeeds. Therefore, i need either php engine not to generate the doctype declaration or XSLT to ignore it.
05-27-2009, 03:01 PM
Or you need to be generating a valid document.
05-27-2009, 03:16 PM
The document is generated by php code, which is a kind of big,legacy system, and i don't have much control over it.
05-27-2009, 08:27 PM
I feel your pain but you're just going to have to go in there and fix the PHP. One of the fundamental principals of XML is that all things are supposed to stop when something is invalid or not well formed.