如何为 XSL 转换格式化 XML & 符号 [英] How do I format XML ampersands for XSL transform
本文介绍了如何为 XSL 转换格式化 XML & 符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试转换我从 RSS 提要中检索的 XML.此提要中的链接包含 & 符号,正如我提到的 此处,导致转换爆炸.(将 RSS 的 XML 中的所有&"替换为 &"
即可完成转换.)
I am attempting to transform the XML I'm retrieving from an RSS feed. This links within this feed contain ampersands which, as I mentioned here, are causing the transform to bomb. (Replacing all of the "&" with "&"
in the RSS's XML allows the transform to complete.)
谁能推荐一种重新格式化 RSS XML 的好方法,或者没有好的方法可以做到这一点?
Can anyone recommend a good approach for reformatting the RSS XML, or is there no good way to do this?
推荐答案
在 XML 中,您需要使用 &
来转义 & 号.XSLT 是 XML,因此适用相同的规则.
In XML you need to use &
to escape an ampersand. XSLT is XML so the same rule applies.
这篇关于如何为 XSL 转换格式化 XML & 符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文