views:

152

answers:

1

Hi,

i have added the below xsl:output tag in xslt

<xsl:output method="html" indent="yes" encoding="utf-8" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" ></xsl:output>

as a result i get the below doctype tag in the html output-

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

how can i mention the url in the doctype tag using xsl:output which would output a doctype tag that looks like below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "_http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Best Regards,
Keshav

+3  A: 

A quick trip to W3Schools reveals that the XSL:Output element has a doctype-system attribute available, as well as a doctype-public. I believe this is what you need.

If you change your xsl:output to the following

<xsl:output method="html" indent="yes" encoding="utf-8" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" doctype-system="_http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" ></xsl:output>

You should get the DTD output you require, as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "_http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
Tim C
thank you this worked
keshav.veerapaneni