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 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
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".