I have an XForm developed using Orbeon. Now, on a button click, I need to be able to retrieve the whole of an instance in XML format, store this XML in a node of another instance, and post this to a web service. The web service part, and the button click are all fine, it's the retrieval I'm struggling with.
<xf:instance id="model-xml-instance">
<form>
<Timestamp />
<UserName/>
<FormXML/>
</form>
</xf:instance>
<xf:instance id="model-main-instance">
<form>
<ControlValue1 />
<ControlValue2 />
<ControlValue3 />
</form>
</xf:instance>
<xf:action ev:event="DOMActivate">
<!-- Before the submission I need to retrieve the XML of the instance "model-main-instance", and store it in the FormXML node of 'model-xml-instance' -->
<xf:send submission="My-submission"/>
</xf:action>
The following should do the trick:
And of course, if you know that
<FormXML>
will always be empty, then you don't need the first<xf:delete>
.