Does anyone know a way to select a name from a list and then insert the
corresponding complex structure into an instance document?
For example, I have a list of authorities like this: <xforms:instance id="authorities">and I need the user to select one of them by name on the form. (E.g., by typing "Jim" or "Cory".) When the user selects one, I need to insert its entire <auth:authority/> block into the main instance document, right above any existing <auth:authority/> block. It needs to be surrounded by another XML entity in the main instance document, called "<auth:responsible_party>". The main instance looks something like this: <defaultviewpoint:default_rootI want to use an incremental "select1" control to choose which one to insert, but I'm not sure how to grab the chosen <auth:authority> by its "mdp:id" key and do the insert. Has anyone done anything like this? Thanks, -Jim -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Hi Jim,
> and I need the user to select one of them by name on the form. (E.g., by > typing "Jim" or "Cory".) When the user selects one, I need to insert its > entire <auth:authority/> block into the main instance document, right > above any existing <auth:authority/> block. It needs to be surrounded by > another XML entity in the main instance document, called > "<auth:responsible_party>". i think the easiest solution would be to put an empty "responsible_party" fragment containing the nested authority structure into the main instance. Then, you could bind the select1 eigther to the @mdp:id or to the rdfs:label so that this value is set when the user selects one of the entries. The remaining value could be calculated using a binding, because it depends on the selected value. For example: <xforms:bind ref="instance('main-instance')/v:unstructured_data_asset/auth:responsible_party/auth:authority/rdfs:label" calculate="instance('authorities')/auth:authority/rdfs:label[ ../@mdp:id eq instance('main-instance')//v:unstructured_data_asset/auth:responsible_party/auth:authority/@mdp:id ]" /> I've attached an example. HTH florian -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws asset.xhtml (6K) Download Attachment |
Florian Schmitt wrote:
> > i think the easiest solution would be to put an empty > "responsible_party" fragment containing the nested authority structure > into the main instance. > > Then, you could bind the select1 eigther to the @mdp:id or to the > rdfs:label so that this value is set when the user selects one of the > entries. The remaining value could be calculated using a binding, > because it depends on the selected value. For example: > > <xforms:bind > ref="instance('main-instance')/v:unstructured_data_asset/auth:responsible_party/auth:authority/rdfs:label" > > calculate="instance('authorities')/auth:authority/rdfs:label[ > ../@mdp:id eq > instance('main-instance')//v:unstructured_data_asset/auth:responsible_party/auth:authority/@mdp:id > > ]" /> > > I've attached an example. -Jim -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |