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

Problems with normlize() and whitespace stripping

Subject: Problems with normlize() and whitespace stripping
From: "Richard Lander" <rlander@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 19 Jun 1999 14:23:24 -0400
xsl comment whitespace
 Hello,

I am having quite a bit of trouble stripping the extra whitespace out of my
PARA elements, without also losing sub-elements.

I started with:

<xsl:template select="PARA">
<xsl:copy>
<xsl:value-of select='normalize()'/>
</xsl:copy>
</xsl:template>

It nicely normalizes the text into long strings but strips away my
sub-elements.

I also tried:

<xsl:template match='PARA'>
<xsl:copy>
<xsl:value-of select='normalize()'>
<xsl:apply-templates select='*|@*|comment()|pi()|text()'/>
</xsl:value-of>
</xsl:copy>
</xsl:template>

No difference.

I've also tried a bunch of other things which yield no better but worse
results. I can separate the text() from the * and *@ but not normalize them
and keep them together. Is there a way?

I've gotten the idea that normalize() cannot be a member of the an
xsl:apply-templates but only an xsl:value-of. Is that so?

BTW: The only other rules in the stylesheet are:

<xsl:template match='/'>
<xsl:comment>This file is automatically generated. Do not
edit!</xsl:comment>
<xsl:pi name='xml'>version="1.0" standalone="no"</xsl:pi>
<xsl:text>
</xsl:text>
<xsl:apply-templates/>
</xsl:template>

<xsl:template match='*|@*|comment()|pi()|text()'>
<xsl:copy>
<xsl:apply-templates select='*|@*|comment()|pi()|text()'/>
</xsl:copy>
</xsl:template>

Thanks,

Richard.


Richard Lander
relander at uwaterloo.ca
http://pdbeam.uwaterloo.ca/~rlander/

Professional XML Authoring
http://www.on-line-learning.com/



 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.