Orbeon XForms 重复问题
Orbeon XForms repeat issue
我想用我的 XML 文件的内容填充一个 XForm 重复部分。
首先,我需要根据 XML 文件的以下记录创建行:
<Entity code="a" type="AdditionalServices" active="true" sortOrder="1">
<Description language="de">a</Description>
<Description language="en">a</Description>
</Entity>
<Entity code="b" type="AdditionalServices" active="true" sortOrder="2">
<Description language="de">b</Description>
<Description language="en">b</Description>
</Entity>
<Entity code="c" type="AdditionalServices" active="true" sortOrder="3">
<Description language="de">c</Description>
<Description language="en">c</Description>
</Entity>
<Entity code="d" type="AdditionalServices" active="true" sortOrder="4">
<Description language="de">d</Description>
<Description language="en">d</Description>
</Entity>
<Entity code="e" type="AdditionalServices" active="true" sortOrder="5">
<Description language="de">e</Description>
<Description language="en">e</Description>
</Entity>
<Entity code="f" type="AdditionalServices" active="true" sortOrder="6">
<Description language="de">f</Description>
<Description language="en">f</Description>
</Entity>
我可以通过以下方式做到这一点:
<fr:grid>
<xh:table >
<xh:thead>
<xh:tr>
<xh:th>Code</xh:th>
</xh:tr>
</xh:thead>
<xh:tbody >
<xf:repeat ref="instance('fr-form-instance')//Entity[@type='AdditionalServices']" appearance="full">
<xh:tr>
<xh:td>
<xf:input ref="@code"></xf:input>
</xh:td>
</xf:repeat>
</xh:tbody>
</xh:table>
</fr:grid>
然后显示存储在以下XML部分的数量:
<CalcAdditionalServices>
<AdditionalServicesCode>d</AdditionalServicesCode>
<Quantity>1</Quantity>
</CalcAdditionalServices>
<CalcAdditionalServices>
<AdditionalServicesCode>e</AdditionalServicesCode>
<Quantity>2</Quantity>
</CalcAdditionalServices>
我的代码如下:
<xh:td>
<xf:input ref="instance('fr-form-instance')//CalcAdditionalServices[AdditionalServicesCode/text()=current()/@code]//Quantity"></xf:input>
</xh:td>
我只得到第一个数量:
Code Qty
a
b
c
d 1
e
f
我对 XForms 没有那么多经验,所以如果有人能给我提示就太好了。
系统没有创建第二个节点。
<CalcAdditionalServices>
<AdditionalServicesCode>e</AdditionalServicesCode>
<Quantity>2</Quantity>
</CalcAdditionalServices>
我们更改了替换方法,现在一切正常。
我想用我的 XML 文件的内容填充一个 XForm 重复部分。 首先,我需要根据 XML 文件的以下记录创建行:
<Entity code="a" type="AdditionalServices" active="true" sortOrder="1">
<Description language="de">a</Description>
<Description language="en">a</Description>
</Entity>
<Entity code="b" type="AdditionalServices" active="true" sortOrder="2">
<Description language="de">b</Description>
<Description language="en">b</Description>
</Entity>
<Entity code="c" type="AdditionalServices" active="true" sortOrder="3">
<Description language="de">c</Description>
<Description language="en">c</Description>
</Entity>
<Entity code="d" type="AdditionalServices" active="true" sortOrder="4">
<Description language="de">d</Description>
<Description language="en">d</Description>
</Entity>
<Entity code="e" type="AdditionalServices" active="true" sortOrder="5">
<Description language="de">e</Description>
<Description language="en">e</Description>
</Entity>
<Entity code="f" type="AdditionalServices" active="true" sortOrder="6">
<Description language="de">f</Description>
<Description language="en">f</Description>
</Entity>
我可以通过以下方式做到这一点:
<fr:grid>
<xh:table >
<xh:thead>
<xh:tr>
<xh:th>Code</xh:th>
</xh:tr>
</xh:thead>
<xh:tbody >
<xf:repeat ref="instance('fr-form-instance')//Entity[@type='AdditionalServices']" appearance="full">
<xh:tr>
<xh:td>
<xf:input ref="@code"></xf:input>
</xh:td>
</xf:repeat>
</xh:tbody>
</xh:table>
</fr:grid>
然后显示存储在以下XML部分的数量:
<CalcAdditionalServices>
<AdditionalServicesCode>d</AdditionalServicesCode>
<Quantity>1</Quantity>
</CalcAdditionalServices>
<CalcAdditionalServices>
<AdditionalServicesCode>e</AdditionalServicesCode>
<Quantity>2</Quantity>
</CalcAdditionalServices>
我的代码如下:
<xh:td>
<xf:input ref="instance('fr-form-instance')//CalcAdditionalServices[AdditionalServicesCode/text()=current()/@code]//Quantity"></xf:input>
</xh:td>
我只得到第一个数量:
Code Qty
a
b
c
d 1
e
f
我对 XForms 没有那么多经验,所以如果有人能给我提示就太好了。
系统没有创建第二个节点。
<CalcAdditionalServices>
<AdditionalServicesCode>e</AdditionalServicesCode>
<Quantity>2</Quantity>
</CalcAdditionalServices>
我们更改了替换方法,现在一切正常。