XML technologies / XML / Perl & XML / Introduction to XML / The history of XML
(Excerpt from “Perl & XML” by Erik T. Ray & Jason McIntosh)
Text processing originally depended closely on output machines. Precise formatting was tied to a device, specifically the printer class of devices.
Consider troff, an older text-description language included and once popular in Unix distributions. It revolutionized high-quality output by making a print shop unnecessary.
troff combines formatting instructions with data. Instructions are readable symbols governed by syntax allowing the interpreter to distinguish them from data. For example, \fI turns on italics. Without the backslash, fI would be ordinary text. This mixture of instructions and data is called markup.
troff offers extraordinary detail. The instruction .vs 18p inserts an exactly 18-point space anywhere in a document. This is excellent aesthetically and unambiguous to the interpreter, but obstructive for other uses. troff is really suited only to printing, as any attempt to modify a document quickly reveals.
Imagine writing this book in troff with every new term bolded, producing hundreds of bold terms. Then design requirements change: new terms must be italic.
An editor could replace bold markup with italic, except that bold also marks emphasis. It cannot distinguish purposes, so automatic conversion is impossible. Someone must inspect each occurrence in context to identify new terms, taking hours or days.
However sophisticated troff becomes, it remains presentation-oriented. A presentation-oriented markup language describes appearance. troff specifies font and positioning without logical content. Finding the last paragraph of chapter three is difficult. Whenever the purpose is not printing, presentation markup gets in the way.
troff is a target format, intended not for further processing or modification but one final operation. Could there be a source format, free of formatting yet packaging useful data? This key question arose in the late 1960s with generic coding: markup described text without concern for output. Tags were descriptive rather than visual.
The Graphic Communications Association (GCA) launched GenCode to investigate generic tags and documents built from small pieces, a precursor to hypertext. IBM’s Generalized Markup Language (GML), by Charles Goldfarb, Edward Mosher and Raymond Lorie, built on this. (Note: notice the developers’ initials spell GML.) IBM could now process, print and display one document using different programs, a major advance for a company producing millions of documentation pages yearly.
Goldfarb led a standards team at the American National Standards Institute (ANSI) to make GML widely available. Combining GML and GenCode, the committee created Standard Generalized Markup Language (SGML). The US Department of Defense and financial agencies adopted it almost immediately, ensuring early success. ISO made it international in 1986. Countless SGML publishing and processing tools followed.
Generic coding transformed digital content: logical meaning could be described without presentation. Such a document resembles a database more than a word-processing file:
<personnel-record>
<name>
<first>Rita</first>
<last>Bucher</last>
</name>
<birthday>
<year>1969</year>
<month>4</month>
<day>23</day>
</birthday>
</personnel-record>No presentation instructions appear. You may display “Bucher, Rita”, “Rita Bucher” or each name on a separate line. Dates may use European 23.4.1969, American 4/23/1969 or English 23/4/1969, or spell out the month. No particular application is imposed, allowing many uses.
Despite its revolution, SGML never spread among small companies as among large ones. Software was complex and expensive, requiring a developer team even with existing tools. Bureaucratic, confusing and resource-hungry, original SGML could not conquer the world.
“But HTML is SGML!” Indeed, the Internet celebrity and web workhorse is an SGML application: a markup language designed using SGML rules. SGML itself is not markup but a tool for creating markup languages. Other technical-document applications include IRS forms and texinfo.
HTML is enormously successful but limited. It is small and less descriptive, closer to troff than DocBook and other SGML applications.
Not always: HTML began as minimal DocBook, then the Netscape/Microsoft browser wars pushed it this way.—Translator’s note.
Tags such as <i> and <b> change font style without explaining why. So limited and presentation-oriented, HTML is hardly SGML’s decisive triumph. Their spirits differ: HTML presents content in one medium rather than bringing generic coding’s power to users.
Standards committees therefore sought a compromise between SGML’s descriptive power and HTML’s simplicity: Extensible Markup Language, XML. X means extensible, its first obvious difference from HTML. Some think X sounds cooler than E. More importantly, XML is not confined to HTML’s minimal tags. Expand the namespace of tags freely and make them as descriptive as SGML. The bridge is built.
XML is a huge success, surviving its own hype and growing through standards such as XML-RPC, XHTML, SVG and DocBook XML. Supporting technologies include XSL:FO for formatting, XSLT for transformations, XPath for querying documents and fragments, and XLink for hyperlinks. Most standards are supervised by the World Wide Web Consortium (W3C), whose members include Microsoft, Sun, IBM, academic and public institutions.
W3C researches and develops Internet technology. Broad though that sounds, a few minutes on http://www.w3.org/ show activity almost everywhere. It does not enforce compliance or charge licenses: its standards are recommendations developers may follow, not obligations.
Its trusted recommendations nevertheless often seem like law. Developers adopt them at release, sometimes before completion. Anyone seeking interoperability treats them as binding—the point of standards.
The system remains open to dissent and debate, as with XML Schema, a controversial standard stimulating competition. We return to this in XML basics: Reading and writing. W3C is strong enough to be taken seriously yet flexible enough for individual freedom. Recommendations are always public.
Developers should have XML experience: it is the universal data-packaging language, and most programs process packaged data. The rest of this section offers a brief introduction to XML for developers.
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “Perl & XML” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de
back to top