【发布时间】:2015-04-22 10:13:41
【问题描述】:
我在使用CDATA 时尝试读取换行符,但运气不佳。有什么我做错了吗?我不断得到:
This Picture was created by <br /> Type-Style back in 2007.作为输出,根本不识别换行
XML
<s xmlns:b="http://crownpublishing.com/imprint/crown-business/">
<b:bio>
<b:about>
<![CDATA[This Picture was created by <br /> Type-Style back in 2007. ]]>
</b:about>
</b:bio>
</s>
XSL
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:b="http://crownpublishing.com/imprint/crown-business/" version="1.0">
<xsl:output cdata-section-elements="about"/>
<xsl:template match="/">
<xsl:value-of select="s/b:bio/b:about"/>
</xsl:template>
</xsl:stylesheet>
【问题讨论】:
-
输出也应该是 CDATA 部分吗?