I am using XSLT inside of ASP, it's serviced by msxml6.
Incoming XML loaded to the object has "carriage returns" which I think may be ASCII 10. I would like to transform those to <br/>
in the output.
I am trying to detect
in the incoming XML, but can't seem to find that. I've tried Javascript (JScript inside of ASP), to no avail.
It's coming from MS Excel spreadsheetML, interestingly.
Ideas on:
- how it's encoded in the XML object inside msxsm6
- how to detect, then replace with
<br/>
?
Thank you everyone, stackoverflow is great!!
From http://www.w3.org/TR/2008/REC-xml-20081126/#sec-line-ends
So, it's ok to look for


(or
). But do note that white space only text nodes from the input may or may not be preserve depending on XML tree provider (MSXSL XML parser doesn't preserve this text nodes). Not white space only text nodes are preserved, of course.Then, this
text
named template replace new lines with emptybr
elements in XSLT 1.0:With this input:
Output:
Here is a template I use to do this: