I am developing an appplication based on Mozilla XULRunner.
I am using the xhmtl1-strict.xsd provided by the W3C to fetch the attribute. Now the requirement came to add the <video> tag to my application, but my application is not supporting any HTML5 elements or attributes.
So, any suggestions?
HTML5 does not have a doctype definition or an XML schema definition. This is because, although it shares the same syntax as its predecessor HTML 4, HTML5 itself is neither based on SGML nor XML. It's a markup language in its own right.
If you are looking to implement a browser with HTML5 capabilities using Mozilla technologies, the latest version of the Gecko layout engine supports HTML5. Get the Gecko/XULRunner SDK here.
The packages at http://www.xmlmind.com/xmleditor/download.shtml contain a file addon/config/xhtml/xsd/5.0/xhtml5.xsd which seems to be licensed as open source .
There is an HTML5 DTD which is used in the XML Catalog of Komodo, which is an XULRunner application. It can also be used in Eclipse without being converted to an XSD. In addition, there are style sheet and regex based DTD2XSD converters available.
To validate XHTML5, use the schema from v.Nu.
For details, see:
https://github.com/unsoup/validator
Related
The "old" HTML/XHTML standards have a DTD (Document Type Definition) defined for them:
HTML 4.01 http://www.w3.org/TR/html401/sgml/dtd.html
XHTML 1.0 http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Strict
This DTDs specify the rules for nesting elements - "which types of elements may appear in which types of elements". I made a diagram for XHTML 1.0 here (sorry, I no longer have that resource)
I would like to update that diagram with a new version which also includes the new HTML5 elements. However, there doesn't seem to be a HTML5 DTD. It seems that the nesting rules are defined by the various content models that are defined in HTML5.
So there is no DTD, correct?
Follow-up question: Is there a reason why there is no DTD in HTML5? The DTD is such a nice method of defining the nesting rules for all the different types of elements. Why wouldn't they include such a thing?
Update: I found this: http://www.w3.org/TR/html5/dom.html#kinds-of-content I guess, this is the closest to having a DTD.
Update: The Visual Studio Team made a XML Schema for XHTML5. I guess that answers my question: Link
There is no HTML5 DTD. The HTML5 RC explicitly says this when discussing XHTML serialization, and this clearly applies to HTML serialization as well.
DTDs have been regarded by the designers of HTML5 as too limited in expressive power, and HTML5 validators (basically the HTML5 mode of http://validator.nu and its copy at http://validator.w3.org/nu/) use schemas and ad hoc checks, not DTD-based validation.
Moreover, HTML5 has been designed so that writing a DTD for it is impossible. For example, there is no SGML way to capture the HTML5 rule that any attribute name that starts with “data-” and complies with certain general rules is valid. In SGML, attributes need to be listed individually, so a DTD would need to be infinite.
It is possible to design DTDs that correspond to HTML5 with some omissions and perhaps with some extra rules imposed, but they won’t really be HTML5 DTDs. My experiment with the idea is not very encouraging: too many limitations, too tricky, and the DTD would need to be so permissive that many syntax errors would go uncaught.
Correct. There is no DTD. However, HTML5 documents should start with <!DOCTYPE html>
So there's a DOCTYPE, but no DTD.
See:
http://dev.w3.org/html5/spec/syntax.html#the-doctype
http://en.wikipedia.org/wiki/Document_Type_Declaration#HTML5_DTD-less_DOCTYPE
I have created an HTML5 DTD for use in my PHP XML projects. It ain't beautiful, but it works with well-formed XHTML5 (that is, HTML5 expressed as XML).
You can grab it from my bitbucket account here:
https://bitbucket.org/kashbridge/dtd/overview
Enjoy!
Certain Marcus from sgmljs.net created and analyzed an SGML DTD for HTML 5.1 and started a thread in the XML-DEV mailing list for review and discussion. The discussion revolves around entity definitions so far.
I've just completed my analysis of W3C's HTML 5.1 recommendation at
http://sgmljs.net/docs/html5.html (from a markup language rather than
web development PoV), and I'm publishing it here for review in the
form of an initial SGML DTD for parsing HTML 5.1, along with a lengthy
analysis text.
[…]
I'm aware that WHATWG and W3C have since long moved away from SGML
(and XML in most web-related specification work), treating it as a
legacy technique and with a somewhat presumptuous attitude in the
specification text and elsewhere. But as the analysis of HTML5's
grammar shows, they've essentially abandoned use of any formal methods
alltogether (and it shows in at least two flaws discussed in the
analysis).
Nothing official yet, but maybe this initiative will get traction, or at least find its users as an unofficial resource.
I think they did away with the old DTDs, now we just start HTML pages with: <!DOCTYPE HTML>
Maybe the W3C will come out with one eventually.
Do my web pages need to be written in HTML5 to use the Data Highlighter? Do my web pages need to be written in HTML5 to use the Schema.org Microdata?
Not sure about the Data Highlighter, but yes, in order to use Microdata (whether with schema.org or any other vocabulary) you need to use HTML5. Microdata was originally part of HTML5 (it was removed from the spec some time ago, and now exists separately, but is still only valid in HTML5).
However you can still use schema.org in non-HTML5 web pages by embedding it using RDFa or JSON-LD instead of Microdata. And obviously you can also use RDFa and JSON-LD in HTML5 web pages as well.
I am thinking how KnockoutJs or AngulasJs type of frameworks allow us to add new Attributes, Elements etc in our HTML Code? How does the compiler at runtime allows these frameworks.
The only thing I can think of is that these frameworks have their custom DTD loading on the HTML page, but I can't see any reference to any DTD in html code.
Any suggestion how should I proceed?
As Kevin notes, custom attributes are legal in HTML5 if they start with -data.
You can put attributes that do not start with -data on an element, and modern browsers will not care, even though they are not valid per-spec. They will not have any effects, but they will not be removed. Javascript can then identify nodes that have them, and add behavior however they need to.
Custom Elements are also legal in modern browsers. In older version of Internet Explorer they can be defined using document.createElement. Knockout uses this method.
I like to publish contont in both RDF format and HTML formats. So, there is a specific encoding for HTML with RDFa. Yet there are so many benefits to HTML5 that I like. But there is no mechanism for specifying RDFa within HTML5. Are there any solutions to this problem?
Thanks,
Bruce
See http://dev.w3.org/html5/rdfa/
Are we allowed to extend HTML5 with new tags like <foo:bar> in HTML5?
I ask because the Facebook API includes just this kind of thing**, and our pages are defined as HTML5.
More specifically, is it possible to make a HTML5-conformant page that uses fb:fbml?
Strictly speaking, no. You can have JavaScript code write the FBML which gets around any potential validation issues, but it's bad form.
That aside, even if you could, you don't want to make a page that uses FBML. FBML will be deprecated on Jan 1, 2012 and after June 1, 2012 FBML will no longer work.
Source: https://developers.facebook.com/docs/reference/fbml/
No you are not allowed to create your own tags in HTML5, this could result in conflicts and defeats the purpose of having a standard.
Per W3 you can add an xml mime type of application/xhtml+xml if you would like to serve up xhtml5. Facebook is serving up XHTML and this is why they can use custom namespaces.
http://www.w3.org/TR/html5-diff/#syntax
So, yes would be valid XHTML5 but not HTML5.
More discussions on SO:
Facebook Connect and HTML5, xmlns available?
Use XHTML(5). XML allows namespaces, and XHTML(5) is an extension of XML, so therefore, it allows namespaces, while HTML(5) does not.
As Jeff Sherlock said, you don't want to use FBML anymore as it will be deprecated. Pages now use Apps, which you can have linked to a website. So now you just create a page on your website (width 520px or less), and attach the page to your app. You can just Javascript, HTML, CSS, jQuery, etc. - just about anything, including HTML5. Much easier to create tabs and all sorts of things on FB now.
You can create your own elements; you do it the same way that Facebook does. Create your own doctype with a custom namespace, but you won't be outputting HTML5, you'll be outputting XHTML5. Plus, I'd follow the other gents recommendations about straying from the standards... Friends don't let friends.