twitter widget won't validate - css

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.

Related

Changing doctype from XHTML to HTML5

I have a .NET Master page with an XHTML DTD: !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional ... >.
My .NET .ascx input controls need to start using the HTML5 placeholder attribute. It's my understanding that browsers won't recognize placeholder unless the HTML5 DTD is used: <!DOCTYPE html>.
I'm leery about simply changing the Master page to use the HTML5 doctype. I've heard that the HTML5 spec is supposed to backwards support XHTML markup, but I'm wondering about any other adverse side-effects with this kind of blanket change. Does anyone have insight regarding this?
Note: Several web apps use the Master page so it would be a widespread change.
HTML5 is designed to be backwards compatible with XHTML and HTML so developers can easily migrate.
The only effect for you will be that the browser will not enforce the strict XHTML rules.
You can still follow the XHTML rules however but you aren't forced to.
So you can safely edit your doctype to the HTML5 doctype!

Updating ASP.NET project to HTML5

I have an ASP.NET 2.0 application. I would like to start enhancing it with HTML5 specific tags/features.
Does it mean that the first step is to change the line:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
at the top of each .ASPX file with
<!DOCTYPE html>
And then any HTML5 specific tag I use will be ok?
ASP.NET is mostly a server-side technology which won't have a lot to do with HTML5. You can certainly use HTML5 elements in your application, but, you will also be limited to using certain elements that are generated by the ASP.NET WebForms framework.
As an example, you could use the HTML5 DOCTYPE, <!DOCTYPE html>, or you could use the article element or data attributes. None of this really has much of an impact on the ASP.NET server-side technology.

Extending xhtml schema to support custom tags and attributes

I want to provide the xml schema for custom tags and attributes, which are extending xhtml, so that I would have auto suggest in the IDE (I am using WebStorm) for standard html tags and attributes and for my custom. The namespace should not be used, so that as in the example below the name of the element is my-custom-element, but not my:custom-element.
I have achieved this with DTD have this:
<!ENTITY % XHTML1-strict PUBLIC "-//W3C//XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/html4/strict.dtd" >
%XHTML1-strict;
<!ELEMENT my-custom-element ANY>
Is it possible to do the same using xsd?
Update:
The above example is not correct, as new custom element is auto completed only outside of html tag
Use the HTML5 DTD from Komodo, which is an extension of the XHTML DTD, as a guideline for adding new elements. There are several tools to convert DTD2XSD and XSD2DTD, such as:
dtd2xsd.xsl
dtd2xsd.pl
xsd2dtd.xsl
Custom DTD

Correct content type for html use?

I was using XHTML on my website but that completely destroyed jQuery and its plugins.
Therefore, I want to go back to html 4. I am defining some custom attributes for my html, like so:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd" [
<!ATTLIST mytag myattribute CDATA #IMPLIED>
]>
This seems to be valid html for, but when I pass such a page from my server with a content type of text/html, my browser displays ']>' - it can't parse the doctype properly.
Is there a different content type I should be using?
From A List Apart
If you run such a file through the W3C validator, you find that it
validates wonderfully well. If you download the sample files for this
article and validate file internal.html, you can see this for
yourself. Unfortunately, when you display the file in a browser, the
]> shows up on the screen. There’s no way around this bug, so this
approach is right out.
So this basically isnt going to work. To get it to work you need to copy the DTD you want the server/local machine, edit it appropriately and put it in a publically accessible place. See the article for more detail.
As far as jQuery is concerned, it should work fine if you quit trying to customize the DTD in the fashion that you are. Im not sure about using a custom DTD as I have never done it, but just adding the attributes to the elements and not defining them in the DTD shouldnt cause a problem with jq. Granted the document wont validate, but validation is just a tool and not overly important in the grand scheme of things.

Eclipse BIRT - XHTML output

Is there a way to set BIRT to output a report as XHTML (1.0 Transitional would be fine) instead of HTML?
I did a few tests and there are some elements that are not valid:head does not include a title, html must have a namespace (xmlns) attribute
Is this functionality supported at all by BIRT?
----- EDIT -----
Here are the current changes I need to make on the current HTML output produced by BIRT:
Change the doctype to xhtml transitional
Add the xmlns attribute to the html tag
Add the title element in the <head>
Set the missing end tag to the meta tag(s): </meta>
If the functionality is not supported by BIRT, how can I extend the current HTML emitter to transform the current HTML output to valid XHTML?
This is not one of the standard output formats. You should be able to extend the HTML emitter with little effort to do this yourself.
Here are some resources to get started extending BIRT:
Writing a BIRT Extension
Tutorial
Writing a custom emitter (XML in
this case)
Good Luck!

Resources