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

RE: WhiteSpace

Subject: RE: WhiteSpace
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 6 Nov 2003 15:14:15 -0000
xsl xa
> 
> When I apply the below template to my xml I get &#xA; in 
> place of white space.  How do can I remove the &#xA;?  I 
> thought <xsl:strip-space> would romove the hard spaces in the xml.

xsl:strip-space is about removing white-space-only text nodes.

If you want to replace newline characters by space characters, use the
normalize-space() function.

Newlines in attribute values are always serialized as &#xa; to ensure
that they survive the round trip through serialization and parsing.

Michael Kay

> 
> 
> ###########Template Used##########
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="xml" version="1.0" encoding="UTF-8" 
> indent="yes"/> <xsl:strip-space elements="*"/>
>  
> 
> <xsl:template match="/ | node() | @* | comment() | 
> processing-instruction()">
>   <xsl:copy>
>     <xsl:apply-templates select="@* | node()"/>
>   </xsl:copy>
> </xsl:template>
>    
> </xsl:stylesheet>
> 
> ########### XML #################
> <?xml version="1.0" encoding="UTF-8"?>
> <BODY>
> 		<P style="font-size:12.0">
> 			<SPAN style="font-family:'Times New 
> Roman','Times
> New Roman',Serif;
>  font-size:12.0pt;
>  font-style:normal;
>  font-weight:bold;
>  font-stretch:normal;
>  font-variant:normal;
>  color:#000000">CHAPTER 2 </SPAN>
> 		</P>
> 	<P style="font-size:12.0">
> 			<SPAN style="font-family:'Times New 
> Roman','Times
> New Roman',Serif;
>  font-size:12.0pt;
>  font-style:normal;
>  font-weight:bold;
>  font-stretch:normal;
>  font-variant:normal;
>  color:#000000">TITLE </SPAN>
> 		</P>
> </BODY>
> 
> 
> ############# OUTPUT ################
> 
> <BODY>
> 	<P style="font-size:12.0">
> 		<SPAN style="font-family:'Times New 
> Roman','Times New Roman',Serif;&#xA; font-size:12.0pt;&#xA; 
> font-style:normal;&#xA; font-weight:bold;&#xA; 
> font-stretch:normal;&#xA; font-variant:normal;&#xA; 
> color:#000000">CHAPTER 2 </SPAN>
> 	</P>
> 	<H1 style="font-size:12.0">
> 		<SPAN style="font-family:'Times New 
> Roman','Times New Roman',Serif;&#xA; font-size:12.0pt;&#xA; 
> font-style:normal;&#xA; font-weight:bold;&#xA; 
> font-stretch:normal;&#xA; font-variant:normal;&#xA; 
> color:#000000">TITLE </SPAN> </BODY>
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • WhiteSpace
    • Jason Clark - Thu, 6 Nov 2003 09:38:15 -0500 (EST)
      • Michael Kay - Thu, 6 Nov 2003 10:14:56 -0500 (EST) <=

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.