我想删除所有文字后面的换行符,参见附件"
如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>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?谢谢!
Rob*_*ney 13
如果您使用转换生成HTML输出,最简单的方法通常是:
<xsl:value-of select="normalize-space($text)"/>
Run Code Online (Sandbox Code Playgroud)
normalize-space 剥离前导和尾随空格,并用单个空格替换字符串中多个空白字符的运行.
要准确删除尾随的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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19637 次 |
| 最近记录: |