This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5574 - ApplyFTScopeDifferentSentence/Para usage of general comparison is not right
Summary: ApplyFTScopeDifferentSentence/Para usage of general comparison is not right
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Full Text 1.0 (show other bugs)
Version: Working drafts
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-14 16:46 UTC by zhen hua liu
Modified: 2008-03-17 21:34 UTC (History)
0 users

See Also:


Attachments

Description zhen hua liu 2008-03-14 16:46:48 UTC
We have the following xquery code to define scope for different sentence. The intension here is to make sure every StringIncludeMatch pair are in different sentences unless the two pair is identical. The XQuery code uses '$stringInclude1 = $stringInclude2' xquery general comparsion to make the two StringInclude matches are identical. The comparsion requires xquery atomization fn:data() to apply on $stringInclude1 and $stringInclude2. However, the problem is that $stringInclude1 and $stringInclude2 are of fts:stringMatch type which is a complex type with element-only. So this will cause it to raise FOTY0012. In any case, the proper way to avoid this issue is to do use 'is' xquery operator as '$stringInclude1 is $stringInclude2'. Same issue exists for ApplyFTScopeDifferentParagraph() func
declare function fts:ApplyFTScopeDifferentSentence (
      $allMatches as element(fts:allMatches) ) 
   as element(fts:allMatches) 
{
   <fts:allMatches stokenNum="{$allMatches/@stokenNum}">
   {
      for $match in $allMatches/fts:match
      where every $stringInclude1 in $match/fts:stringInclude,
                  $stringInclude2 in $match/fts:stringInclude  
            satisfies $stringInclude1 = $stringInclude2
                  or $stringInclude1/fts:tokenInfo/@endSent <
                     $stringInclude2/fts:tokenInfo/@startSent
                  or $stringInclude2/fts:tokenInfo/@endSent <
                     $stringInclude1/fts:tokenInfo/@startSent
Comment 1 Mary Holstege 2008-03-17 19:36:37 UTC
Agreed.  Fixed as proposed. Please close this bug if you are satisfied with
the resolution.
Comment 2 zhen hua liu 2008-03-17 21:34:15 UTC
ok with the resolution.