views:

464

answers:

2

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"&gt;
<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?

Thanks, Ebe

A: 

You'll need to insert the DOCTYPE in a CDATA block as seen here.

ajm
A: 

That would generate Doctype as output right? I would like to allow document with doctype declaration. Basically, the xml document doesnt comply XHTML standard, such as including p tag in font tag etc and XSLT doesnt run smoothly when doctype is specified (so validated against ). Therefore, i would like to make either XSLT ignore the doctype in input or php engine stop generating doctype.

Thanks, Ebe.