The Scoop on HTML, XML, and XHTML


As you learned earlier in the lesson, HTML in its early days was great because it allowed scientists to share information over the Internet in an efficient and relatively structured manner. It wasn't until later that web browsers caught on and HTML started being used to code more than scientific papers. HTML quickly went from a tidy little markup language for researchers to a full-blown online publishing language. And after it was established that HTML could be jazzed up for graphical browsing, the creators of web browsers pretty much went crazy by adding lots of nifty features to the language. Although these new features were neat at first, they compromised the simple design of HTML and introduced lots of inconsistencies when it came to how browsers displayed web pages. The problem was that most new features worked on only one browser or another, and you were out of luck if you happened to be running the wrong browser. HTML had started to resemble a bad remodeling job on a house that really should've been left alone. As it turns out, some of the browser-specific features that turned up during this time have now been adopted as standards and others have been dropped completely.

As with most revolutions, the birth of the Web was very chaotic, and the modifications to HTML reflected that chaos. In the past few years a significant effort has been made to reel in the inconsistencies of HTML and attempt to restore some order to the language. The problem with disorder in HTML is that it results in web browsers having to guess at how a page is to be displayed, which is not a good thing. Ideally, a web page designer should be able to define exactly how a page is to look and have it look the same regardless of what kind of browser or operating system someone is using. Better still, a designer should be able to define exactly what a page means, and have it look consistent across different browsers and platforms. This utopia is still off in the future somewhere, but a language called XML (Extensible Markup Language) is playing a significant role in leading us toward it.

XML is a language used to create markup languages, such as HTML, that describe structured information.

XML is a general language used to create specific languages such as HTML. I know this sounds a little strange, but it really just means that XML provides a basic structure and set of rules to which any markup language must adhere. Using XML, you can create a unique markup language to describe just about any kind of information, including web pages. Knowing that XML is a language for creating other markup languages, you could create your own version of HTML using XML. You could even create a markup language called BCCML (Bottle Cap Collection Markup Language), for example, which you could use to create and manage your extensive collection of rare bottle caps. The point is that XML lays the ground rules for organizing information in a consistent manner, and that information can be anything from web pages to bottle caps.

You might be thinking that bottle caps don't have anything to do with the Web, so why mention them? The reason is that XML is not entirely about web pages. XML is actually broader than the Web in that it can be used to represent any kind of information on any kind of computer. If you can visualize all the information whizzing around the globe among computers, mobile phones, handheld computers, televisions, and radios, you can start to understand why XML has much broader ramifications than just cleaning up web pages. However, one of the first applications of XML is to restore some order to the Web, which is why XML is relevant to your learning HTML.

If XML describes data better than HTML, does it mean that XML is set to upstage HTML as the markup language of choice for the Web? No. XML is not a replacement for HTML, or even a competitor of HTML; XML's impact on HTML has to do with cleaning up HTML. HTML is a relatively unstructured language that could benefit from the rules of XML. The natural merger of the two technologies results in HTML's adherence to the rules and structure of XML. To accomplish this merger, a new version of HTML was formulated that follows the stricter rules of XML. The new XML-compliant version of HTML is known as XHTML. Fortunately for you, you'll actually be learning XHTML throughout this book since it is really just a cleaner version of HTML.

XHTML (Extensible Hypertext Markup Language) is a version of HTML that is compliant with the stricter rules of XML.

By the Way

Earlier in the lesson, I referred to HTML as HTML 4, which is the latest version of HTML. XML and XHTML also have versions, with XML 1 being the latest version of XML, and XHTML 2 being the latest version of XHTML. XHTML 2 is very new and has yet to be supported in any major web browsers, so this book sticks with teaching you XHTML 1.1. You'll learn more details about XHTML 1.1, HTML 4, and their relationship with each other as you progress through the book and create working web pages.





SAMS Teach Yourself HTML and CSS in 24 Hours
Sams Teach Yourself HTML and CSS in 24 Hours (7th Edition)
ISBN: 0672328410
EAN: 2147483647
Year: 2005
Pages: 345

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net