Xmlns= Versus meta http-equiv=

I’m not sure why you’ve used caps on NOT or what you’ve understood reading my post.

I clearly stated this:

<html xml:lang=“en”> is for declaring what to expect as language inside the root element

Is this, in any way, leading you to believe I am saying something wrong? If so, please clarify.

When I said

Yes, the x(ht)ml markup (not programming language) can be provided in other spoken languages, aside from english.

I meant that you can create your own elements in x(ht)ml, aside from those used in html.

Like this:


<aiurea>
 <falsitate>
   transio spune ceva gre&#351;it
 </falsitate>
</aiurea> 

I’ve never seen any other markup for XHTML besides English. Further research has confirmed this… XHTML is a singular specification, and its elements and attributes are always in English.

You probably refer to HTML as XHTML. Above I gave you an example of X(HT)ML markup besides English.

And given that HTML is an English markup language, having the lang attribute specify that it’s in English would be redundant.

I think you are a little confused about the use and meaning of the lang attribute. You’re contradicting your self in this last paragraph with what you’ve said first:

AFAIK, the lang attribute on the html element does NOT reference the language of the markup, but the language of the text within the document.

Just in case, when I wrote, “He writes…” I meant the author cited in Transios’s link - The lang and xml lang Attributes and XHTML, not Transio.

<ot>XHTML doesn’t strictly have to be written in all English some of the tags could be Chinese <>Китайська мова</> or Giak characters but that’s going way off-topic and beyond the scope of the question.</ot>[FONT=Verdana][SIZE=2]

The xml:lang is for XML processors for example when the XHTML is served; ‘application/xhtml+xml’. The lang is supposedly for backwards compatibility with for older browsers or when you are serving ‘text/html’ hence why in Transitional they suggest using both.
[/SIZE][/FONT]

So are you saying if my site uses a strict doctype (as it does), then I don’t need lang=“en” but do need xml:lang=“en”?

Like so
<!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”>

Thanks,

Chris

It was to emphasize the word “not”. It wasn’t an accident.

No, that by itself is clear enough… it was the next statement that led me to believe you were saying something wrong.

Well the way you said it, the derived meaning is that XHTML nodes themselves can be written in other languages besides English. If you only mean “values” and “content”, you shouldn’t use the word “markup”, as markup also includes all nodes (element and attribute names), and is often used to exclusively reference the nodes. This is why I emphasized “NOT”. Thanks for clearing up your ambiguity.

But… the X (as in extensible) for XHTML, means exactly this: you can have HTML custom elements (that aren’t in the specs though) written in other languages. That’s mark up.

That’s what namespaces are for. They aren’t reduced to SVG, MathML. You can make your own namespace for your own DTD.

I gave an example, even. I wasn’t ambiguous, you were wrong. :slight_smile: I used the words correctly. You’re limiting the possible XHTML mark up only to the elements used in specs. That’s why I was telling you you are confusing HTML with XHTML to this regard.

I wasn’t clearing up my “ambiguity”, I was correcting your view on my sayings.

Incorrect. The “extensible” in “XML” means that the markup language is variable & extensible through creation of Schemas, and the “X” in XHTML is simply referencing that it is an HTML spec created in XML via the addition of an XSD schema. Those namespaces you’re referencing relate to an XSD schema that’s used for validation of the XML markup. Check the schema: http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd

XHTML is no more extensible than SVG - it’s s set spec. That doesn’t mean that you can’t have multiple schemas in a single document. That’s what namespace prefixes are for. But if you want to add your own markup, you’ll need a namespace for it. If you want your markup to validate in a schema-aware XML parser, you’ll need to create an XSD schema for that namespace.

The power of XML is the fact that it’s restrictive, which allows absolute consistency. If you just throw around markup without any set schematic, you might as well use JSON.

I don’t know… what to say.

Except I don’t understand where you’re going going with this or what you’re saying. I don’t see you contradicting me, I see you misconstruing my choice of words, while you beat around the bush, saying the same thing as me: X stands for extending HTML. With custom elements. That is, custom tags. That is, markup outside XHTML specs.

Honestly. :slight_smile:

But extensible means you can have in a XHTML document an element like like <schön>. A custom TAG, not in English. This is markup. It’s not plug-in. It’s inside a XHTML doc. A custom tag extending HTML, making it XHTML.

If there is no danger of confusion, I don’t have to declare a namespace for my custom elements. When relying on the default namespace, you don’t prefix EVERY html element with its namespace.

You’re again confusing a lot of things. Namespaces, like SVG, are a way to refer to other DTDs. Like SVG’s DTD: http://www.w3.org/TR/SVG/svgdtd.html.

Like I can make my own DTD. For <schön>. To extend (X)HTML. In a non-English manner. DTD and XSD aren’t mutually exclusive. And XHTML 1.0 is not pure XML. XHTML is not pure XML.

I’m saying you’re incorrect. The purpose of XHTML isn’t to create “extensible HTML”, but to create an XML-compliant version of HTML.

What you’re misinterpreting is the meaning of the “extensible” in “Extensible Markup Language”. It is not referencing the extensibility of a singular document, but of the XML language itself, in the creation of multiple schemas that can in turn be used to create documents.

XHTML is just one of those schemas.

Convergence of multiple schemas in a single document is not “extensibility”. And using more than one namespace in an XHTML doc isn’t “extension” of the XHTML.

OK Steve.

You just have to agree to disagree on this one. :slight_smile:

Is the English declaration in

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

redundant? I took out lang=“en” becuase I thought is was unnnecssary becuase it already has xml:lang=“en” and removing it removed an error on mobiready.com validator, although my site will never work on a mobile phone - pages are too long, header graphic is too large.

Thanks,

Chris

I believe this was answered fully previously. :slight_smile:

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

if you serve your page as application/xhtml+xml.

Since you probably aren’t, since you probably serve your page as text/html, the recommendation is that you use


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

since the other two attributes beside lang=“en” would be ignored in this case, would be useless. In this case, xml:lang=“en” and xmlns=“http://www.w3.org/1999/xhtml would be considered junk by the browser and discarded.

Why use them both? Because you may serve the page differently: as xhtml/xml for browsers that can understand it: FF, Ch, Op, Saf, IE9, and as text/html to browsers that can’t: IE8-.

I can understand that answer. I’ll put it backs in. I was using browsershots.org and the lynx and opera (in ubuntu) weren’t working. Putting lang=“en” back in may fix those.

Thanks Noonnope,

Chris

I’m happy you took what you need. :slight_smile:

I’m not sure what’s not working, you have to be more specific, if you want us to help you further.

I can understand that answer. I’ll put it backs in. I was using browsershots.org and the lynx and opera (in ubuntu) weren’t working. Putting lang=“en” back in may fix those.

Nothing you can see in browsershots will show you anything changing by adding in lang=“en”. However, yes, please keep lang=“en” in!

(lang settings)
is for telling search engines (or someone) what spoke/written in your text will be on your page?

Search engines maybe, screen readers for the blind and low-vision, definitely! They pronounce words, and they will either pronounce the words in your document in their default language setting, OR if you have lang=“somelanguage” then they will (should) pronounce your words in YOUR language.
So if my reader is defaulted to Dutch, and you have an English-content web site without lang=“en”, my reader will try to pronounce your English words as if they were Dutch.

But:

<meta http-equiv=“Content-Language” content=“de, fr, it”/>

Don’t list more than one. Usually a document has one main language. So your content would be “content=de” and any French or Italian words would have their OWN lang attribute:

<html lang=“de”>

<body>
<h1 lang=“fr”>Bonjour!</h1>
<p> Komisch, dass erst jetzt, wegen des Plutoniumlecks die japanische Regierung alarmiert ist. Was war die denn vorher? Freudig gespannt??</p>
<p>Im Bahnabteil: “Hör auf, mich zu diskreditieren!” “Diskredi-WAS?” <span lang=“it”>Ciao</span></p>
…</body> etc

(not my German, lawlz, just copied it).

The lang attribute should tell user agents which (human) language is used inside that tag and all of its descendants. Tags outside of that tag should default back to whatever the root element (<html>) or an overriding outside tag is set to.

I usually set both the lang in <html> and meta language tags, mostly just in case there’s a user agent who misses the <html lang=“something”> but sees the meta tag. However I am supposed to be ok with just the lang attribute on <html>.

Since I don’t use XHTML syntax, I don’t use the xml:lang one… but whenever I do have to use XHTML syntax (even though I’m never actually sending the page as XHMTL), I’ll add it in just to be goodie-nice.

And, for as long as this link still shows a broken page, here’s what real XHTML does (don’t look in IE less than 9, doens’t support): [noparse]http://blog.boyet.com/blog/javascriptlessons/javascript-using-a-constructor-without-new/[/noparse]

Notice his code isn’t great, and the page isn’t broken because he forgot the xml:lang attribute or because he was silly and used Transitional doctype (why???), but because of a missing slash.
This is why you’ll never use real XHTML. Unless you can be the most anal person in the world about your code and code perfectly, you won’t want to deal with browsers taking your mistakes at face value like they will if you tell them to.

So why not just stick to HTML4? You can convert all your <br/>'s to <br> in any decent text editor like vim.

Stomme,

Thanks for clarifying the use of lang=“en”.

On the question you have at the end, my site is on wordpress so an editor won’t work, and I have about 65 pages. It would really be a lot of work with no known benefit to go to html4. I’d like to get rid of wordpress because the few pages I have that are copy and pastes of the wordpress layout and set as an html file load quite fast. But with wordpress I can make one change to the format and it will change for all the pages - I really need that.

Thanks,

Chris

my site is on wordpress so an editor won’t work, and I have about 65 pages.

: (
Wordpress doesn’t let you open up pages in a text editor? To me, a text editor is really the one tool absolutely necessary (besides also a browser and a server) to create a web page.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
  </head>

Somebody had to say it.

Also, Steve is correct in his understanding of XHTML. Noonnope, I think you’re mistaken.

XHTML is just an XML document type. The doctype explicitly specifies which elements are permitted, so you can’t extend XHTML with arbitrary elements and have it still validate as XHTML.

XML is extensible, you can use any elements you want, and you can then write up a DTD of your own that specifies which elements are permissible in your document type, as you’ve described. But XHTML is just a reformulation of HTML in XML syntax, and is not similarly extensible without incorporating other schemas by using namespaces, as Steve said.

Hmmm…

If anyone needs a dumb translation, here it is:

The important part: “An element, other than the ones in XHTML DTD, can be used to extend (X)HTML, using namespaces.”

The English part transio overlooked: “Those elements may be specified in a completely different language than English.”

The special treatment of XHTML: “Not all XHTML docs obey the rules for valid XML documents. An XML document can be a XHTML doc as well.”

Aren’t you saying the same thing as me? I believe you’re riding the waves on somebody else’s surf board. At the same time with that person. :wink: