Xpath xforms中多元素的concat
我有以下数据实例Xpath xforms中多元素的concat,xpath,xforms,orbeon,Xpath,Xforms,Orbeon,我有以下数据实例 <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:exforms="http://www.exforms.org/exf/1-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:exforms="http://www.exforms.org/exf/1-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xhtml:head>
<xforms:instance id="instanceData">
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<fruits>
<fruit>
<fruit-name>Mango</fruit-name>
</fruit>
<fruit>
<fruit-name>Apple</fruit-name>
</fruit>
<fruit>
<fruit-name>Banana</fruit-name>
</fruit>
</fruits>
<all-fruits></all-fruits>
</form>
</xforms:instance>
</xhtml:head>
</xhtml:html>
芒果
苹果
香蕉
我想在所有水果标签中列出所有水果的名称,如下所示
<all-fruits>Mango Apple Banana</all-fruits>
芒果苹果香蕉
请提出一些实现同样目标的方法。当我尝试使用xxforms:iterate和concat时,它对我不起作用。下面的操作完成了:
<xforms:bind nodeset="all-fruits"
calculate="string-join(../fruits/fruit/fruit-name, ' ')"/>
这是完整的源代码,您可以运行它:
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:exforms="http://www.exforms.org/exf/1-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xforms="http://www.w3.org/2002/xforms">
<xhtml:head>
<xforms:model>
<xforms:instance id="instanceData">
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<fruits>
<fruit>
<fruit-name>Mango</fruit-name>
</fruit>
<fruit>
<fruit-name>Apple</fruit-name>
</fruit>
<fruit>
<fruit-name>Banana</fruit-name>
</fruit>
</fruits>
<all-fruits></all-fruits>
</form>
</xforms:instance>
<xforms:bind nodeset="all-fruits" calculate="string-join(../fruits/fruit/fruit-name, ' ')"/>
</xforms:model>
</xhtml:head>
<xhtml:body/>
</xhtml:html>
芒果
苹果
香蕉