Re: [whatwg] [WA1] lang and xml:lang

2005-04-17 Thread Ian Hickson
On Sun, 17 Apr 2005, Anne van Kesteren wrote:
> >
> > [xml:lang]
> 
> I assume we are going to do something similar for 'xml:id' when that 
> becomes REC? Or do the issues with regard to type ID need to be sorted 
> out first?

Actually, I just took out the text about xml:id. I couldn't work out why 
we'd want people to use xml:id rather than ID.

For xml:lang it makes sense, because there are systems that will want to 
crawl XML documents and find stuff in certain languages, and "lang" is not 
used often so making it longer is not a huge deal. But the ID of an 
element is a meaningless string, so the benefits of making non-HTML UAs be 
able to determine an HTML element's ID doesn't seem to outweigh the 
problems (four extra characters very time "id" is used, which is a lot, 
not to mention the namespace confusion).

Also, xml:lang="" and lang="" clash. An element can't have more than one 
language. However, xml:id="" and id="" can coexist without any trouble.

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


Re: [whatwg] [WA1] lang and xml:lang

2005-04-17 Thread Anne van Kesteren
Ian Hickson wrote:
Is there any reason for not making that "must not"?  The only
reason someone would ever have for using lang instead of xml:lang
in XHTML is when serving it as text/html, which is strictly
forbidden in this version.  It should be stated that lang is for
HTML only and xml:lang is for X(HT)ML only.
Done.

I think the heading for the attribute defintion should be updated
to include xml:lang as well.
Done.
I assume we are going to do something similar for 'xml:id' when that 
becomes REC? Or do the issues with regard to type ID need to be sorted 
out first?

--
 Anne van Kesteren
 


Re: [whatwg] [WA1] lang and xml:lang

2005-04-17 Thread Ian Hickson
On Sun, 17 Apr 2005, Lachlan Hunt wrote:
> > > 
> > > # If both the xml:lang attribute and the lang attribute are set, user
> > > # agents must use the xml:lang attribute, and the lang attribute must be
> > > # ignored for the purposes of determining the element's language.
> > > 
> > > Is that the case for both HTML and XHTML documents?
> > 
> > Yes.
> 
> So, if I have this HTML document
> 
>   
>   
>   HTML document
>   This is an HTML, not an XML, document.
> 
> Considering that legacy HTML UAs won't know about the xml:lang 
> attribute, and will only use lang, are you saying that a conforming Web 
> Apps UA should treat the document as french?

No. The "xml:lang" attribute in that document is not the xml:lang 
attribute. It's the {null, "xml:lang"} attribute -- the attribute in the 
null namespace with the local name "xml:lang" -- whereas the xml:lang 
attribute, the one defined by XML, is the {xml, "lang"} attribute: the 
attribute in the XML namespace with the local name "lang".

See Namespaces in XML for more information.



> > > It would make more sense if, in the case of both being set, lang was 
> > > used for text/html documents and xml:lang for XML documents.
> > 
> > The only way you can set xml:lang in an HTML document is via the DOM
> 
> Now I'm confused.  If that's the case, then wouldn't the above example 
> be treated as english [...]

Yes.


> > (in HTML, there are no namespaces).
> 
> Which is why xml:lang should be completely ignored, as an unknown 
> attribute, in HTML.

If there is a literal "xml:lang" attribute in an HTML document, it is 
ignored and has no effect on this conformance requirement. That, however, 
is not an xml:lang attribute.

Since this is clearly a source of confusion, I've added a paragraph to the 
Terminology section about this.


> I've seen people use lots of XML syntax in HTML documents, including 
> xmlns and xml:lang attributes even in one that had an explicit HTML4 
> DOCTYPE (though I can't remember where) and not just in MS Word 
> generated rubbish.  The point is authors do a lot of silly things, and I 
> thought UA behaviour needed to be well defined for as many use cases as 
> possible.

Absolutely. However none of the cases you mentioned result in the 
existence of a "lang" attribute in the XML namespace. They result in 
unknown attributes in the null namespace, which is very different.


> > > However, in the case of only one being set but for the wrong MIME 
> > > type (eg. xml:lang set for text/html document or lang for XML 
> > > document), for error recovery, should UAs be allowed to fallback on 
> > > it?
> > 
> > If xml:lang="" is set onin a text/html document, it'll be {html, 
> > 'xml:lang'}, not {xml, 'lang'} which is what xml:lang really is.

(Er, I should have said {null, 'xml:lang'}, not {html, 'xml:lang'}.)

> I don't understand how that answers the question.

I hope this e-mail clarifies it for you.

Cheers,
-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


Re: [whatwg] [WA1] lang and xml:lang

2005-04-17 Thread Lachlan Hunt
Ian Hickson wrote:
On Sun, 17 Apr 2005, Lachlan Hunt wrote:
# If both the xml:lang attribute and the lang attribute are set, user
# agents must use the xml:lang attribute, and the lang attribute must be
# ignored for the purposes of determining the element's language.
Is that the case for both HTML and XHTML documents?
Yes.
So, if I have this HTML document
  
  
  HTML document
  This is an HTML, not an XML, document.
Considering that legacy HTML UAs won't know about the xml:lang 
attribute, and will only use lang, are you saying that a conforming Web 
Apps UA should treat the document as french?

It would make more sense if, in the case of both being set, lang was 
used for text/html documents and xml:lang for XML documents.
The only way you can set xml:lang in an HTML document is via the DOM
Now I'm confused.  If that's the case, then wouldn't the above example 
be treated as english, regardless of the xml:lang attribute in the source?

(in HTML, there are no namespaces).
Which is why xml:lang should be completely ignored, as an unknown 
attribute, in HTML.

I don't think it's worth having special requirements for something
that no-one is likely to ever do outside of obscure test cases.
I've seen people use lots of XML syntax in HTML documents, including 
xmlns and xml:lang attributes even in one that had an explicit HTML4 
DOCTYPE (though I can't remember where) and not just in MS Word 
generated rubbish.  The point is authors do a lot of silly things, and I 
thought UA behaviour needed to be well defined for as many use cases as 
possible.

However, in the case of only one being set but for the wrong MIME type 
(eg. xml:lang set for text/html document or lang for XML document), for 
error recovery, should UAs be allowed to fallback on it?
If xml:lang="" is set onin a text/html document, it'll be {html, 
'xml:lang'}, not {xml, 'lang'} which is what xml:lang really is.
I don't understand how that answers the question.
--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox


Re: [whatwg] [WA1] lang and xml:lang

2005-04-17 Thread Ian Hickson
On Sun, 17 Apr 2005, Lachlan Hunt wrote:
> 
> # If both the xml:lang attribute and the lang attribute are set, user
> # agents must use the xml:lang attribute, and the lang attribute must be
> # ignored for the purposes of determining the element's language.
> 
> Is that the case for both HTML and XHTML documents?

Yes.


> It would make more sense if, in the case of both being set, lang was 
> used for text/html documents and xml:lang for XML documents.

The only way you can set xml:lang in an HTML document is via the DOM (in 
HTML, there are no namespaces). I don't think it's worth having special 
requirements for something that no-one is likely to ever do outside of 
obscure test cases.


> However, in the case of only one being set but for the wrong MIME type 
> (eg. xml:lang set for text/html document or lang for XML document), for 
> error recovery, should UAs be allowed to fallback on it?

If xml:lang="" is set onin a text/html document, it'll be {html, 
'xml:lang'}, not {xml, 'lang'} which is what xml:lang really is.

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


Re: [whatwg] [WA1] lang and xml:lang

2005-04-17 Thread Lachlan Hunt
Ian Hickson wrote:
On Sun, 17 Apr 2005, Lachlan Hunt wrote:
It should be stated that lang is for HTML only and xml:lang is 
for X(HT)ML only.
Done.
Thank you, but now there's just one more issue.
# If both the xml:lang attribute and the lang attribute are set, user
# agents must use the xml:lang attribute, and the lang attribute must be
# ignored for the purposes of determining the element's language.
Is that the case for both HTML and XHTML documents?  It would make more 
sense if, in the case of both being set, lang was used for text/html 
documents and xml:lang for XML documents.

However, in the case of only one being set but for the wrong MIME type 
(eg. xml:lang set for text/html document or lang for XML document), for 
error recovery, should UAs be allowed to fallback on it?

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox


Re: [whatwg] [WA1] lang and xml:lang

2005-04-17 Thread Ian Hickson
On Sun, 17 Apr 2005, Lachlan Hunt wrote:
>
> Web apps currently states [1]:
> # Authors should not use the lang attribute in XML documents. Authors
> # should instead use the xml:lang attribute.
> 
> Is there any reason for not making that "must not"?  The only reason 
> someone would ever have for using lang instead of xml:lang in XHTML is 
> when serving it as text/html, which is strictly forbidden in this 
> version.  It should be stated that lang is for HTML only and xml:lang is 
> for X(HT)ML only.

Done.

> I think the heading for the attribute defintion should be updated to include
> xml:lang as well.

Done.

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


[whatwg] [WA1] lang and xml:lang

2005-04-16 Thread Lachlan Hunt
Hi,
Web apps currently states [1]:
# Authors should not use the lang attribute in XML documents. Authors
# should instead use the xml:lang attribute.
Is there any reason for not making that "must not"?  The only reason 
someone would ever have for using lang instead of xml:lang in XHTML is 
when serving it as text/html, which is strictly forbidden in this 
version.  It should be stated that lang is for HTML only and xml:lang is 
for X(HT)ML only.

I think the heading for the attribute defintion should be updated to 
include xml:lang as well.

[1] http://www.whatwg.org/specs/web-apps/current-work/#lang
--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox