stevecam wrote:
> I have text that I am taking from a database that has formatting in
> it, mainly as CR and LF characters.  I want these to appear as <br/>
> tags in my XHTML output.  Is there a standard mechanism to achieve
> this, hopefully simply by adding a standard transformer into my
> pipeline?

I don't think there's a standard component to do that, but you can embed
it into a XSLT stylesheet, using for example EXSLT string extensions:

<xsl:stylesheet ... xmlns:str="http://exslt.org/strings";>

    ...

    <xsl:for-each select="str:tokenize($your-string, '&#xA;&#xD;')">
        <xsl:value-of select="."/>
        <br/>
    </xsl:for-each>


> I haven't much experience using <pre> tags in html but that may be
> another option.

<pre>, or the CSS equivalent { white-space: pre }, does output a newline
for each CR and/or LF character, but on the other hand won't wrap the
text when there is no CR/LF, so usually it's not an option.


Tobia

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to