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 10797 - Expected result for K2-NodeLangFunc-2 is wrong
Summary: Expected result for K2-NodeLangFunc-2 is wrong
Status: CLOSED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.3
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Benjamin Nguyen
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-28 21:03 UTC by Sorin Nasoi
Modified: 2010-10-07 11:03 UTC (History)
1 user (show)

See Also:


Attachments

Description Sorin Nasoi 2010-09-28 21:03:26 UTC
The expected result for test  

http://dev.w3.org/2006/xquery-test-suite/TestSuiteStagingArea/Queries/XQuery/Functions/NodeFunc/NodeLangFunc/K2-NodeLangFunc-2.xq

is 'true'

http://dev.w3.org/cvsweb/~checkout~/2006/xquery-test-suite/TestSuiteStagingArea/ExpectedTestResults/Functions/NodeFunc/NodeLangFunc/K2-NodeLangFunc-2.txt?rev=1.1.1.1&content-type=text/plain

even though a single attribute node is passed as second argument of fn:lang.

Either:

1) the test can be corrected, with something like:
let $i := <e xml:lang="en">
    <b xml:lang="de"/>
</e>
return lang("de", $i/b)

or
2) the expected result should be corrected, and 'false' should be expected
Comment 1 Michael Kay 2010-09-28 22:19:08 UTC
I believe the test is correct as written.

Informally, the result is true if the nearest ancestor element of the target node that has an xml:lang attribute has @xml:lang='de'. When the target node is the attribute @xml:lang='de', the nearest ancestor having an @xml:lang attribute is its immediate parent (the <b> element), and its @xml:lang attribute is indeed "de".