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">
...
<html>
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?
It's likely that the DOCTYPE is fine but your XML is invalid. Run it through The Validator.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
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.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
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.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Bookmarks