DTD (Document Type Definition)
SGML is what is known as a "meta-language;" it allows a programmer to write a DTD (Document Type Definition) that numerous pages can follow. For instance, all of you use a word processor (I would assume). You type the letter "j." Something inside of that word processor must understand what you did and display that letter. That's the DTD. You then alter the letter's size, font, and color. Again, the commands the word processor used were all understood and acted upon by using the DTD as a guide.
HTML uses DTDs. Ever seen one of these at the very top of a page's source code:
<!doctype html public "-//w3c//DTD html 4.0//en">
That's a document declaration. It states that the DTD to be used is html 3.2 in English. See that above? So, where is the DTD actually located? In the browser. Yup, Netscape, Explorer, Opera, and Mosaic are more than programs to display pretty little pictures. They are actually carrying a DTD so that when you type in a command like <B>, or <UL>, or <CENTER> the browser knows how to handle it. The browser sees the command <B>. It goes to its DTD to check what that command is supposed to do. It sees that the command makes things bold. The effect is then generated.
The one drawback with a word processor, and HTML, is that you cannot set up your own DTDs. HTML is a very stable format of markup languages. The commands mean the same thing everywhere. The language is easy to learn because it is like playing blocks, to some extent. The tools you use never change. JavaScript is more difficult because you are actually creating the blocks before you play with them.
Actually, that's the purpose of XML; it allows you to create your own blocks to play with.
|