This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The solution for $book in doc("http://bstore1.example.com/full-text.xml") /books/book let $au := $book/metadata/author[. ftcontains ftnot ("montana" ftand "marigold")] let $co := $book//content[. ftcontains (("correct" ftor ("comment" with stemming) ftor "guidance" ftor "assistance" ftor "help") ftand "usability test.*" with wildcards) window 70 words without content .//footnote] where count($au) > 0 and count($co) > 0 return <book number="{$book/@number}"> {$book/metadata/title, $book//content} </book> can NOT get the expected result, which is <book number="2> element because for <book number="2"> element, it does NOT have metadata/author element, so $au is zero item sequence and thus 'where count($au) > 0' is false. If take out the condition 'count($au) >0', it is still not correct because the window 70 words is too small, it shall be 75 words.
Zhen, I handled this as editorial. I removed the count($au) > 0 clause and increased the window size to 80. The correction will appear internally after the next use cases build. I will send the FTTF an alert when it is ready. Please review and if you agree with the change, close the bug. Pat