Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 属性值内输出php处理指令_Html_Xslt_Xslt 2.0_Processing Instruction - Fatal编程技术网

Html 属性值内输出php处理指令

Html 属性值内输出php处理指令,html,xslt,xslt-2.0,processing-instruction,Html,Xslt,Xslt 2.0,Processing Instruction,在我的XSLT(2.0-输出方法是html)中,我有以下内容: <img> <xsl:attribute name="href"> <xsl:text disable-output-escaping="yes">&lt;?php echo get_url(); ?&gt;</xsl:text> </xsl:attribute> </img> ?php echo get_ur

在我的XSLT(2.0-输出方法是html)中,我有以下内容:

<img>
    <xsl:attribute name="href">
        <xsl:text disable-output-escaping="yes">&lt;?php echo get_url(); ?&gt;</xsl:text>
    </xsl:attribute>
</img>

?php echo get_url()?
我想要的输出如下:

<img href="<?php echo get_url(); ?>">
<img href="<?php echo get_url(); ?&gt;">

将字符映射与其他地方不需要的字符一起使用,下面是一个根据XSLT 2.0规范改编的示例()

<img href="«?php echo get_url(); ?»"/>


在线示例位于


至于禁用输出转义,据我所知,它在属性值中不起作用,您得到的结果不是禁用输出转义的结果,而只是使用了
xsl:output method=“html”
()强制“html输出方法不能转义”这一命令-非常感谢您的帮助。K
<xsl:output method="html" use-character-maps="m1"/>

<xsl:character-map name="m1">
    <xsl:output-character character="«" string="&lt;"/>
    <xsl:output-character character="»" string="&gt;"/>
</xsl:character-map>