This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Creating an input form, XML -> XSLT -> HTML
- From: Jörg Heinicke <Joerg dot Heinicke at gmx dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sun, 30 Dec 2001 03:10:42 +0100 (MET)
- Subject: Re: [xsl] Creating an input form, XML -> XSLT -> HTML
- References: <3C2E4C00.75DC9A6D@home.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> <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