Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 5th, 2006, 03:08 AM
Registered User
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default about carriage return...

I'm converting an XML into HTML. I have this element in XML:
RVA Recorded Voice Announcement
TCP Transport Control Protocol
QOS Quality Of Service

Then, when I naively try to to put it in my resulting HTML...

<xsl:value-of select="./glossary"/>

I get this ugly result:

RVA Recorded Voice Announcement TCP Transport Control Protocol QOS Quality Of Service
Carriage returns and some spaces have disappeared.

I'm not sure if the problem is in the XML, or the XSL transformation. Do I have to include something in the XML for not losing the carriage return? Or maybe in the XSL?

Sorry if this has been asked before, I couldn't find out by myself...

Old July 5th, 2006, 04:11 AM
mhkay's Avatar
Wrox Author
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts

The problem isn't with XML or with your XSLT, it is with HTML. In HTML, multiple whitespace characters are considered equivalent to a single space and are displayed as such by the browser. The simplest way out of this is to wrap the output in a <pre> element.

Michael Kay
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference

Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking for a Carriage return darkhalf Classic ASP Databases 2 November 5th, 2007 06:15 AM
insert carriage return darkhalf Javascript 0 April 10th, 2007 02:42 PM
Carriage Return and Enter keys flashster BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 September 13th, 2006 06:38 AM
New Line/Carriage Return interrupt Javascript How-To 7 October 3rd, 2004 06:27 AM
HELP Inserting Carriage Return orangem Classic ASP Databases 8 July 5th, 2004 08:36 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.