2005-05-20
A Really Bad XHTML Article
Okay, I got this article in a Google news alert and it was so bad, I just had to write about it. It's trying to explain XHTML, but the guy obviously doesn't have a clue what he's talking about. Here are some juicy parts:
Right now there are two languages vying to be number one on the Web. The first is good old HTML and the second is Extensible Markup Language (XML). Which is better really depends on whom you talk to and what they want to do with the pages they create.
No, HTML and XML are completely different things. HTML is a specific application of SGML. XML is considered a replacement for SGML. There are many applications of XML, and XHTML is one of those applications.
XML is much more dynamic and allows for much more specific database interaction than was ever possible before. An example would be searching for "dog" in Yahoo!. You get everything that has "dog", as well as all related, larger words such as "dogma". Well, XML can change all that. Your searches and requests can be specific. Results will be specific.
I'm not even sure where to begin with this one. The guy clearly has no idea what he's talking about. The example makes no sense and doesn't have anything to do with XML. XML is more dynamic
than SGML, in some sense, but the rest of this paragraph is just nonsense.
Another big plus on the XML side is the ability for you to create custom XML tags. If you want a tag named "zork" that allows you to turn text green and change the font size to 24 point, you can create it.
He's describing it as if you are free to make up your own tags in XHTML, which is not true. It's possible to create your own complete applications of XML (basically, your own replacement of XHTML), but you can do that in SGML anyway. Furthermore, there's no point in creating your own application if there isn't a program that is designed to use your specific application. To do what he's suggesting, the proper way is to use standard XHTML and stylesheets to stylize your content.
Inside your browser, there's a DTD. It's different from browser to browser depending on which version you're using. The reason that Internet Explorer 4.0 understands some HTML 4.0 level commands and Internet Explorer 3.0 doesn't is because those commands were written into the 4.0 browser's DTD.
DTDs are not different from browser to browser (or at least shouldn't be, unless the browser is doing something wrong). DTDs define which tags and attributes may exist in that application of XML or SGML. The reason that different versions of a browser support different amounts of HTML and such is that they handle the elements themselves in different ways. That doesn't necessarily have anything to do with DTDs. The DTD doesn't describe what the browser is supposed to do with each element; it just describes which elements may be there.
Also, they're called elements, not commands
.
The new XHTML 1.0 DTD (which looks like this, in case you're interested) is basically the XML DTD with the HTML 4.0 DTD put inside it. Users must follow the majority of XML rules because HTML is under XML's umbrella rather than being the other way around.
New? It's six years old... But anyway, XML doesn't have a DTD. It's the HTML 4.0 DTD with modifications made so that it's in XML and not SGML. Users don't have to follow the majority
of XML rules; they have to follow all of the XML rules. It's an XML document, not just sort of an XML document.
You may not like that, but there's some sense to it. XML is very specific. One thing means one thing. Period. HTML isn't so specific. For example:
- Tags can be in caps or not.
- TEXTAREA boxes require end tags, yet text boxes do not.
- Tags can end in any order regardless of how they were placed.
First, what's a text box? I think he means a paragraph element. Second, the third point here is totally false. Closing tags in the wrong order, such as <a><b>Content</a></b>, is strictly forbidden in SGML (and thus, in HTML). This fact was simply emphasized in the XHTML specification and browsers are now required to fail on a document that does this.
There are lots of other little errors in this article, including several bad typos in the code examples. It's hard to believe that this is a recent article. Unfortunately, I'm not finding a date on the article. It's possible that Google just found it recently and, because there was no date, just assumed that it was recent. Either way, this is not a good introduction to what XHTML is.
0 comments
Comment moderation policy: Your comment will be reviewed before it is added to the site. This is in response to spam and other forms of abuse. I gladly accept comments containing criticism as long as the language is clean.
This weblog is powered by Blogger.