在 XSLT 中使用 HTML 实体(例如  ) [英] Using an HTML entity in XSLT (e.g.  )
本文介绍了在 XSLT 中使用 HTML 实体(例如  )的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 XSLT 中包含 html 实体的最佳方法是什么?
What is the best way to include an html entity in XSLT?
<xsl:template match="/a/node">
<xsl:value-of select="."/>
<xsl:text> </xsl:text>
</xsl:template>
这个返回一个XsltParseError
推荐答案
可以使用 CDATA 部分
You can use CDATA section
<xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
或者您可以在本地 DTD 中描述  :
or you can describe   in local DTD:
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
或者只是使用  
而不是
or just use  
instead of
这篇关于在 XSLT 中使用 HTML 实体(例如 &nbsp;)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文