html - 带有 HTML 实体的 XSLT 字符串 - 如何让它呈现为 HTML?

标签 html string xslt

我对使用 XSL 完全陌生,所以如果有任何我遗漏的信息,请告诉我。

我的 XSLT 文件中有一个可以像这样显示的字符串:

<xsl:value-of select="@Description/>

它显示在浏览器中,如下所示:

<div>I can't do anything about the html entities existing in the text.</div> <div>This includes quotes, like  &quot;Hello World&quot; and sometimes whitespaces.&nbsp;</div>

我该怎么做才能将此字符串呈现为 html,以便 <div></div>结果换行,&quot;给我" , 和 &nbsp;给我一个空间?

我可以详细说明我已经尝试过但没有奏效的事情,但我不知道这是否相关。

最佳答案

我想你想这样设置以下属性:

<xsl:value-of select="@Description" disable-output-escaping="yes"/>

关于html - 带有 HTML 实体的 XSLT 字符串 - 如何让它呈现为 HTML?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2853924/

相关文章:

html - 过长的图像标题,但如何只在正文内容上显示水平滚动条?

javascript - 当我使用小写字母时,为什么正则表达式会失败?

python - 如何在Python格式字符串中使用变量的值

python - 从 xml 中删除签名

asp.net-mvc - NLog上的配置转换不起作用

javascript - 如何在html中自动生成数字?

html - 在 firefox 和其他浏览器中遇到 ul 问题

html - 固定标题在网页滚动时仍然消失

javascript - 类型错误:字符串不是函数

xslt - XSLT 中的组相邻功能