• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

ANSWER: Dynamically creating form fields with XSL

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably found the answer you were looking for by now, but perhaps this will help someone. In order to include form elements and assign them a name or value dynaically from the XML source, you must use the xsl:element tag, then assign attributes to that element. This should generate an HTML form element of type checkbox with the name "employeeId" with the value of the "employee_id" found in the XML document:
<xsl:element name="input">
<xsl:attribute name="type">checkbox</xsl:attribute>
<xsl:attribute name="name">employeeId</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="employee_id" />
</xsl:attribute>
</xsl:element>

Hope this helps!
Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic