E-mail List Archives
Thread: Language declaration when using XHTML+RDFa 1.0
Number of posts in this thread: 3 (In chronological order)
From: Steve Green
Date: Tue, Jul 30 2013 5:08PM
Subject: Language declaration when using XHTML+RDFa 1.0
No previous message | Next message →
One of our clients has asked us to test a website where the doctype is XHTML+RDFa 1.0. There was no language declaration in the <html> element but the W3C online HTML validator does not permit the lang="en" attribute that we would usually use.
I have tried to understand the XHTML+RDFa 1.0 specification but it's heavy going. The validator does allow xml:lang="en", so is this sufficient or do we need something more? Any help would be greatly appreciated.
I think this is the first website we have tested in more than 10 years that has this doctype. Is it common and why would anyone use it?
Regards,
Steve Green
Managing Director
Test Partners Ltd
5 Percy Street, London W1T 1DG
0800 612 2780 (switchboard)
07957 246 276 (mobile)
020 7692 5517 (fax)
Skype: testpartners
= EMAIL ADDRESS REMOVED =
www.testpartners.co.uk
From: Jukka K. Korpela
Date: Wed, Jul 31 2013 12:05AM
Subject: Re: Language declaration when using XHTML+RDFa 1.0
← Previous message | Next message →
2013-07-31 2:08, Steve Green wrote:
> One of our clients has asked us to test a website where the doctype
> is XHTML+RDFa 1.0. There was no language declaration in the <html>
> element but the W3C online HTML validator does not permit the
> lang="en" attribute that we would usually use.
XHTML+RDFa 1.0 does not allow the lang attribute, and the validator just
reports this.
> I have tried to understand the XHTML+RDFa 1.0 specification but it's
> heavy going.
It is based on XHTML 1.1, with element-level metadata features as per
RDFa added into it.
> The validator does allow xml:lang="en", so is this
> sufficient or do we need something more?
The lang attribute might be somewhat more widely recognized then
xml:lang, by relevant software. This is at least the idea behind the
XHTML 1.0 rule that allows both to be used.
XHTML 1.1 is largely a theoretical exercise: developed from XHTML 1.0
Strict (which in turn is little more/less than HTML 4.01 Strict in XML
clothes) by describing it in terms of XHTML modularization, with some
poorly documented changed.
XHTML+RDDa 1.0 removed the lang attribute. It was taken back in
XHTML+RDFa 1.1, which exists as W3C Recommendation:
http://www.w3.org/TR/2012/REC-xhtml-rdfa-20120607/
and as "W3C Proposed Edited Recommendation":
http://www.w3.org/TR/xhtml-rdfa/
So using an XHTML+RDFa 1.1 doctype you could use xml:lang="en"
lang="en", as in XHTML 1.0.
Using the lang attribute with the XHTML+RDFa 1.0 doctype is formally
invalid but does not really hurt anyone. Browsers couldn't care less.
Even when processing an XHTML document as truly XHTML (by XML rules),
when served with an XML media type, they reject the document on the
basis of well-formedness errors only, not on the grounds of using an
attribute not allowed by the document type definition.
> I think this is the first website we have tested in more than 10
> years that has this doctype. Is it common and why would anyone use
> it?
It is not used much, and there is little if any reason to use it. It's
the kind of thing that some people take into use as they wanted to
comply with the "latest version" of something at some time.
Yucca
From: Steve Green
Date: Wed, Jul 31 2013 11:44AM
Subject: Re: Language declaration when using XHTML+RDFa 1.0
← Previous message | No next message
Thanks Yucca - that's really helpful.
Steve