我想删除所有文字后面的换行符,参见附件“
不需要的换行符,如notepadd所示:
alt text http://img13.imageshack.us/img13/9803/clcflinebreak.png
这是我到目前为止:
<xsl:template match="p"> <!-- output everything but the See the exhibit text should have the line break removed --> </xsl:template>
有任何想法吗?谢谢!
解决方法
如果您使用转换生成HTML输出,最简单的方法通常是:
<xsl:value-of select="normalize-space($text)"/>
normalize-space strip前导和尾随空格,并用单个空格替换字符串中多个空白字符的运行.
要准确删除尾随的CR / LF对:
<xsl:choose> <xsl:when test="substring(.,string-length(.)-1,2) = '
'"> <xsl:value-of select="substring(.,1,string-length(.)-2)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。