在 XForms 表单中,我有一个重复的部分,其中包含输入。每个重复部分中都会填充一个下拉列表,并且没有两个下拉列表可以选择相同的值。每个下拉菜单必须有一个唯一的选择,如果在单独的部分中的下拉菜单之间有重复的选择,它们应该变得无效。
这就是我要追求的想法
constraint="not(. = instance('my-instance')/repeated-section[Include everything BUT .'s parent]/dropdown)"
示例实例数据:
<repeated-section>
<input1></input1>
<input2></input2>
<dropdown></dropdown>
<input4></input4>
</repeated-section>
<repeated-section>
<input1></input1>
<input2></input2>
<dropdown></dropdown>
<input4></input4>
</repeated-section>
<repeated-section>
<input1></input1>
<input2></input2>
<dropdown></dropdown>
<input4></input4>
</repeated-section>
这主要是一个 XPath 过滤问题。有可能做我要求的吗?我想将当前节点(假设是重复部分的第二组)与所有其他重复节点集(重复部分 1 和 3)进行比较,不包括当前节点集(因为如果你与包括自身在内的所有节点集进行比较,它将当然可以比较为真)。