This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: new user xslt


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]