Stephen Cameron
2014-06-07 13:30:37 UTC
Hi
I have an XForm that is internationalised (ized), and it seems now via use
of the profiler that alot of the slowness in my form might be attributable
to that fact. So I am interested to find a better way if possible to
achieve the same goal as what I currently have.
I see that @ref is now supported on <xf:label> elements, so that is
something to try:
http://www.agencexml.com/xforms-tests/testsuite/XForms1.1/Edition1/Chapt08/8.2/8.2.1/8.2.1.a.xhtml
What I have a present is a second model for my label strings and this has a
single instance with data of the following structure:
<?xml version="1.0" encoding="UTF-8"?>
<labels lang="en">
<languages>
<language lang="en">English</language>
<language lang="es">Español</language>
<language lang="fr">Français</language>
</languages>
<label-set id="header-title">
<label lang="en">Forms-Wizard Designer (alpha)</label>
<label lang="es">Forms-Wizard Designer (alpha)</label>
<label lang="fr">Forms-Wizard Designer (alpha)</label>
</label-set>
The label-set strings are used in the following way in the form:
<xf:input ref="@name">
<xf:label>
<xf:output model="model2"
ref="label-set[@id='name']/label[@lang=../../@lang]" />
</xf:label>
Apparently these label <xf:output> references get re-evaluated each time
there is a recalculation of the form. I did imagine (naively) that this
would not happen if they where placed into a second model, but that doesn't
seem to be what is happening in practice.
Also, I should be able to make that @xml:id to get a quicker scan of the
labels model I suppose, but does XSLTForms support @id attributes as unique
identifiers in data models?
Thanks for your insights.
Steve Cameron
I have an XForm that is internationalised (ized), and it seems now via use
of the profiler that alot of the slowness in my form might be attributable
to that fact. So I am interested to find a better way if possible to
achieve the same goal as what I currently have.
I see that @ref is now supported on <xf:label> elements, so that is
something to try:
http://www.agencexml.com/xforms-tests/testsuite/XForms1.1/Edition1/Chapt08/8.2/8.2.1/8.2.1.a.xhtml
What I have a present is a second model for my label strings and this has a
single instance with data of the following structure:
<?xml version="1.0" encoding="UTF-8"?>
<labels lang="en">
<languages>
<language lang="en">English</language>
<language lang="es">Español</language>
<language lang="fr">Français</language>
</languages>
<label-set id="header-title">
<label lang="en">Forms-Wizard Designer (alpha)</label>
<label lang="es">Forms-Wizard Designer (alpha)</label>
<label lang="fr">Forms-Wizard Designer (alpha)</label>
</label-set>
The label-set strings are used in the following way in the form:
<xf:input ref="@name">
<xf:label>
<xf:output model="model2"
ref="label-set[@id='name']/label[@lang=../../@lang]" />
</xf:label>
Apparently these label <xf:output> references get re-evaluated each time
there is a recalculation of the form. I did imagine (naively) that this
would not happen if they where placed into a second model, but that doesn't
seem to be what is happening in practice.
Also, I should be able to make that @xml:id to get a quicker scan of the
labels model I suppose, but does XSLTForms support @id attributes as unique
identifiers in data models?
Thanks for your insights.
Steve Cameron