0
我有以下XQuery函数。如何在xquery中打印唯一值
declare function local:format($input as element() *) as element() *{
for $v in
$input
return if
(((for $x in $input return $x)/@one=$v/@two) and ((for $y in $input return $y)/@two=$v/@one))
then
(
)
else {$v}
};
输入上面的功能是:
** <pair two="IN011" one="IN007"> David Emma </pair> **
** <pair two="IN007" one="IN011"> Emma David </pair> **
但我想输出是:
** <pair two="IN011" one="IN007"> David Emma </pair> **
要不然:
** <pair two="IN007" one="IN011"> Emma David </pair> **
也就是说,我希望它只能打印一次。
上述功能的功能应该是这样的。但是,这是不完整的。我尽可能地尝试。请帮忙让我上面