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

RE: how to reserve single space after transformation

Subject: RE: how to reserve single space after transformation
From: "Lin, Jessica" <jlin@xxxxxxxxxxx>
Date: Mon, 5 Mar 2007 13:27:30 -0800
RE:  how to reserve single space after transformation
Here is example for XML file.
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<string> </string>

Here is my XSLT file.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:strip-space elements="*"/>

<xsl:template match="/ | node() | @* | comment() |
    <xsl:apply-templates select="@* | node()"/>

<xsl:template match="channel_object">
    <xsl:apply-template />


I strip out all white space in this transform since I will call
customized pretty-print XSLT later on the better print (that is out of
the scope of this problem).

-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Sent: Monday, March 05, 2007 12:57 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  how to reserve single space after transformation

> I am doing XML to XML transform by using saxon 8. But the
> result changed from single space to empty space, could you
> please help me for this problem?
> <category_label>
> 	<string> </string>
> </category_label>
> to:
> <category_label>
> 	<string/>
> </category_label>

I can think of many different stylesheets that would transform a single
space to a zero-length string, but the chances are that none of them is
stylesheet you wrote. Show us some code!

Michael Kay

Current Thread


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.
First Name
Last Name
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.