Eirik Lygre
2012-06-15 15:48:59 UTC
We have a user defined directive which can be called from freemarker as
shown below The directive will use some well-defined parameters (here
"name"), but will output all other directives directly, so that you can do
for example this:
[@form.input name="task.dateFormat" /]
[@form.input name="task.dateFormat" class="dateInput important required"
style="display:block" accesskey="D" /]
Now, we have seen the requirement to generate attributes with special
characters, such as with xml namespaces or html 5 custom data attributes.
For example:
[@form.input name="task.dateFormat" xml:lang="no"
data-format="dd.mm.yyyy" /]
This fails during parse. I tried the obvious, quoting the parameter names,
but that did not work. (Now, using special names would probably not work
for macros, but our directives are implemented in java, and the parameters
are passed as a straight array, with no syntax constraints).
-> Is it possible (today) to use parameter names with special characters?
-> How about tomorrow-ish :-)
shown below The directive will use some well-defined parameters (here
"name"), but will output all other directives directly, so that you can do
for example this:
[@form.input name="task.dateFormat" /]
[@form.input name="task.dateFormat" class="dateInput important required"
style="display:block" accesskey="D" /]
Now, we have seen the requirement to generate attributes with special
characters, such as with xml namespaces or html 5 custom data attributes.
For example:
[@form.input name="task.dateFormat" xml:lang="no"
data-format="dd.mm.yyyy" /]
This fails during parse. I tried the obvious, quoting the parameter names,
but that did not work. (Now, using special names would probably not work
for macros, but our directives are implemented in java, and the parameters
are passed as a straight array, with no syntax constraints).
-> Is it possible (today) to use parameter names with special characters?
-> How about tomorrow-ish :-)
--
Eirik
Eirik