Re: [xsl] textarea bug?

Subject: Re: [xsl] textarea bug?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 21 Apr 2001 22:40:25 +0100



You should not get any output at all from that stylesheet (which
processor are you using?

        <xsl:element name="/textarea"/>

xsl:element may only be used to specify a legal XML name XML names may
not start with /.

You have completely misunderstood how XSL works, you are not generating
the literal XML syntax, so you never want to write "/textarea" you are
generating a tree of nodes. The element node created by xsl:element
is the _whole_ element not just the start tag.

<xsl:template match="TAREA">
        <xsl:element name="textarea">
                <xsl:attribute
name="name"><xsl:value-of
select="@NAME"/></xsl:attribute>
        </xsl:element>
                <xsl:value-of select="@VALUE"/>
        <xsl:element name="/textarea"/>
</xsl:template>


should be

<xsl:template match="TAREA">
  <textarea name="{@NAME}>
                <xsl:value-of select="@VALUE"/>
  </textarea>
</xsl:template>
 

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread