我有以下Xquery:
let $x := <a>
<i>false</i>
</a>
return
if (every $t in $x/a satisfies $t/i eq "true")
then $x
else <nothing/>
Run Code Online (Sandbox Code Playgroud)
我如何理解这一点,$x如果所有人<a>都有一个<i>单词"true" ,则返回.但是,这总是回归$x.
相反,如果我有以下XML文档:
<root>
<a><i>false</i></a>
</root>
Run Code Online (Sandbox Code Playgroud)
以及以下查询:
for $x in /root
return
if (every $t in $x/a satisfies $t/i eq "true" )
then $x
else <nothing/>
Run Code Online (Sandbox Code Playgroud)
它将<nothing/>在<i>包含false时返回$x,<i>并在"true" 时返回
我的问题是: