Re: [xsl] new user xslt

Subject: Re: [xsl] new user xslt
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 26 Apr 2002 10:43:14 +0100
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


Current Thread