This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.


MIND


Working Knowledge
Aaron Skonnard

XML and Beyond

T
his month I'm going to cover more of Microsoft's hot new TLAs: XML, XSL, and XLL. If you've been keeping up, you'll know that both developers and researches are convinced that Extensible Markup Language (XML) is about to change the face of the Internet. In the same manner that HTML provided a universal method to view data on the Internet, XML offers a universal method to describe and work with this data.
      As you probably know, HTML allows you to use tags to describe how parts of a document should be displayed. For example, to display the word "hello" in bold, you simply tag it with the bold tag like this: <b>hello</b>. XML uses HTML's tag syntax to describe the structure of data, but doesn't control how the data should be displayed. Figure 1 shows an XML data object called contact that consists of name, address, and phone elements. Each contact element also describes its own internal structure.
Figure 1: XSL Processing
Figure: XSL Processing

      XML is not there to replace HTML. On the contrary, HTML will continue to be the universal language for displaying data on the Internet. But now developers can harness the power of XML to create new data stores that can be exchanged with any application and viewed in multiple ways. XML brings the world one step closer to separating the Internet's user interface from the underlying data.
      The concept behind XML is definitely not new. In fact, XML is a subset of the Standard Generalized Markup Language (SGML), which has been around since the birth of the Internet. Like SGML, XML will be independent of applications or vendors. XML 1.0 is currently in the final stage of the W3C approval process. At this point, you can safely embrace XML and begin using it in your applications.
      Organizations will benefit from using XML on the middle tier. Once a data source is converted to XML, anyone with appropriate rights can access the data via HTTP. Since XML only describes how the data is structured, clients can process and view the XML data (on the desktop) however it best fits their needs. Clients can parse the XML data manually or use component-based XML parsers. Microsoft provides a standard XML parser for both C++ and Java languages.
      As you might guess, writing code to map XML data to HTML files can be quite cumbersome. To help simplify this process, the Extensible Stylesheet Language (XSL) was developed. XSL, which is a superset of the Cascading Style Sheets (CSS) language, allows developers to create rules that specify an object pattern to search for in an XML file and how to map the object's data to HTML. For example, XSL could be used to transform the XML contact example into a simple numbered list or even a more sophisticated HTML table.
Figure 1 also shows a simple XSL example that displays each contact name in red with last name first followed by a comma and the first name. Currently, the XSL standard is in the working group phase at W3C and is still under
Figure 2: XML Linking
development. Nevertheless, Microsoft has a working XSL parser that you can download and play around with.
      Another member of the XML family that not too many developers are familiar with is XLL or Extensible Linking Language (also known as XML Linking). XLL is simply an extension to XML that defines a way to link XML objects. In HTML you can create links to other HTML files. Using XML Linking, however, you can create multidirectional links between XML objects (see Figure 2). This new functionality promises to make XML just as powerful and flexible as its HTML counterpart. Like XSL, XLL is still in the early stages at W3C; watch for more information as XML continues to progress.
      XML, XSL, and XLL are quickly gaining popularity. Before you know it, the content of most Web pages will be completely driven by XML data. In the same way that HTML changed the way we look at the Internet, XML will surely change the way we use it.


From the December 1998 issue of Microsoft Interactive Developer.