xforms:insert help

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

xforms:insert help

wsalesky
Hi,
I'm trying to switch a form over to Orbeon and need to replace where I use xforms:copy with xforms:insert. I'm having a lot of trouble figuring out the correct syntax for this particular use (although I use xforms:insert in other places without any problem at all). Maybe someone can give me a hand?

I have 3 instances, the working instance "metadata" a instance for creator roles  called "roleShort"  and an empty instance I have been using to save copied role nodes into called "addRole". The original version of the form used a select1 populated by the roleShort instance, the selected role node was then copied to the addRole instance and then using an add trigger was eventually added to my main working instance "metadata"

Here is what it looks like with xforms:copy
<!-- instnaces used to select roles and add to main instance-->
            <xforms:instance id="addRole">
                <mods:mods>
                    <mods:role/>
                </mods:mods>
            </xforms:instance>
            <xforms:instance id="roleShort">
                <mods:mods>
                    <mods:role>
                        <mods:roleTerm authority="marcrelator" type="code">art</mods:roleTerm>
                        <mods:roleTerm authority="marcrelator" type="text">Artist</mods:roleTerm>
                    </mods:role>
                    <mods:role>
                        <mods:roleTerm authority="marcrelator" type="code">aut</mods:roleTerm>
                        <mods:roleTerm authority="marcrelator" type="text">Author</mods:roleTerm>
                    </mods:role>
              </mods:mods>
         </xforms:instance>

<!-- Select Creator Role -->
<xforms:select1 ref="instance('addRole')/child::*">
      <xforms:itemset nodeset="instance('roleShort')/child::*">
          <xforms:label style="display: block;" ref="mods:roleTerm[@type='text']"/>
          <xforms:value ref="mods:role"/>
          <xforms:copy ref="."/>
      </xforms:itemset>
</xforms:select1>

<!-- Add selected to working instance -->
<xforms:trigger class="add">
    <xforms:label>Add</xforms:label>
    <xforms:insert ev:event="DOMActivate"
                  context="instance('metadata')" nodeset="instance('metadata')//mods:mods/mods:name[index('name')]/child::*"
                   at="index('roleInfo')" position="after" origin="instance('addRole')/child::*/child::*"/>
 </xforms:trigger>

I have tried several different itterations of xforms:insert within the select1 statement but have had no luck? Any pointers would be very helpful!
Thanks,
-Winona


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