I've read around that XHTML 4.01 does not has the data- attribute. Unfortunately my class calls for the use of XHTML. I need to embed a twitter widget and it works however the site won't validate.
a class="twitter-timeline" href="https://twitter.com/row2k" data-widget-id="654806159795183617">Tweets by #row2k</a>
Can anyone help assign the "data-widget-id" another way so that the widget will run as well as validate?
If you're not using any entity references such as (or if you can replace them all by numeric references like ), you can use the <!DOCTYPE html> header and then it will work AND validate.
By the way, there is no such thing as XHTML 4.01; You meant XHTML 1.0 surely, the equivalent of HTML 4.01.
What are the implications of using the xml: namespace? I'm talking about the difference between xml:lang and lang, and also xml:id and id. Should I prefer using xml: when writing XHTML documents? How compatible is it?
The W3C spec says to use both variants for XHTML documents, noting that the xml: prefixed one will take precedence.
For xml:lang and lang in particular read this one line text:
http://www.w3.org/TR/xhtml1/#C_7
Say that you have a XHTML document in English but it has accented characters (e.g. meta name="author" content="José"). Let's say you have no control over the HTTP headers.
Should the characters be replaced for their corresponding named entities (e.g. á, etc)?
Should the xml:lang attribute be set to English?
I know I can check the W3C recommendation but I am asking more from a practical point of view.
Should the characters be replaced for their corresponding named entities (e.g. á, etc)?
Since you can't control the HTTP headers (and thus the declared character encoding) you should encode everything using ASCII (since it is a safe subset of just about everything).
This will require that you use entities for anything that isn't in ASCII. Named ones are preferred (as they are easier for people editing the HTML to handle) but not required.
Should the doc type and the xml:lang attribute be set to English?
The EN in the Doctype is a reference to the language that the comments in the DTD are written in. The HTML 3.x / 4.x and XHTML 1.x Doctypes must always use EN.
The lang attribute (and additionally the xml:lang attribute) should specify the language that the content is written in. If that is English, then it should be English.
Looks like I kind of missed the point, so here's the answer, and following up is the rant on encodings.
xml:lang="en" doesn't forbid you from using any character you want, it's only metadata for use by browser, search engines, accessibility software, etc. If you page is in English, then go ahead, write it.
As of diacritics, HTML supports both directly writing the character or writing the entity, both in attributes and in text nodes (and possibly in node names too, but I'm not sure; anyways, that's not going to happen with HTML). However, it's easier in my opinion to use UTF-8 everywhere than to escape entities; and there are like 4 ways to set the encoding of a page, so it would be hard to believe that, in a practical case, you can't do it.
From a practical point of view, being a French speaker with diacritics in my first name, I find it is a MAJOR annoyance (and markdown won't let me stress MAJOR enough) when websites don't support accentuated letters. Even if you set xml:lang to English, it's not going to solve this problem.
I recommend that you use UTF-8 because it is backwards-compatible with ASCII and it can encode every UCS character. If you have no control over the HTTP headers, you still have two options: the XML declaration, and the meta tag.
If I recall correctly, if you get an XML document, the encoding "attribute" in the <?xml?> tag has precedence. This is your first solution, but it's probably not supported by legacy browsers.
<?xml encoding="UTF-8"?>
Your other option, and by far better supported, is to use the meta tag to tell the browser about the encoding. In HTML4-, you can use this:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
In HTML5+, you can use this simpler form:
<meta charset="UTF-8">
Since you use XHTML, you'll want to self-close these (and use the appropriate application/xhtml+xml MIME type in the Content-Type <meta> tag).
Is there a validated alternative to using role for XHTML 1.0 strict?
For example,
Thanks.
No. There isn't (assuming you want to stay within XHTML 1.0).
You can use the rel attribute as a substitute for the role attribute.
This question applies to WordPress, but maybe someone knows if it applies universally?
Is there a proper mime-type (type attribute) for this... ?
<link rel="pingback" type="WHICH-TYPE/HERE?" href="http://www.example.com/xmlrpc.php" />
Something tells me it may be text/xml, but I'd rather not guess if someone knows the right answer.
EDIT:
I am reading here that including a link rel pingback in your <head> is discouraged...
According to the specs ( http://www.hixie.ch/specs/pingback/pingback ), you don't need to specify a type attribute.
Presumably because it doesn't send any content.