Hi,
This is something I'm not quite sure how to do in XSLTForms (or, in
XForms at all, for that matter):
Let's say I have an instance that gets its data from some external
source, and the data has language information associated with it (an
xml:lang attribute), say it looks like:
<p xml:lang="en">
<span>English</span>
</p>
or
<p xml:lang="he">
<span>עברית</span>
</p>
The language choice should invoke different formatting. For example,
some languages require different fonts or directionality, which is
usually set in the CSS.
The best solution I came up with is something like (note: tests using
lang() fail with an error):
<xf:repeat nodeset="span[../@xml:lang='en']"/>
<html:span xml:lang="en" lang="en">
<xf:output ref="."/>
</html:span>
</xf:repeat>
<xf:repeat nodeset="span[../@xml:lang='he']"/>
<html:span xml:lang="he" lang="he">
<xf:output ref="."/>
</html:span>
</xf:repeat>
...
This solution will become unscalable as the number of supported
languages increases.
Is there any better way for an xf:output to retain some of the metadata
associated with its instance data?
Since this isn't really an XSLTForms question, is there a generic XForms
email list that would be a more appropriate forum?
Thanks,
--
---
Efraim Feinstein
Lead Developer
Open Siddur Project
http://opensiddur.net
http://wiki.jewishliturgy.org
|