</xsl:output>" />
开发者

how to get doctype tag with url using xsl:output

开发者 https://www.devze.com 2023-01-01 17:06 出处:网络
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>

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开发者_JAVA技巧 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


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">
0

精彩评论

暂无评论...
验证码 换一张
取 消