= [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', 'dropdown': '2'} }}} Then the output would look as follows: {{{ #!xml

Select one:

}}} ---- See also: GenshiRecipes, [wiki:Documentation/xml-templates.html Genshi XML Template Language]