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: Creating an input form, XML -> XSLT -> HTML


> <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


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