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

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:value-of select='normalize()'/>

It nicely normalizes the text into long strings but strips away my

I also tried:

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

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
<xsl:pi name='xml'>version="1.0" standalone="no"</xsl:pi>

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



Richard Lander
relander at

Professional XML Authoring

 XSL-List info and archive:

Current Thread