I would like to remove the line break that follows all text that says See the Exhibit "
Unwanted linebreak as shown in notepadd++:
alt text http://img13.imageshack.us/img13/9803/clcflinebreak.png
This is what I have so far:
<xsl:template match="p">
<!-- output everything but the See the exhibit text should have the line break removed -->
</xsl:template>
Any ideas? Thanks!
If you're using your transform to generate HTML output, the simplest approach is usually:
<xsl:value-of select="normalize-space($text)"/>
normalize-space
strips leading and trailing whitespace, and replaces runs of multiple whitespace characters within the string with a single space.
To remove exactly a trailing CR/LF pair:
<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>
<!-- Get text. Replace all “break with “ -->
<xsl:variable name="linebreak">
<xsl:text>
</xsl:text>
</xsl:variable>
<xsl:variable name="text">
<xsl:call-template name="replace-string">
<xsl:with-param name="text" select="."/>
<xsl:with-param name="replace" select="concat('“',$linebreak)" />
<xsl:with-param name="with" select="string('“')"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$text"/>