Jump to content

Recommended Posts

Posted

For the past couple months I've been using

 

 

><!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" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<title>title</title>
<link rel="stylesheet" type="text/css" href="somethinghere.css" media="screen" />
</head>
<body>



</body>
</html>

 

and it's always validated fine . Now if i use xhtml 1.1 doctype, the lang="en" xml:lang="en" will fail validation. Saying Error Line 4 column 48: there is no attribute "lang".

 

Does anyone know a way around that?

Posted

Hello,

 

Taken from the W3C website Here

 

><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
 <head>
<title>Virtual Library</title>
 </head>
 <body>
<p>Moved to <a href="http://vlib.org/">vlib.org</a>.</p>
 </body>
</html>

 

Remember, that sometimes validators are not perfect and do mess up on the odd occasion.

 

Also intresting to note by googling further, I quote

 

XHTML 1.1 - This document type is essentially a reformulation of XHTML 1.0 Strict using XHTML Modules. While XHTML 1.1 looks very similar to XHTML 1.0 Strict, it is designed to serve as the basis for future extended XHTML Family document types. Its modular design makes it easier to add other XHTML modules as needed and to create and include, in one document, other markup languages.
I then went on to find that

 

lang="en" is required for the XHTML 1.0 strict Doctype but not for the XHTML 1.1 Doctype

 

but after many other searches, this should validate too!

 

><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

 

JimE

Posted

So we just have to

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

 

leave out the first lang="en" everything works fine. Wonder if that has any effect on how things are displayed. I wouldnt think so.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...