Click to See Complete Forum and Search --> : "New Line" character


sandodo
September 25th, 2002, 02:53 AM
I want to create a variable with the content of new line, so that I can insert it to a string for example "This is a string!" that it becomes "This is \na string!". Does anybody can help with an idea?
I tried with
<xsl:variable name="new-line">
</xsl:variable>

but it doesnot work. The output is still:
This is a string!


If I write this way
<xsl:variable name="new-line">n
n</xsl:variable>

the output string becomes:
This is n
na string!

The new line works. But the problem is that I donot want the two 'n's

Thanks very much in advance!

Ungi
September 25th, 2002, 03:17 AM
Take a look here (http://www.codeguru.com/forum/showthread.php?s=&threadid=211313)! perhaps something could help you with your problem...

sandodo
September 25th, 2002, 03:21 AM
thanks!
I am checking.

Waldo2k2
September 28th, 2002, 08:17 PM
some background info:

unix return: \n
c++ return: \n
DOS/windows return: \r\n

windows automatically parses \n to be \r\n. I think unix will choke on the \r.

what if you try this:

<xsl:variable name="new-line">
"This is some Text '\n' This is some More Text."
</xsl:variable>

haven't tested it, it's just a thought

sandodo
October 13th, 2002, 08:52 PM
the new line character for xml is & # x A ;
\r \n donot work