470,815 Members | 1,136 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

Why xml:lang instead of lang?

What was the reason to introduce a new attribute "xml:lang"
instead of "lang"? This bothers both authors and browsers
in different language versions: HTML 4, XHTML 1.0, XHTML 1.1.
HTML has only "lang"; XHTML 1.1 has only "xml:lang";
XHTML 1.0 has both!

For example, Mozilla 1.7 recognizes the lang attribute
http://www.unics.uni-hannover.de/nht...-attribute.htm
but it does not recognize the xml:lang attribute.
http://www.unics.uni-hannover.de/nht...ttribute.xhtml

What do we gain from "xml:lang"?

Mar 31 '06 #1
12 1587


Andreas Prilop wrote:
What was the reason to introduce a new attribute "xml:lang"
instead of "lang"? What do we gain from "xml:lang"?


By putting the attribute in the general and predefined namespace
http://www.w3.org/XML/1998/namespace it can be used by any XML
application (e.g. XHTML, SVG) without any further effort and without any
danger of colliding with attributes in no namespace a particular XML
application might want to define.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Mar 31 '06 #2
Andreas Prilop wrote:
What was the reason to introduce a new attribute "xml:lang"
instead of "lang"?


Since it is useful to have a means of describing language in the core
of XML.

It only looks silly from an (X)HTML-centric viewpoint.

--
David Dorward
http://dorward.me.uk/

Mar 31 '06 #3
In article <Pi*************************************@s5b004.rr zn.uni-hannover.de>,
Andreas Prilop <nh******@rrzn-user.uni-hannover.de> wrote:
What was the reason to introduce a new attribute "xml:lang"
instead of "lang"? This bothers both authors and browsers
in different language versions: HTML 4, XHTML 1.0, XHTML 1.1.
HTML has only "lang"; XHTML 1.1 has only "xml:lang";
XHTML 1.0 has both!


XML has always had xml:lang, XHTML gets it because it's XML.

-- Richard
Mar 31 '06 #4
Andreas Prilop wrote:
What was the reason to introduce a new attribute "xml:lang"
instead of "lang"? This bothers both authors and browsers
in different language versions: HTML 4, XHTML 1.0, XHTML 1.1.
HTML has only "lang"; XHTML 1.1 has only "xml:lang";
XHTML 1.0 has both!

For example, Mozilla 1.7 recognizes the lang attribute
http://www.unics.uni-hannover.de/nht...-attribute.htm
but it does not recognize the xml:lang attribute.
http://www.unics.uni-hannover.de/nht...ttribute.xhtml

What do we gain from "xml:lang"?


xml:lang is not a 'new' attribute. It's part of the XML1.0 specification
which predates XHTML. XHTML1.0 tries to be compatible with HTML4.01 and
supports the lang attributes and you should use both, if you want to be
compatiable with tag-soup parsers. But by being XML it also inherited
xml:lang. Using xml:lang has the advantage that this is (or could be)
recognized by any XML processing tool that needs this information (e.g.
spellcheckers) but does not have knowledge of the XHTML semantics (so it
does not understand 'lang').
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
Mar 31 '06 #5
Andreas Prilop wrote:
What was the reason to introduce a new attribute "xml:lang"
instead of "lang"? This bothers both authors and browsers
in different language versions: HTML 4, XHTML 1.0, XHTML 1.1.
HTML has only "lang"; XHTML 1.1 has only "xml:lang";
XHTML 1.0 has both!

For example, Mozilla 1.7 recognizes the lang attribute
http://www.unics.uni-hannover.de/nht...-attribute.htm
but it does not recognize the xml:lang attribute.
http://www.unics.uni-hannover.de/nht...ttribute.xhtml


I can reproduce this with FF1.5 - I'd say, it's time for a bugreport ;)

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
Mar 31 '06 #6
On Fri, 31 Mar 2006, Benjamin Niemann wrote:
For example, Mozilla 1.7 recognizes the lang attribute
http://www.unics.uni-hannover.de/nht...-attribute.htm
but it does not recognize the xml:lang attribute.
http://www.unics.uni-hannover.de/nht...ttribute.xhtml


I can reproduce this with FF1.5 - I'd say, it's time for a bugreport ;)


Bug #234485 at http://bugzilla.mozilla.org/

Mar 31 '06 #7
Andreas Prilop wrote:
What was the reason to introduce a new attribute "xml:lang"


You've had lots of answers in comp.text.xml

Please do NOT multipost.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Mar 31 '06 #8
David Dorward wrote:
You've had lots of answers in comp.text.xml
This is comp.text.xml
Please do NOT multipost.


AFAICS it was a crosspost, not a multipost.
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
Mar 31 '06 #9
Johannes Koch wrote:
AFAICS it was a crosspost, not a multipost.


err... whoops, so it was.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Mar 31 '06 #10
"David Dorward" <do*****@gmail.com> wrote:
Since it is useful to have a means of describing language in the core
of XML.


But why would that be particularly useful as compared with other features
that could have been included into the "core"? Why don't we have
xml:dir (for text directionality), too, for example?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Mar 31 '06 #11
In article <Xn*****************************@193.229.4.246>,
Jukka K. Korpela <jk******@cs.tut.fi> wrote:
But why would that be particularly useful as compared with other features
that could have been included into the "core"? Why don't we have
xml:dir (for text directionality), too, for example?


That would be rather different: xml:lang describes the content itself,
not how it should be presented. But I'm not sure why xml:lang was
deemed important enough to include.

-- Richard
Mar 31 '06 #12
Andreas Prilop wrote:
What was the reason to introduce a new attribute "xml:lang"
instead of "lang"? This bothers both authors and browsers
in different language versions: HTML 4, XHTML 1.0, XHTML 1.1.
HTML has only "lang"; XHTML 1.1 has only "xml:lang";
XHTML 1.0 has both!


XHTML 1.0 could be read as invalid HTML markup if sent with the
text/html content-type, maybe this is why there are these to differents
lang attributes ? One for SGML based markup, one for XML based markup.

The compatibility guidelines of the XHTML 1.0 recommandation tells
something that make me think this :
http://www.w3.org/TR/xhtml1/#C_7
Apr 3 '06 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by lucanos | last post: by
reply views Thread by Andreas Prilop | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.