Search code examples
domxformsxsltforms

XForms: Possible to modify HTML element attribute ? (I'm using XSLTForms)


Does XForms have a mechanism for manipulating attributes of the resultant HTML? I guess I mean emitting HTML dynamically and setting the attributes as part of that.

I know that using a xf:repeat - you can effectively emit HTML elements, but I can't work out if this would stretch to attributes?

I'm using XSLTForms as the implementation - so maybe this support hooks for Javascript to do this if there isn't a built-in way?

The reason to ask specifically - I would like to work with the audio element (and some other HTML5 elements).


Solution

  • Yes, it is named AVT for Attribute Value Template. As in XSLT, just wrap XPath expressions into curly braces like in <div class="proto{$myclass}">.