﻿<?xml version="1.0" encoding="UTF-8"?>
<testCaseDescription xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/" id="sc3.1.1_l1_002" xml:lang="en" xsi:schemaLocation="http://bentoweb.org/refs/TCDL1.1 http://bentoweb.org/refs/schemas/tcdl1.1.xsd http://purl.org/dc/elements/1.1/ http://dublincore.org/schemas/xmls/simpledc20021212.xsd http://www.w3.org/1999/xhtml http://www.w3.org/2004/07/xhtml/xhtml1-strict.xsd http://www.w3.org/1999/xlink http://bentoweb.org/refs/schemas/xlink.xsd" xmlns="http://bentoweb.org/refs/TCDL1.1">
  <!--
 Copyright &#169; BenToWeb Consortium 2004-2007

 Licensed under the BenToWeb License, Version 1.0 (the "License"); you may
 not use this file except in compliance with the License. You may obtain
 a copy of the License at http://bentoweb.org/refs/LICENSE.html

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
  <formalMetadata>
    <description>A page with the first few sentences of Theodor Fontane's novel "Effi Briest", in German. 
      The <html:code>html</html:code> element has a <html:code>lang</html:code> with the value "en" (English) and an <html:code>xml:lang</html:code> attribute with the value "de" (German).
    </description>
    <title>Correct <html:code>xml:lang</html:code> and incorrect <html:code>lang</html:code> attribute for primary language of content in German</title>
    <dc:creator>Christophe.Strobbe@esat.kuleuven.be</dc:creator>
    <dc:language>en</dc:language>
    <dc:rights>Copyright BenToWeb 2005-2007</dc:rights>
    <date>2005-09-01</date>
    <status>accepted QA</status>
  </formalMetadata>
  <technology>
    <recommendation xlink:href="http://www.w3.org/TR/xhtml1/">
      <label>
        <html:acronym>XHTML</html:acronym>™ 1.0 The Extensible HyperText Markup Language (Second Edition)</label>
      <testElements>
        <testElement>
          <elementName localname="lang" namespace="http://www.w3.org/1999/xhtml" />
          <specReference xlink:href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/dirlang.html#adef-lang">Specifying the language of content: the <html:code>lang</html:code> attribute</specReference>
        </testElement>
      </testElements>
    </recommendation>
  </technology>
  <testCase complexity="atomic">
    <purpose>
      <p>This test case is intended to fail because the primary natural language of the content is not correctly identified: the language information is contradictory. 
        Only the primary language is tested, not language changes inside the content.
      </p>
    </purpose>
    <expertGuidance>
      <p>This test case can be evaluated automatically when using a test tool with reliable automatic language recognition for both German and English, support for <html:code>lang</html:code> and <html:code>xml:lang</html:code> attributes and language tags.</p>
    </expertGuidance>
    <requiredTests>
      <testModes>
        <testMode>automatic</testMode>
      </testModes>
    </requiredTests>
    <files>
      <file xlink:href="../testfiles/sc3.1.1_l1_002.html" hrefLang="de" />
    </files>
  </testCase>
  <rules>
    <rule id="http://bentoweb.org/refs/rulesets.xml#WCAG2_20060427_3.1_meaning-doc-lang-id" primary="yes">
      <locations expectedResult="fail">
        <location line="3" column="44" xpath="/:html/@xml:lang" />
        <location line="3" column="58" xpath="/:html/@lang" />
      </locations>
      <functionalOutcome>
        <p>The browser may not be able to find the primary language of the document.</p>
      </functionalOutcome>
      <techComment>
        <p>This test case maps to technique H57: Using the lang attribute of the html element (http://www.w3.org/TR/2006/WD-WCAG20-TECHS-20060427/Overview.html#H57).</p>
        <p>Note that when both <html:code>lang</html:code> and <html:code>xml:lang</html:code> are specified, 
          the value of <html:code>xml:lang</html:code> takes precedence: 
          see "The <html:code>lang</html:code> and <html:code>xml:lang</html:code> Attributes" in the <html:acronym>XHTML</html:acronym> specification (http://www.w3.org/TR/xhtml1/#C_7).
        </p>
        <p><html:acronym>IBM</html:acronym> Home Page Reader 3.0 German version, set to "automatic language recognition", and JAWS 7.1, German version, 
          tried to read the test file in English.
        </p>
        <p>@@ removed lang="de" from body element; @@todo create additional test case with lang="de" on body element?? or check whether this already exists.</p>
      </techComment>
    </rule>
    <rule id="http://bentoweb.org/refs/rulesets.xml#WCAG2_20050630_3.1_meaning-doc-lang-id" primary="no">
      <locations expectedResult="fail">
        <location line="3" column="44" xpath="/:html/@xml:lang" />
        <location line="3" column="58" xpath="/:html/@lang" />
      </locations>
      <functionalOutcome>
        <p>The browser may not be able to find the primary language of the document.</p>
      </functionalOutcome>
      <techComment>
        <p>The <html:code>html</html:code> element has <html:code>lang</html:code> and <html:code>xml:lang</html:code> attributes with contradictory values. Only the primary language is tested here, not language changes inside the content.</p>
      </techComment>
    </rule>
  </rules>
  <namespaceMappings>
    <namespace nsPrefix="" nsURI="http://www.w3.org/1999/xhtml" />
  </namespaceMappings>
</testCaseDescription>
