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

RE: Matching text nodes with only whitespaces

Subject: RE: Matching text nodes with only whitespaces
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Thu, 3 Feb 2005 16:12:58 -0000
xslt strip whitespaces from text
> I am really sorry for all the troubles, but we had some
> whitespace issues with XML Spy.... First I thought that my
> normalizing stylesheet doesn't work properly, but fortunately
> it does. There are interesting things going on, if you decide
> to "pretty-print" your XML documents...
>
> The problem with normalize-space was the following:
> We first generated FO documents including nodes like
> <marker> '' 13 </maker>
> These documents were pretty printed via XML Spy, so there was
> whitespace
> which we wanted to get rid off (since it was output in our
> PDFs). If we would have used
>
> <xsl:template match="text()">
> 	<xsl:value-of select=""normalize-space(.)"/>
> </xsl:template>
>
> we would have got
> <marker>'' 13<marker>
>
> Or is my understanding of normalize-space incorrect?

Have a look at <xsl:strip-space elements="*"/>

This strips presentational whitespace (whitespace only text nodes) from the
source document, which I think is what you're after.

cheers
andrew

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.