inner html in xforms:output?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

inner html in xforms:output?

Pascal Heus
I have a simple xforms:output
<xforms:output ref="instance('ui')/login-link"/>

that refers to the form instance:
<!-- UI -->
<xforms:instance id="ui">
    <ui>
        <show-instance>false</show-instance>
        <login-link><xhtml:a href="../ddi/user/profile">Click here to login</xhtml:a></login-link>
    </ui>
</xforms:instance>
<xforms:bind nodeset="instance('ui')/login-link" relevant="string-length(instance('user'))=0"/>

I was hoping to have the xforms:output content to show as an HTML link but it seems the inner <xhtml:a> element is stripped out by the engine and only the text shows. Is this by design or not allowed per XFroms specs? I could a trigger with appearance="xxforms:link" instead but this looked a bit easier to implement and maintain.
Any was to make this work?
thanks
*P




--
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
Reply | Threaded
Open this post in threaded view
|

Re: inner html in xforms:output?

Erik Bruchez
Administrator
Pascal Heus wrote:
 > I have a simple xforms:output
 > *<xforms:output ref="instance('ui')/login-link"/>*
 >
 > that refers to the form instance:
 > <!-- UI -->
 > <xforms:instance id="ui">
 >     <ui>
 >         <show-instance>false</show-instance>
 >         *<login-link><xhtml:a href="../ddi/user/profile">Click here to
 > login</xhtml:a></login-link>*
 >     </ui>
 > </xforms:instance>
 > <xforms:bind nodeset="instance('ui')/login-link"
 > relevant="string-length(instance('user'))=0"/>
 >
 > I was hoping to have the xforms:output content to show as an HTML link
 > but it seems the inner <xhtml:a> element is stripped out by the engine
 > and only the text shows. Is this by design or not allowed per XFroms
 > specs?

In XForms (1.0 and 1.1), all controls are ultimately bound to text
nodes only. So yes, this is by design. If you want this to work, you
need to:

1. Escape the HTML, e.g.:

    &lt;xhtml:a href="../ddi/user/profile">Click here to login&lt;/xhtml:a>

2. Use the mediatype attribute on xforms:output:

    <xforms:output ref="instance('ui')/login-link" mediatype="text/html"/>

-Erik


--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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