代码之家  ›  专栏  ›  技术社区  ›  Ufuk Hacıoğulları

为什么我从xml:lang属性得到警告?

  •  1
  • Ufuk Hacıoğulları  · 技术社区  · 14 年前

    阿普塔纳警告我说 <html> 具有xml属性xml:lang“ 这是队伍。这里怎么了?

    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    
    3 回复  |  直到 13 年前
        1
  •  1
  •   Gergő    13 年前

    你的代码很好,这是内置htmltidy验证器的缺陷

    我在这里找到了答案: https://aptanastudio.tenderapp.com/discussions/problems/3034-templates

        2
  •  1
  •   José Manuel Lucas    14 年前

    您使用了什么doctype?

    您应该选择任何XHTML有效的doctype:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    

    还有一个用于框架集…

        3
  •  0
  •   Kevin Ji    14 年前

    确保使用的是XHTML doctype,例如

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    

    也可能是Aptana无法正确识别 xml:lang 属性,但您更可能没有使用正确的doctype。