This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: new user xslt
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: CHAOUI Hassan <HCHAOUI at unedic dot fr>
- Cc: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 26 Apr 2002 10:43:14 +0100
- Subject: Re: [xsl] new user xslt
- Organization: Jeni Tennison Consulting Ltd
- References: <4F711A956E6FD311AA2100508B5C5AD503414002@SA10900301.moe.ups-b.unedic.fr>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi,
> When I apply the template, I have tags with white space, and the xml
> parser refuse that.
The XSLT processor should give you an error when you try to create
them.
> How can I do to have proprely xml tags :
>
> <xsl:template match="row">
> <xsl:element name="{cell[1]}">
> <xsl:value-of select="cell[2]"/>
> </xsl:element>
> </xsl:template>
You need to use the normalize-space() function to strip the
whitespace:
<xsl:element name="{normalize-space(cell[1])}">
<xsl:value-of select="normalize-space(cell[2])" />
</xsl:element>
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list