如何使用 xsl:output 获取带有 url 的 doctype 标记

发布于 2024-09-03 19:51:51 字数 314 浏览 10 评论 0原文

中添加了以下 xsl:output 标记

我在 xslt

结果我在 html 输出中得到以下 doctype 标记

-

我如何使用 xsl:output 在 doctype 标记中提及 url,它将输出如下所示的 doctype 标记

最好的问候,
凯沙夫

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤千羽 2024-09-10 19:51:51

快速访问 W3Schools 会发现 XSL:Output 元素有一个 doctype- system 属性可用,以及 doctype-public。我相信这就是您所需要的。

如果将 xsl:output 更改为以下内容,

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

您应该获得所需的 DTD 输出,如下所示:

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

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">
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文