Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Prototype for XBL component with binding to optional element
<xbl:xbl xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xbl="http://www.w3.org/ns/xbl"
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl">
<xbl:binding id="fr-optional-element" element="fr|optional-element" xxbl:mode="binding handlers" xxbl:container="span">
<xbl:template>
<xforms:group appearance="xxforms:internal">
<!-- Content such as xforms:input -->
<xbl:content/>
<!-- Insert element if missing -->
<xforms:action ev:event="xforms-enabled" ev:target="#observer">
<xforms:var name="ref" xbl:attr="xbl:text=ref"/>
<xforms:var name="name" value="tokenize($ref, '/')[last()]"/>
<xforms:insert
if="not(exists(xxforms:binding('fr-optional-element'))) and $name castable as xs:NCName"
context="xxforms:component-context()"
ref="*"
origin="xxforms:element($name)"/>
</xforms:action>
</xforms:group>
</xbl:template>
</xbl:binding>
</xbl:xbl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.