即使在转义字符之后,也不能使xslt输出(&) [英] Cannot get xslt to output an (&) even after escaping the character

查看:157
本文介绍了即使在转义字符之后,也不能使xslt输出(&)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个由& 符号分隔的变量赋值的查询字符串(例如:var1 = x& var2 = y& ; ...)。我打算将这个字符串传递给一个嵌入式的flash文件。

I am trying to create a query string of variable assignments separated by the & symbol (ex: "var1=x&var2=y&..."). I plan to pass this string into an embedded flash file.

我无法找到一个& 符号出现在XSLT。如果我只是键入& 而没有标签,那么渲染XSLT文档就会出现问题。如果我键入& amp; amp; 而没有标签,那么文档的输出是& amp; amp; amp; amp; amp;没有变化。如果我键入< xsl:value-of select =& /> < xsl:value-of select =& amp; amp /> 我也收到一个错误。这可能吗?注意:我也尝试过 amp; amp; amp; ,没有成功。

I am having trouble getting an & symbol to show up in XSLT. If I just type & with no tags around it, there is a problem rendering the XSLT document. If I type &amp; with no tags around it, then the output of the document is &amp; with no change. If I type <xsl:value-of select="&" /> or <xsl:value-of select="&amp;" /> I also get an error. Is this possible? Note: I have also tried &amp;amp; with no success.

推荐答案

您可以将 disable-output-escaping CDATA 部分相结合。尝试这样:

You can combine disable-output-escaping with a CDATA section. Try this:

<xsl:text disable-output-escaping="yes"><![CDATA[&]]></xsl:text>

这篇关于即使在转义字符之后,也不能使xslt输出(&amp;)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆