Re: [xsl] Creating an input form, XML -> XSLT -> HTML

Subject: Re: [xsl] Creating an input form, XML -> XSLT -> HTML
From: Jörg Heinicke <Joerg.Heinicke@xxxxxx>
Date: Sun, 30 Dec 2001 03:10:42 +0100 (MET)
> <xsl:text disable-output-escaping="yes"> First Name: <![CDATA[<]]>input
> type="text" name="</xsl:text><xsl:value-of
> select="generate-id()"/><xsl:text>" value="</xsl:text><xsl:value-of
> select="GivenName"/><xsl:text disable-output-escaping="yes">"> </xsl:text>

NEVER use this! Why? We had it so often on this list in the last weeks.

<input type="text" name="{generate-id()}" value="{GivenName}"/> does the
same.

But I think the other solution is the better one. How would you evaluate a
input-field without knowing it's name?

So with the XML similar to this:

<input>
  <type>text</type>
  <name>FIRSTNAME</name>
  <value>James</value>
</input>
<input>
  <type>text</type>
  <name>LASTNAME</name>
  <value>Wolf</value>
</input>

I would use this XSL:

<xsl:template match="input">
  <input type="{type}" name="{name}" value="{value}"/>
</xsl:template>

Regards,

Joerg

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


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


Current Thread