Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


April 1999

Using XML to Build Internet Solutions


RSS
Subscribe to Windows IT Pro | See More Internet Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Separating content from formatting. Web servers today use HTML to transport pages' content to viewers. HTML transports a page's data and the formatting information that tells browsers how to display the page in one data stream. HTML's mixing of data and presentation information complicates the process of transporting information. For instance, a Web server might send the course information in my first example as the following HTML code:

<BODY>
<P>&nbsp;</P>
<P>Course ID: <STRONG>ACD1000</STRONG></P>
<P>Title: <STRONG>Advanced Component Development</STRONG></P>
<P><STRONG></STRONG>Start Date: <STRONG>November 2, 1998</STRONG></P>
<P>Duration: <STRONG>3</STRONG></P>
</BODY>

You probably have trouble identifying the data in this example; this code doesn't make differentiating between the data and the formatting information easy. Therefore, creating applications that automatically separate HTML records' data from their formatting information isn't easy.

XML makes separating formatting information and data simple. The W3C recently released a draft for Extensible Style Language (XSL), which is a specification for creating and publishing XML documents. XSL works with XML in the same manner that Cascading Style Sheets (CSS) technology works with HTML. XSL and CSS define a document's formatting, but XSL offers more functionality than CSS offers. CSS lets you specify only documents' onscreen formatting; XSL lets you specify documents' onscreen and print formatting.

Many organizations are discussing and designing specifications and tools for XML. The W3C is developing more XML specifications. Vendors are building tools that work with XML. And industry organizations are working to define XML specifications for medicine, finance, and other industries. This interest in XML suggests that the specification will likely get the broad support it needs to become a successful standard.

XML in the Real World
Many vendors are creating products that support XML. Microsoft, Netscape, and Adobe Systems are among the companies presently exploring the benefits of XML. Microsoft already uses XML in Internet Explorer (IE) 4.0 and Commerce Server.

To use XML, an application must have a parser, which is a software engine that can read XML and extract data from an XML stream. For instance, a parser would read my first example and pick out ACD1000 as the value for the Course ID field. Many specifications for exchanging data use positional information to define fields or use explicit rules about data's position within a data stream. Because XML parsers depend only on a DTD or the data definition in a stream to extract the data from the stream, XML is easier to use and more flexible than other specifications. You can build a parser today that will work in future applications you haven't yet planned. The parser doesn't need to understand the XML streams it parses; it must understand only XML's simple rules.

Several XML parsers are available. IE 4.0 contains a parser (msxml.dll) that the browser uses to read channel definition file (CDF) and Open Software Description (OSD) streams. IE uses CDF streams for channel information and uses OSD streams for downloadable files. Developers can use the IE 4.0 parser in custom applications, but the applications' users will need to have IE 4.0 installed on their system. Microsoft's Commerce Server also contains an XML parser, and several parsers are free for downloading from the Internet.

XML is useful in other ways, too. Figure 1, page 126, demonstrates how a user can browse a Web site and interact with a custom XML application on the site. The user makes a selection that sends an XML stream to the Web server. (The XML stream you see in Figure 1 is this article's first sample of XML code.) When the server receives the code, it needs only an XML parser to read the stream. The server's application can use a commercially available parser or a custom parser to access the XML stream's content.

This use of XML becomes more interesting when you up the ante from one application to multiple applications that share data. Passing data between a browser and server that use the same application is easy, but many developers believe that using HTML features such as forms is faster for single-application data transfer because using XML as the transfer mechanism adds overhead to the development process.

However, XML is definitely a better choice than HTML for transferring data among applications. Figure 2 shows how developing applications to transfer data becomes more complex when you add to the process an inventory server that runs a different application than the Web client and server, and Figure 1's Web site handles user requests through that added server. The component server in Figure 2 executes the components that are common to both applications. The inventory server executes components and application features that are specific to inventory procedures. XML can serve as the data transport specification for each part of the request-fulfillment process in Figure 2. If each server's application includes an XML parser that understands the data stream's DTD, each application can pull data from the XML stream without requiring custom code for data interpretation.

Future implementations of many software products will use XML. For instance, IE 5.0 will permit XML data islands within HTML pages (i.e., blocks of XML code that you embed into the HTML code that defines a page). I can turn the XML code from my first example into a data island by placing XML tags before and after the code.

<XML ID="CourseXML">
<Courses>
<Course ID="ACD1000">
<Title>Advanced Component Development</Title>
<startdate>November 2, 1998 </startdate>
<duration>3</duration>
</Course>
</Courses>
</XML>

This code defines the XML stream as an object. If I place the code in an HTML page, a script running in the page can access the XML elements by using CourseXML as the object's name. This feature lets developers work directly with XML data without using a parser or creating parser code.

Of course, users need browsers that support XML to view a site feature that uses an XML data island. This restriction creates a problem, but it need not stop you from using XML. For now, you can create XML vocabularies and use XML behind the scenes in your applications. Then, when XML support becomes more prevalent in browsers, you'll be ready to benefit from XML's ability to transfer data to clients.

Get Ready for the Future
XML offers developers new options for defining and transporting information. This specification will become popular in the future as more applications take advantage of its simplicity and power. If you're developing applications now, you don't need to wait for the XML market to mature. You can find ways to use XML today. For more information about implementing XML solutions, see "Related Reading Online." If you begin developing XML applications, you'll position yourself to take advantage of XML as other applications support it in the future.

End of Article

   Previous  1  [2]  Next  


Reader Comments

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...


Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement