= [GenshiRecipes Genshi Recipes]: Automatically Populating an HTML Form = The following template provides a match template that automatically adds a `value` attribute to any `` element that has matching data in the context. {{{ #!xml

Select one:
}}} Assuming the context data contained a variable “form” that was set to: {{{ #!python form = {'name': 'Look, Ma', 'enable': '', 'option': 'B', 'description': 'This is the description someone put in here'} }}} Then the output would look as follows: {{{ #!xml

Select one:
}}} This recipe would need to be extended to also support select fields. ---- See also: GenshiRecipes, [wiki:Documentation/xml-templates.html Genshi XML Template Language]