加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

使用xsl插入<?xml-stylesheet标签

发布时间:2020-12-16 07:55:20 所属栏目:百科 来源:网络整理
导读:如何使用XSLT添加样式表参考? 我试图用第一个变换去掉一些大的输入XML,并且需要在客户端上应用第二个转换.因此,第一个变换必须输出正确的引用,例如: ?xml-stylesheet type="text/xsl" href="client.xsl"? 要重写它的XML- transform1(服务器) – XML- trans
如何使用XSLT添加样式表参考?

我试图用第一个变换去掉一些大的输入XML,并且需要在客户端上应用第二个转换.因此,第一个变换必须输出正确的引用,例如:

<?xml-stylesheet type="text/xsl" href="client.xsl"?>

要重写它的XML-> transform1(服务器) – > XML-> transform2(客户端) – > HTML

到目前为止,我唯一可以使其工作的方法是使用xsl:text disable-output-escaping和CDATA:

< xsl:text disable-output-escaping =“yes”><![CDATA [<?xml-stylesheet type =“text / xsl”href =“/ efo / efo_class.xsl”?>]] >

当然必须有更好的方法.

根据XSLT规范,Creating Processing Instructions:
<xsl:processing-instruction name="xml-stylesheet">
  <xsl:text>type="text/xsl" href="client.xsl"</xsl:text>
</xsl:processing-instruction>

将创建处理指令:

<?xml-stylesheet type="text/xsl" href="client.xsl"?>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读