13. Single Sourcing
Single sourcing is a publishing phenomenon where the content of a document is saved to a single computer file, then published to multiple media through a series of transformations. For example, one could save the textual content of a document to XHTML format, then use unique Cascading Style Sheets to publish that information to either the web or to a format for printing.
More often than not, the preferred format for the single-source file is eXtensible Markup Language (XML), which is an expansive suite of various technologies built around a flexible system of <tags>. While it is not necessary (and perhaps impossible) to have a working knowledge of all these technologies, it fairly important to have a conceptual understanding of various XML concepts.
XML is simply a system of tags used to semantically define data for a particular use. An example of such tags within an XML file would look something like this:
<address type="home">
<name>
<first>Lee</first>
<last>Honeycutt</last>
</name>
<street>3938 Christytown Road</street>
<city>Story City</city>
<state>Iowa</state>
<zip length="9">50248-1234</zip>
</address>
But unlike HTML, which has a prescribed set of tags that authors must use in order for the browser to render the text, authors can just make up any tags they want to define the data and content within their document. Of course, these tags must be defined structurally for use with various applications, which is where schemas come in.
Schemas
In order for various computer programs to make sense of tagged data, each XML file must be supported by a separate descriptive model or schema of all possible tags used in the document. Generally, this description takes the form of a Document Type Definition (*.dtd), though other schema are beginning to take its place.
Regardless of which type you use, the schema is linked to the primary XML data file via a one-line reference at the very beginning of the file. For example, the newest language for web pages is XHTML, which is actually a form of XML with a specific DTD maintained by the World Wide Web Consortium. The opening lines of any XHTML page must look like this in order for the web browser to parse the code correctly:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
In fact, if you click on the link I've inserted in this DTD, you can download the entire XHTML 1.0 Transitional DTD and open it with a text editor to see what it looks like. You can also view the DTD of other XML implementations at LiveDTD.
In terms of business and technical publishing, the promise of XML is that it allows the separation of content and style and supports a modular form of writing in which content can be repurposed for a variety of individual contexts. XML files contain the data and content, while styling is supported in a separate file written in another form of XML known as XSL (eXtensible Stylesheet Language). This single-source form of writing promises an authoring future where information is written once to an XML file and then reused for a variety of different purposes using specifically tailored XSL files.
XML Transformations
If XML were nothing but a bag of tags, it wouldn't be of much use in business and technical communication. However, repurposing is supported by a series of XML technologies known as "transformations," which take the styleless information of a basic XML file and give it form, layout, and styling using files written in XSL. These transformations are generally divided into two different formats:
- XSL Transformations (XSLT) - a type of transformation generally used to convert content from XML into another form of XML. It is most widely used to convert XML to XHTML, and many current web browsers support such transformations on the fly.
- XSL-Formating Objects (XSL-FO) - a page-based transformation process that converts XML files into PDF, PostScript, WordML, OpenDocument, and other print formats.
Other Uses of XML
The uses of XML are much broader than support of single-source publishing. Few areas of computing today are not touched by XML in some way. Such uses include:
- RSS web feeds - the live bookmarks supported by various browsers today to make information freely available in standard format.
- Web searching - XML is at the heart of many search applications used today on the web, including such future projects as the Semantic Web.
- Metadata support - portable use of descriptive metadata for digital objects such as iTune songs.
- E-business support - makes electronic data interchange more accessible for general information interchange, business-to-business transactions, and business-to-consumer transactions.
- Database development - many of today's enterprise databases use XML in some way, such as for import and export.
These are only highlights of how XML is being used in today's information economy. Its uses 10 years from now may be quite different from today, as the standards community steers its evolution to meet immediate and future needs. The future of computing lies in the hope of open standards and not in the proprietary technologies of Microsoft and other behemoths. Or you can take the attitude of Susan Glinert Stevens, author of XML Can Go to H***.