Posted by
Erik Bruchez on
URL: https://discuss.orbeon.com/DMV-Forms-Example-tp27273p27333.html
Technically, nothing is "moved": it just happens that the element is
called xhtml:input in XHTML, and xforms:input in XForms, and that they
have a similar function. However, they are different elements.
An xforms:input, in particular, can be rendered in ways different than
an HTML input element: it can end up being a date picker, or be one of
those "edit in place" widgets.
This is even clearer if you look at xforms:select1, which does not
have the same name in HTML, or xforms:range, which does not even have
an equivalent in HTML.
In order to be consistent, we have decided that whenever possible, the
HTML "translation" of XForms controls would be encapsulated within a
<span> with the id of the respective XForms control, and that the
extra HTML attributes present on the XForms control would be copied to
that <span> element as well.
As you have seen, this is not without problems when it comes to
styling, but we don't think it is necessarily a bad solution. Styling
in XForms, to be done perfectly right, would in fact require being
able to address the XForms elements directly and perform a translation
of CSS styles and rules to apply to the translated HTML elements that
make the most sense.
As to theme.xsl, something like this should do:
<xsl:template match="xhtml:span[contains(@class, 'xforms-input')
and xhtml:input]">
<xsl:copy>
<xsl:copy-of select="@* except @style"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template
match="xhtml:input[parent::xhtml:span[contains(@class, 'xforms-input')]]">
<xsl:copy>
<xsl:copy-of select="(@*, ../@style)"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
-Erik
Richard Braman wrote:
> What if the height,width,and font-size of each input tag are different.
> I don't understand why the attributes of the <input> are being moved to
> the <span> by OPS. I don't understand the assumption that it is OK to
> move someones attributes from one tag to another. I also really don't
> understand what is accomplished by moving them. How can I fix this in
> theme.xsl? I rellay don't want to move them back because I never wanted
> them to move to begin with.
--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: mailto:
[hidden email]
For general help: mailto:
[hidden email]?subject=help
ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws