[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] normalize-space()?


Subject: Re: [xsl] normalize-space()?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 1 Nov 2006 00:31:36 GMT

>  found that fop does not support normalize-space().
FOP doesn't support XPath at all, it takes an XSL-FO document (typically
but not necessarily) generted by by XSLT and typesets it.
You are using Xalan not FOP to process the XSLT. The error comes from

<xsl:apply-templates select="normalize-space(covers)" 

you can only apply templates to a node set, and normalize-space returns
a string, which is therefore not a node set.

What you want to do is normalize the white space in the result, not the
input, so

<xsl:variable name="x">
 <xsl:apply-templates/>
</xsl:variable>
<xsl:value-of select="normalize-space($x)"/>
or if your covers elemnt doesn't have element children just text you
 dont want to apply templates at all, just
<xsl:value-of select="normalize-space(.)"/>

David


Current Thread
Keywords