Published: September 18, 2005
Print
Email
If you take a close look at the use of XML in today’s business world, you soon recognize that pinning down a single, definitive use for XML is nearly impossible. In fact, it is precisely the open-ended nature of XML that makes it so useful for many different things — and so difficult to put into a single, small box. Read on to see what we mean. Mocking up your own markup You may be familiar with Hypertext Markup Language (HTML), the markup language used to display information on Web pages. Both XML and HTML are derived from the “mother of all markup languages,” Standard Generalized Markup Language (SGML) — but any similarity ends there. HTML includes a set of predefined tags that format information for display on the Web. XML has no predefined tags — instead, you can create your own XML tags to structure your XML document so its content is in a form that meets your needs. Basically, you design your own custom markup language (actually an XML application) to do data exchange in a way that works for you. Although XML doesn’t include predefined tags, it does include very specific rules about the syntax of an XML document. You’ll get a chance to explore those rules (and use said rules to create your own XML document). XHTML is yet another markup language — designed as a transition language between HTML and XML. In a nutshell, XHTML is a version of HTML that follows the strict syntax rules of XML. After you’ve used it for a while, you’re well prepared to use XML. Separating data and context Among the many benefits of using XML is that it automatically separates data from context (presentation). An XML document by itself includes no instructions about how to display the content contained in the document — it only defines the structure of the document. You can then add styles — formatting instructions for displaying the content — in a separate document called a stylesheet. This separation is actually pretty handy; you can change the display instructions without having to make any changes to your XML document. If the same style sheet is used with more than one document, you can make uniform style changes in all those documents simply by making changes in the stylesheet. All the associated XML documents follow the stylesheet’s orders. XML can be combined with both two different types of stylesheets — Cascading Style Sheets (CSS) and/or Extensible Stylesheet Language Transformations (XSLT) — for extra versatility. This makes it possible to view XML documents on the Web as more than just raw document markup — and you can change this display easily to accommodate different output devices. For example, you can use one stylesheet for display on a PDA and a separate one for printout.
We’ll have more to tell about the world of CSS formatting later, where (lucky you) we even show you how to create and link a CSS stylesheet to an XML document. XSLT gets the same treatment in Chapter 12, where you get a chance to explore the power of XSLT stylesheets for formatting the display of an XML document. Making information portable XML is all about managing your data — using the best possible format available to you. To talk about how XML can handle your data as discrete bits of information, what better format is there to use than a bulleted list? Check out the following items: XML enables you to collect information once and reuse it in a variety of ways. - XML data is not limited to one application format. You can design an
- XML document that allows you to collect data online for use in other
documents, databases, and spreadsheets. For example, suppose your business collects sales information on a group of products by using an XML document to contain the data. The same XML data could be used to create customer purchase records, commission reports, and product-sales graphs. - Making information portable does require planning and design before
the information is collected. XML means business XML provides an easy way for businesses to manage and share information. Although XML was originally created by the World Wide Web Consortium (W3C) as a way to disseminate complex, structured data and documents over the Web, its use has expanded. Now no longer a Web-only format, XML is right at home on the business desktop. Microsoft Office 2003 is one notable application package that includes XML tools for office applications. Using Office 2003, office documents can be created in XML format and information tagged and collected for re-use in other office applications as well as on the Web. Discuss this article in the Forum!
« Back
|