Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get doctype tag with url using xsl:output

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

like image 392
keshav84 Avatar asked Jun 02 '10 08:06

keshav84


1 Answers

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">
like image 128
Tim C Avatar answered Sep 23 '22 23:09

Tim C