Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DTD with RFDa and XHTML 1.0 Transitional support

Is there a W3C document type available with both XHTML 1.0 transitional support and RDFa support?

I am aware of the XHTML+RDFa 1.0 (http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd) DTD but that is XHTML 1.1 which is not compatible with my current website. It seems that there is also a HTML4+RDFa 1.0 (http://www.w3.org/MarkUp/DTD/html4-rdfa-1.dtd) DTD available.

My main reason for not serving XHTML 1.1 is Internet Explorer ofcourse, although I could probably serve it as text/html for the IE users if there is no other way.

like image 787
Wolph Avatar asked Feb 23 '10 23:02

Wolph


People also ask

What is DTD in XHTML?

An XHTML DTD describes the allowed syntax and grammar of XHTML markup. Every XHTML document must start with a DTD declaration and a line of code that declares that you are starting to write XHTML code.

What are the different DTD in XHTML?

The three XHTML DTDs You can use any one of three document types for your XHTML pages: XHTML 1.0 Strict. XHTML 1.0 Transitional. XHTML 1.0 Frameset.

What is the most common XHTML DTD?

The XHTML standard defines three Document Type Definitions (DTDs). The most commonly used and easy one is the XHTML Transitional document. There are few XHTML elements and attributes, which are available in one DTD but not available in another DTD.

What is XHTML strict?

XHTML 1.0 Strict is the XML equivalent to strict HTML 4.01, and includes elements and attributes that have not been marked deprecated in the HTML 4.01 specification. As of November 2015, XHTML 1.0 Strict is the document type used for the homepage of the website of the World Wide Web Consortium.


1 Answers

I don't believe there is such a DTD, no.

HTML is becoming more and more fragmented and creating DTDs for every possible combination is not going to be practical. HTML5 is not SGML based and effectively gives up on DTDs. In future, validators are probably going to have to change so that they call in component collections like RDFa and ARIA, and indicate in their results which collections are required to allow each particular piece of mark-up to be conforming.

Unfortunately, we're really at about the transition point currently, so there's no clean solution to your problem. However, a certain amount of pragmatism will get you a long way.

Now, XHTML+RDFa 1.0 may be defined by DTD as an extension of XHTML 1.1, but it isn't actually XHTML 1.1, nor is it XHTML 1.0 transitional or strict, or indeed anything other than "XHTML+RDFa 1.0".

So you can take a pragmatic serving approach. Consider the HTML5 attitude to this. It says that anything you serve as text/html is an HTML serialization of the object model, regardless of any DOCTYPE that you declare. This is in practice what browsers do anyway.

Similarly, anything you serve with an XML content type such as application/xhtml+xml is an XML serialization. Those parts of the XML that have the xhtml namespace constitute XHTML.

So, in practice, you can serve your XHTML+RDFa 1.0 as text/html or application/xhtml+xml without any difficulty, provided that the mark-up meets the requirements for polyglot documents.

That leaves the validation. Leaving aside RDFa, is there any mark-up that you're using that's conformant XHTML 1.0 Transitional but not conformant XHTML 1.1? If so, do you care enough about perfect validation to either change these, or to back away from using RDFa? Presumably you're using RDFa for your users benefit, while validation is essentially a convenience tool for yourself.

I faced a similar situation recently, when I decided to add ARIA attributes to my XHTML 1.0 pages. I decided that Accessibility trumps Validity, and I would add the attributes and forget about ensuring my pages were 100% valid.

like image 172
Alohci Avatar answered Sep 22 '22 00:09

Alohci