Groups | Blog | Home
all groups > dotnet xml > march 2005 >

dotnet xml : Carriage Returns



falcon
3/3/2005 3:47:02 PM
I'm not a c# guy but it seems that there would be a replace() function of
some sort as in other scripting that could take the string and replace the
\r\n with <br />.

That would give you breaks in the text rendered.

in vbscript it would be

replace(//\r/\n/,"<br />")




[quoted text, click to view]
John Bowman
3/3/2005 4:23:57 PM
Hi All,

I'm rather new to XML/HTML work & have run into a problem that has me
stymied. Basically, my C# code receives a large text string that may contain
"\r\n" in 1 or more places. I need to write this string out to be the value
of a particular element tag in an XML file that will later be transformed
into HTML using an XSL file. That's the easy part. That problem is that I
need to have the "\r\n" seqeunces show up as line feeds in the final HTML so
the final HTML shows separate lines of text - just like the original string
intended. Can someone explain/show me how to do this?

TIA,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> john.bowman@thermo.com

John Bowman
3/9/2005 5:38:23 PM
Falcon,

Thanks for the response. That's what I resorted to for now just to make it
work. Basically, after the transformation into HTML, we just edit the raw
HTML to replace the embedded escape sequences. It would seem there is a
better way though.

John

[quoted text, click to view]

AddThis Social Bookmark Button