Orbeon XForms - 检索实例的 XML

Orbeon XForms - Retrieve the XML of an instance

我有一个使用 Orbeon 开发的 XForm。现在,在单击按钮时,我需要能够以 XML 格式检索整个实例,将此 XML 存储在另一个实例的节点中,并将此 post 存储到网络服务。 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>