XSLT problem with carriage return or line find characters??

Posted on 2004-10-09
Last Modified: 2013-12-03
Basically, I have a VB .Net application in which I create a XML file which is transformed into a '.html' file using a XSL file based on data from several textboxes in the VB .Net app, one of the textboxes is a multi-line textbox.
Here is the data.xml file:

<?xml version="1.0" standalone="yes"?>
    <Address>1234 W. main St.</Address>
    <Notes>this should return
control characters
as they appear

As you can see from the 'Notes' tag above, this data was inputed from a multi-line textbox and a return character was used after each line of text.

Here is the data.xsl file:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:template match="/">
<xsl:for-each select="dataroot/Contacts">
  <xsl:value-of select="Firstname" />
  <xsl:value-of select="LastName" />
 <xsl:value-of select="Address" />
  <xsl:value-of select="MobilePhone" />
  <xsl:value-of select="Notes" />
  <xsl:value-of select="HomePhone" />


Here is the data.html file:

    <META http-equiv="Content-Type" content="text/html; charset=utf-16">
    <p>1234 W. main St.</p>
    <p>this should return control characters as they appear</p>

The user hits return after every line of text in that multi-line textbox, but the XSL file ignores the carriage return characters.
So, I'd like to know how to change the XSL file so, it would replace every carriage return or line-feed character with a '<br>'. The HTML should look exactly like the way it does in the multi-line textbox. I'm a newbie on using XML and XSL.

Question by:rkckjk
1 Comment

Accepted Solution

a_twixt_in_the_tale earned 250 total points
ID: 12274120
<pre style="font-family:Times New Roman;font-size:14">
  <xsl:value-of select="Notes" />

Depending on the default style-sheet settings u mite have in ur browser change the pre style


Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now