我有一个使用Orbeon开发的XForm。现在,单击按钮,我需要能够以XML格式检索整个实例,将此XML存储在另一个实例的节点中,并将其发布到web服务。web服务部分和按钮点击都很好,这是我正在努力的检索。
<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>
以下应该可以做到:
<xf:delete ref="instance('model-xml-instance')/FormXML/*"/>
<xf:insert ref="instance('model-xml-instance')/FormXML" origin="instance('model-main-instance')"/>
当然,如果你知道<FormXML>
总是空的,那么你就不需要第一个<xf:delete>
。