Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3304680
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:05:16+00:00 2026-05-17T21:05:16+00:00

I have a doctype declaration as seen in the first 2 lines. In the

  • 0

I have a doctype declaration as seen in the first 2 lines.

In the third line, the html tag also has some xmlns declaration and xml:lang and lang. Is any of these xmlns, xml:lang, or lang repetitive? Do they duplicate anything from the doctype. I’d like to keep the doctype and remove all the declarations on the third line if they’re repetitive.

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

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:05:16+00:00Added an answer on May 17, 2026 at 9:05 pm

    They’re not repetitive. The XML namespace for XHTML and the doctype declaration aren’t the same. Neither are the xml:lang and lang attributes. The XHTML 1.0 specification requires that all of these are included.

    The attribute list for the <html> element as described by the XHTML 1.0 Strict DTD is as follows:

    <!ATTLIST html
      %i18n;
      id          ID             #IMPLIED
      xmlns       %URI;          #FIXED 'http://www.w3.org/1999/xhtml'
      >
    

    (where %i18n is an internal entity that represents the xml:lang, lang and dir internationalization attributes, see below)

    Notice the fourth line. It says that xmlns is an attribute of a given URI value, and is fixed at that very namespace URL. That means if you omit the attribute or give it a different namespace, your document is invalid strict XHTML.

    The %i18n entity corresponds to these attributes:

    <!-- internationalization attributes
      lang        language code (backwards compatible)
      xml:lang    language code (as per XML 1.0 spec)
      dir         direction for weak/neutral text
    -->
    <!ENTITY % i18n
     "lang        %LanguageCode; #IMPLIED
      xml:lang    %LanguageCode; #IMPLIED
      dir         (ltr|rtl)      #IMPLIED"
      >
    

    The lang attribute is for backwards compatibility (i.e. HTML ≤ 4.01), and xml:lang is described by XML 1.0 (hence the xml namespace seen here). I’m not too sure of the exact reason why xml:lang should precede lang, but it makes sense given that XHTML is merely HTML “reworded” into XML syntax (so to speak).

    The dir attribute defaults to ltr (left-to-right text) if not specified, hence it’s not a required attribute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html xmlns=http://www.w3.org/1999/xhtml xml:lang=en
I have a html: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd> <html xmlns=http://www.w3.org/1999/xhtml>
I have a html document: <!DOCTYPE html> <html xmlns=http://www.w3.org/1999/xhtml > In it I have
I have main page that looks like this: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html
I have the following snippet: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
I have the following HTML <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html
I have an aspx page with 1 table containing 2 rows: <!DOCTYPE html PUBLIC
I have the following webform: <%@ Page Language=C# AutoEventWireup=true CodeBehind=Default.aspx.cs Inherits=TestWebApp.Default %> <!DOCTYPE html
Here is the DOCTYPE and XML declaration that I am using: <?xml version=1.0 encoding=iso-8859-1?>
i have a input tag which is non editable, but some times i need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.