• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

ANSWER: Dynamically creating form fields with XSL

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!