[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Preserving whitespace between elements

Subject: RE: Preserving whitespace between elements
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 11 Dec 2005 16:26:18 -0000
xml whitespace between elements
This looks like a bug in your XSLT processor, so the answer to your question
is

(a) report the bug to the vendor and/or
(b) use a different XSLT processor

Note that there are various ways you can influence the retention or
stripping of whitespace that occurs on its own between tags (whitespace-only
text nodes), but whitespace that occurs adjacent to non-whitespace
characters in the same text node should never be stripped by the system.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: matt [mailto:mfonda@xxxxxxxxxx] 
> Sent: 09 December 2005 21:11
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Preserving whitespace between elements
> 
> Hello,
> 
> I am having a problem with whitepsace getting stripped. Take the 
> following example:
> 
> xsl stylesheet:
> <xsl:template match="div|p|b|u|i">
>     <xsl:copy><xsl:apply-templates/></xsl:copy>
> </xsl:template>
> 
> xml:
> <div><p>here is some <b>bold</b> and <i>italic</i> text</p></div>
> 
> My expected output was:
> <div><p>here is some <b>bold</b> and <i>italic</i> text</p></div>
> 
> However, the space is getting stripped, so the actual output is:
> <div><p>here is some <b>bold</b>and<i>italic</i>text</p></div>
> 
> Any suggestions on how to prevent this?
> 
> Thanks,
> -- Matthew

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.