Re: [Xsltforms-support] Binding to optional element
Brought to you by:
alain-couthures
From: Klotz, L. <Lei...@xe...> - 2010-01-19 21:25:14
|
You might be able to use the relevance-with-submission-flag hack: <bind nodeset="/root/format" relevant="instance('state')/aboutToSubmit = 'false' or . != ''" /> <instance id="state"><data xmlns=""><aboutToSubmit>false</aboutToSubmit></instance> <submit submission="save"> <setvalue ev:event="DOMActivate" ref="instance('state')/aboutToSubmit">true</setvalue> </submit> <submission id="save"> <setvalue ev:event="xforms-submit-done" ref="instance('state')/aboutToSubmit">false</setvalue> <setvalue ev:event="xforms-submit-error" ref="instance('state')/aboutToSubmit">false</setvalue> </submit> -----Original Message----- From: Micah Dubinko [mailto:Mic...@ma...] Sent: Tuesday, January 19, 2010 11:58 AM To: xsl...@li... Subject: [Xsltforms-support] Binding to optional element Hey everyone, This was difficult to do in XForms 1.0. What's the latest state of the art? Say I have an XML instance like this: <root> <format>xml</format> </root> Possible values for the format element are "xml", "text", "binary", or a default setting, indicated by a complete absence of the <format> element. I'd like this to attach to a select1 with four choices: <xf:select1 ref="format">... * xml * text * binary * default Where the first three set the value of the <format> element, and the fourth omits the element altogether. In XForms 1.0, the difficulty comes from binding to a nonexistent element. Are there features from 1.1, 1.2, or XSLTForms that make this case easier? Anyone have an example? Thanks! -m ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support |