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

whitespace problem when formating to plain-text

Subject: whitespace problem when formating to plain-text
From: John Ericson <john@xxxxxxxxxx>
Date: Thu, 1 Nov 2001 00:13:07 +0000
john ericson
Ive been writing a xsl for formating to plain-text. I have written one for
formating to html and it worked fine, but when Im writing this one I hit
into some problem with whitespaces. After some research I find out how to
use normalize-space.
But now it removes whitespaces which is needed for proper formating too.
I have recreated the problem in minimal files and here they are:

file.xml:
<info>
	<link url="231243342">SpazeIRC</link> blablablabla bla . bldse dfseld s3242. 43 <link url="2342342">har</link>.
</info>

text.xsl:
<xsl:template match="text()">
	<xsl:value-of select="normalize-space(.)"/>
</xsl:template>

The output I get:
SpazeIRCblablablabla bla . bldse dfseld s3242. 43har.

I want it to look like this:
SpazeIRC blablablabla bla . bldse dfseld s3242. 43 har.
        ^                                         ^

I must write code to check for '> ' in the beginning and ' <' in the end of the
string in the "text()" template so I can add an whitespace in the beginning or
the end if they exist.

Can anyone help me write this code or come up with a similar solution?


-- 
* John Ericson john@xxxxxxxxxx
* ICQ: 7325429 JID: high@xxxxxxxxxx
* web: http://john.pp.se

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


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.