Just XML, 2nd edition
Authors: John E. Simpson
Venue:  (2000)

From the Book:PrefaceWhy did I write Just XML? It's a fair question. (And I won't even ask you in return to address its obvious flip side: Why are you reading it? I hope to answer that for you in a moment.)The short answer is that I wrote this book because I work with computers every day and want them to be more useful than they already are. Not just for me, eitherevery week I meet a hundred-odd people (some of them quite odd, but that's a subject for a different book) who are baffled by the failure of computers to "think" the same way we do.A longer, more precise answer is that I want the Internet to be more useful: When I type a keyword or phrase in a Web search engine, I don't want a list of ten thousand alleged "hits" returned, sorted by a relevance that some machine has calculated based on an algorithm that may or may not have much to do with the documents' actual substance. I want the Internetand its associated technologiesto be smart about all the information it holds: to understand itself, I guess you might say. And I believe that the Extensible Markup Language, or XML, is the surest route to that ideal right nowand the faster it spreads, the faster we'll get there.Which brings us to a natural corollary: Why, specifically, might you want to read Just XML as opposed (or in addition) to a hundred other books on the same topic?Why Just XML?Let's break that section heading into two separate questions: "Why 'just'?" and "Why XML?" And let's consider the second question first.Unless you've been in a technological fog for the last five years or so, youalready know that the Internetparticularly the part of it called the World Wide Webhas taken the developed world by storm. Everyone from the largest multinational corporation to the neighborhood butcher lists his or her own www.companyname.com in the Yellow Pages. It's leached into the daily lives not just of corporate and government entities, but even of everyday people (school-age children have their own home pages).You may also know that what underlies all the Web's exhilarating breadth of content and style is a simple secret, not exactly a dirty one, but one still capable of shocking innocent newcomers: It's all just text. Regular text is bracketed with special strings of other text that instructs a user's browser to render the enclosed matter in some particular style. For example, the tags (as these bracketing strings are called) <em> and </em> say, "Render everything between the opening <em> and the closing </em> in an emphasized form." (What "emphasized" means is left up to the browser, but it almost always means italicized.) You don't need any exotic software to create these marked-up text files, although such software is certainly available; all you need is a plain old text editorsuch as Windows Notepad or UNIX viand a facility for getting at the <, >, and / keys without breaking your train of thought.That's all well and good, as my grandmother might have said, but it doesn't go far enough. I'll give you some detailed reasons why in Chapter 1, "Markup Laid Down," but for now, just take it on faith that the Web's established markup languageHypertext Markup Language, or HTMLfails to establish meaning for elements of the documents in which it's written. Furthermore, if you're creating your Web files in Tokyo, you'd better forget about using that nifty new Kanji keyboard: HTML makes easy use of only the characters in the Roman alphabetletters A through Z and digits 0 through 9. XML easily bests HTML on both counts.Now about that "Just" in the title...As you'll see, XML shares some of HTML's bloodlines. Many of the folks responsible for getting HTML off the ground, as well as its decades-old parent SGML (Standardized General Markup Language), were involved in the development of the XML standard, too. But both HTML and SGML are different beasts than XML, requiring different mindsets to use. I believe that it's not only possible but desirable (if XML is to take off at all) to learn XML without requiring any knowledge at all of its forebears. So you won't find much help here if you're interested primarily in them.(If you snoop around a bit on the subject of XML, you'll also find copious references elsewhere to Java and other programming languages. That's largely because XML is still so new that many of its adherents are involved in developing the software that will process XML, and such folks are naturally concerned with language-specific approaches to handling the new markup style. Just XML doesn't have much to say about Java, C++, et al., either.)So while you're going through this book, put away the wheelbarrows full of knowledge and predispositions you may have acquired about SGML, HTML, and so on. Concentrate on what you want your Web site to say, and on learning how to make it say that, uniquely.Repeat to yourself: Just XML.Some Things about Me (and what they imply about you)First, you need to know that I'm not an SGML guru. In fact, before beginning the first edition of this book, I knew virtually nothing at all about it. A friend of mine worked in the late 1980s and early 1990s on a project called EDGAR, an SGML application used by the federal Securities Exchange Commission; I could tell from the bleary-eyed look in this friend's eyes, and implicit in her e-mail messages, that learning or using SGML was not something to be endeavored casually. Beyond that, I knew nothing except very basic principles (such as that HTML was some kind of SGML derivative).I have been a computer applications developer (read "programmer") since 1979. Most of my early work was on mainframe computers, and I graduated thence to UNIX-based minis, and eventually to PCs. My first Internet use was in 1991. I built my first Web page in 1994. My "day job" is as an applications developer, mostly using Microsoft Access and Visual Basic 5.0, and I'm the Webmaster for my department's Web site; in my spare time I also maintain the site for Anhinga Press, a publisher of poetry, at www.anhinga.orgWhy this dreary recitation of a resume?No, I'm not fishing for job offers (I'm quite happy where I am). Really, all I want to do is reassure you that, in my opinion, in order to understand and use XML productively: You don't have to know anything at all about SGML; and You don't need to know anything at all about HTML (although a general understanding of how it works will help).In general, I believe th anyone with a basic modicum of intelligence and some simple prior exposure to the Web can understand and use XML. Don't worry about the apparent strangeness of some of its concepts and mechanismstake one step at a time and you'll do just fine.Ulterior MotivesAll right, I confess: There's more to the "why I wrote this book" than all that noble (however sincere) folderol I mentioned at the outset.The fact is, although I work all day with computers and the Internetand think, on the whole, that my life is better because of themthere are times when I'm heartily sick of the things. (Not just when they're not working right, either; sometimes I'm so fed up with just sitting in front of them that I'll drop a favorite, entirely smooth-running game before I even have a chance to figure out the first riddle.)At such times there's nothing I like better than channel surfing for a movie I've never seen. Even better is a trip to the video-rental store, where I've got some element of control over the selection. And I'm not talking about recent box-office big hits, either. I mean oddball little films, probably cranked out in black and white in the 1940s through 1960s: the ones featuring casts whose names you can't recall fifteen minutes after they've rolled over the screen (while some corny, likewise forgettable score drones or tootles in the background); the ones whose plots revolve around mysterious creatures from other planets, or unlikely chains of criminal circumstance on our own planet, or men in combat fatigues baring their shallow souls to one another while tinny post-production gunfire whizzes and whines overhead. I mean, in short, B movies.In thinking about B movies, I realized something wonderful about XML: I can think about B movies a lot using XML as a tool for describing them. This would have been nearly impossible to do fully with pure HTMLalmost certainly requiring me to write a customized, hard-to-maintain program in Perl or some other Web programming language. It'll be a snap (well, almost a snap!) in XML, though.So throughout this book, be prepared to think not just about XML, but about low-budget cinema (or at least cinema that frequently looks as if it's low-budget) as well.How Just XML Is OrganizedThis book consists of five main parts or sections: Part 1, XML Basics, will introduce you to everything you need to know about XML itself. (The "basics" in the title simply means XML as a distinct element apart from its closely-related technologies covered in the remaining parts.) This part will also introduce you to FlixML, a customized XML lingo for communicating information about (yes) B movies. Part 2, XML Linking, covers XML's tools for hyperlinking documents to one another (or to other parts of the same document) in ways not remotely possible with HTML. Part 3, XML: Doing It in Style, details the use of Cascading Style Sheets (CSS) and Extensible Stylesheet Language Transformations (XSLT). With these two languages you'll tell browsers how to transform the structure of and display your fully linked XML documents for maximum impact. By the end of this section, you'll know everything you need to create a "database" of your own, using FlixML to describe B movies. In Part 4, Rollin Application, you'll learn how to develop a Document Type Definition (DTD) for your own purposes, freeing you (should you want to be freed!) forever from thinking that XML is capable of describing only B movies. Part 5, XML Directions, discussesand shows examples ofthe range of XML-related software available as of this writing. It also covers what's in store for XML-related technologies for the foreseeable future.Finally, the appendices of Just XML will point you to further referencesmostly on XML, etc., but also a handful (I'm sorry, just can't help myself) on B movies.