File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
XML and Related Technologies
Help replacing characters using XSL
Greg L Tonn
Joined: Nov 27, 2006
May 08, 2007 16:32:00
We have text data that has new line characters in it and when we transform it using our XSL the new lines preserved. So I was hoping to be able to replace the new line characters with the <br> tag.
XPath has a function, replace(
,replace). However, I can't get it to work with the <br> tag.
Does anyone have a better solution or know how I can get this one to work?
<xsl:value-of select="replace($Value, ' ', <br>"/>
Joined: Oct 14, 2005
May 08, 2007 21:54:00
You don't want to replace the newline by the string "<br>". You want to replace it by a "br" element, and that isn't the same thing.
However this is an XSLT FAQ, let me just google it... yup, here you go:
I agree. Here's the link:
subject: Help replacing characters using XSL
Keep HTML tag in String
New line into HTML break using Xalan???
JSTL out with JSP expression
handling multiple languages using XSL
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014