W3C home > Mailing lists > Public > public-qt-comments@w3.org > March 2008

[Bug 5574] ApplyFTScopeDifferentSentence/Para usage of general comparison is not right

From: <bugzilla@wiggum.w3.org>
Date: Fri, 14 Mar 2008 16:46:48 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1JaD3Q-0002bp-Lv@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5574

           Summary: ApplyFTScopeDifferentSentence/Para usage of general
                    comparison is not right
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Full Text 1.0
        AssignedTo: jim.melton@acm.org
        ReportedBy: zhen.liu@oracle.com
         QAContact: public-qt-comments@w3.org


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
Received on Friday, 14 March 2008 16:47:22 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:36 UTC