SharePoint 的禁用输出转义的替代方案?
我正在使用内容查询 Web 部件和 ItemStyle.xsl 从富文本字段中提取内容。不幸的是,它转义了代码,因此它不会呈现 HTML 标签。禁用输出转义在 FF 中不起作用(奇怪),所以我无法使用它。还有其他选择吗? SP有不同的方法来转义字符吗?
I'm using a Content Query Web Part and ItemStyle.xsl to pull in content from a rich text field. Unfortunately, it escapes the code so it doesn't render HTML tags. Disable-output-escaping doesn't work in FF (weird) so I can't use it. Any alternatives? Does SP have a different way to unescape the characters?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自 http ://allthingssharepoint.wordpress.com/2011/08/25/output-escaping-rich-text-in-a-content-query-web-part/
要解决此问题,您需要编辑ItemStyle.xsl(最好是自定义的,请参阅 这篇文章)。您只需将以下命令添加到输出 HTML 的部分:
From http://allthingssharepoint.wordpress.com/2011/08/25/output-escaping-rich-text-in-a-content-query-web-part/
To fix this, you need to edit the ItemStyle.xsl (preferably a custom one, see this post). You would just have to add the following command to the part outputting the HTML:
Disable-output-escaping 向串行器发送指令;因此,当您不进行序列化时,它不会产生任何影响。在 Firefox 中,XSLT 处理器生成的结果树直接呈现,无需序列化和重新解析,因此 doe 没有任何效果。
解决方法通常是首先正确编写 XSLT 代码。当人们使用 doe 时,90% 的情况是因为他们还没有学会按照设计的方式使用 XSLT。因此,请告诉我们您的问题,我们可以建议如何在没有母鹿的情况下解决它。
Disable-output-escaping sends instructions to the serializer; it therefore has no effect when you are not serializating. In Firefox the result tree produced by the XSLT processor is rendered directly without being serialized and re-parsed, therefore d-o-e has no effect.
The workaround is usually to write the XSLT code properly in the first place. 90% of the time when people use d-o-e they are doing so because they haven't learned to use XSLT the way it was designed to be used. So show us your problem, and we can suggest how to solve it without d-o-e.