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]

Re: textarea bug?






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


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