The only difference is that the first uses ° and — for character references, the second uses the easier-to-remember ° and —. Guess which page actually works and which gives you an XML parsing error.
The issue I take with some developers is that they think that, with HTML5, the doctype has become vestigial and unneeded. But it actually has a very real function when it comes to XML--which is REQUIRED when you want to mix HTML5 with any other language, such as SVG.
Last edited by Mr Initial Man; 04-14-2012 at 05:57 PM.
My statement was that the HTML5 doctype will allow you to use the standard entities. leap to assume the conversation should naturally apply to XML document: not the case. The broader point: the only doctype you need is the generic html doctype, when served as HTML.
Given that these pages are being served as XML, you're stuck using the entities defined by the XML standard in lieu of what I'd call a "distinct" doctype.
Remember, XML aims at merciless, verbose, explicit unambiguity. Anything that's not explicitly defined will naturally be invalid. The HTML-SGML family, on the other hand, is aimed at a merciful, artistic, interpretation. You can expect to be able to make mistakes, use expired tags, tags and attributes that have never been defined, and even markup that doesn't make sense and still have a document that renders 'as best it can.'
My point is that the Doctype and DTD are not needless, as the HTML5 crowd seems to be trumpeting--sure, it's vestigial in HTML pages, but with Internet Explorer FINALLY supporting XHTML, Doctypes and DTDs still have relevance.
I vaguely recall already mentioning in this thread ... And I vaguely recall you ignoring that point the first time I mentioned it. Please don't ignore the point this time.
My point is that the Doctype and DTD are not needless, as the HTML5 crowd seems to be trumpeting--sure, it's vestigial in HTML pages, but with Internet Explorer FINALLY supporting XHTML, Doctypes and DTDs still have relevance.
Sorry, and I don't mean to insult you, but your point is plain silly. Don't ignore the point that the "HTML5 doctype" is more than sufficient for everything you've suggested you need XHTML for. Plus, serving your content as something other than XML allows the browser to be more forgiving when it parses the markup.
... More to the point, I think you're misrepresenting the statements of the "HTML5 trumpeters." They're not saying doctype is useless. They're saying a "vague" doctype sufficiently accomplishes everything you need to accomplish.
And they're right. Going out on a limb here, I'd say this is the only doctype any current web development project needs:
You mean to say that you can mix SVG with HTML5 instead of XHTML5?
... Yes? If you follow the link, you'll see it's served as regular old HTML. The MIME type is text/html. There's not xml header. And the doctype is the generic html one (the "HTML5 doctype").
So in other words, everything I have learned about XML is worthless. Thanks for letting me know.
Not necessarily. You can still adhere to many XML standard to simplify markup generation and parsing in some cases. And the properties of XML are very useful, if not critical, for web services. Familiar at all with soap services?
So in other words, everything I have learned about XML is worthless. Thanks for letting me know.
Unfortunately this sort of thing happens in our industry. I remember when I was an expert on all things Perl. Then PHP came along, and Perl became insignificant. I know how demoralizing it can feel when the wealth of knowledge you've accumulated suddenly seems worthless. You need to fight to stay positive, and find the motivation to learn your craft over again. When you find that motivation, flip open the HTML5 draft and read it cover to cover to maintain your status as an expert on the latest and greatest.
Whelp. If you do any inter-application .NET coding, you'll likely find you depend a great deal on SOAP services. You won't necessarily need to be familiar with XML to take advantage, but it comes in handy to know a few things come debugging time -- or if you need (or find it easier) to hand-craft any requests for any reason.
Ooooooooooooookay, where'd you read that? Citation please.
You see, what some people don't seem to realize--right up until they work with XML--is that the Document Type Definition performs a very important function that has never been performed by anything else, not schemas, not the HTML5 doctype.
HTML Code:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY deg "°"><!ENTITY oq "“"><!ENTITY cq "”">
]>
That's an SVG 1.1 Doctype that I used in a page--but do you see something odd about it? Here's the original:
Code:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
Here's the one I used:
Code:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY deg "°">
<!ENTITY oq "“">
<!ENTITY cq "”">
]>
Character Entity References!
XHTML 1.0 links to a document type definition, which defines these,;XHTML5 does NOT, so you have to go through the effort of memorizing their numerical equivalents or skip any characters you can't type on your keyboard altogether.
Doing something like
HTML Code:
<!DOCTYPE html [<!--CERs Here-->]>
will cause the validator to throw errors, because now it's expecting the COMPLETE document type definition (I've written them. Even ElementML was surprisingly long). SVG has no character entity references, but because of its doctype's structure I was able to add some in.
HTML5's doctype doesn't allow that, and if you don't have a doctype at all, you're out of luck. Oh, I know, "You don't need a doctype" and yadda yadda yadda, but here's a point I made in my book:
√
√
√
They all amount to the same thing, but which do you want to use for writing "(X)HTML5=√(All Headaches)"?
Exactly!
First thing people should learn about HTML, is that:
>>HTML, is NOT XHTML!
and you simply haven't "recorded' a single word I was saying....
as I was making the absolutely opposite point of what you are replying to.
Look, it hadn't sunk in until Svidgen explained it to me that SVG could be mixed with HTML5, not just XHTML5. Doctypes and DTDs are still the only way of getting Character Entity References into an XML document; that's the point I was making.
Originally Posted by Jeff Mott
...flip open the HTML5 draft and read it cover to cover to maintain your status as an expert on the latest and greatest.
Ehhh, what's the point? Might as well delete the whole book and be done with it.
Last edited by Mr Initial Man; 04-14-2012 at 10:59 PM.
Bookmarks