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

查看:32
本文介绍了即使在转义字符后,也无法让 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; 没有任何变化.如果我输入 <xsl:value-of select="&"/> 我也收到一个错误.这可能吗?注意:我也尝试过 &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-escapingCDATA 部分结合起来.试试这个:

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天全站免登陆