GuardianOfTheFlame
Programmer
Hi all,
how can I remove CRLF chars from a string?
I have this fragment of XML that create a javascript output:
my output is:
the problem is that the CRLF chars cause problems in the resulting page... so I want this output:
must I use the translate() function? if so how can I specify the CRLF char?
Thanks!
Salo
The surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us - Calvin (and Hobbes) ;-)
how can I remove CRLF chars from a string?
I have this fragment of XML that create a javascript output:
Code:
<xsl:text>
dd.elements["</xsl:text><xsl:value-of select="@domid"/><xsl:text>"].props["content"] = "</xsl:text>
<xsl:call-template name="cleanQuote">
<xsl:with-param name="string"><xsl:value-of select="./content" />
</xsl:with-param>
</xsl:call-template>
<xsl:text>";</xsl:text>
my output is:
Code:
dd.elements["paragraph_62"].props["content"] = "sdfsdfsdf <br />
<br />
<br />
sfsd sdfsfdfsd <br />
<br />
<br />
<br />
sfdsfdsfd sfdsfd <br />
safsdff";
the problem is that the CRLF chars cause problems in the resulting page... so I want this output:
Code:
dd.elements["paragraph_62"].props["content"] = "sdfsdfsdf <br /><br /><br />sfsd sdfsfdfsd <br /><br /><br /><br />sfdsfdsfd sfdsfd <br />safsdff";
must I use the translate() function? if so how can I specify the CRLF char?
Code:
<xsl:value-of select="translate(./content,CRLF,'')" />
Salo
The surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us - Calvin (and Hobbes) ;-)