Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Microsoft's XML is More Than Just Standards


WebReview.com: Microsoft's XML is More Than Just Standards

Rank:2

At a Glance

This week on XML.com, technical editor Tim Bray offers an evaluation of Microsoft's implementation of XML in version 5 of Internet Explorer. David Strom says there's much more to the MS-XML connection than browsing.



"Soon more people will be writing MS-XML documents than anything else, and then MS-XML will become the standard."

With all due respect to Tim Bray's recent analysis of Internet Explorer 5.0's use of XML, I think he is missing the point. Microsoft's entry into the XML universe will do lot more harm than good initially for the XML standards effort, and has the ultimate intention of replacing the way most of us create and exchange documents.

First off, Tim looked at whether the Microsoft version of XML (for brevity, let's call it MS-XML) implements the standards appropriately and within certain parameters. That is fine, but it's not really newsworthy to hear that MS-XML has bugs and wants to do things somewhat differently than the current standards. (See article "XML in XML".)

The real news is how MS-XML is designed from the start to be the common file interchange format for all Microsoft Office 2000 applications. In doing this, Microsoft has taken to extreme its time-honored practice of embracing and extending an ongoing standards effort. This time, MS-XML has something other than XML in mind. Microsoft is trying to move people away from ordinary HTML 3.0 documents and make Office 2000 the standard tool for Web authoring. And while earlier efforts, FrontPage most memorable, haven't really caught on, I think this time Office 2000 has a solid chance.

Let me explain. Up until a few years ago, I received many non-Microsoft Office documents in the mail from my correspondents. Now it is rare that I get that errant Word Perfect or Lotus 1-2-3 file. Indeed, when I do, I often castigate my correspondents and tell them to send me their Microsoft equivalents.

This isn't because I love Microsoft products: It is because that is what the world uses. Remember revisable-form text? Gone. Remember non-PowerPoint presentations? All but extinct. Microsoft Office is the default document interchangestandard today.

But to make interchange workable, we still have one remaining issue and that is version control. When Office 97 came out, many people were still running Office 95 or earlier versions and couldn't read the newer document formats.

Of course, this encourages people to upgrade when they begin receiving documents in a newer format, but for corporations that want to exchange information easily, it is a painful upgrade. It is far better to use a standards-based format, and MS-XML is perfect for this purpose.

While it is wonderful that Microsoft has decided to support XML in its browser, the bigger news is what it has done with XML in the rest of its Office 2000 components, including Word, PowerPoint, and Excel.

A disclaimer: I am by no means adept at XML. I can write very rudimentary HTML code for maintaining my own web site, and my programming days are long since over. But perhaps this is why I am so sensitive when it comes time to evaluate MS-XML. The bottom line: I can't read MS-XML pages and I am too old to start learning how.

So let's examine the code produced by Word 2000 for a couple of simple examples. For these tests, I am running Beta 9.0.2216 on Windows 98. I wrote a one-page document with the single line "Hello World!" and saved it to an HTML-formatted file. When I view the source, I have a rather lengthy page of text. The header of the page includes all sorts of font metric definitions and meta tags and file information. The first few lines look like this:

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word" 
xmlns="-//W3C//DTD HTML 4.0//EN">

But the really interesting part is the body copy, which looks like this:

<body lang=EN-US style='tab-interval:.5in'>
<div class=Section1>
<p class=MsoNormal align=center style='text-align:center'><b
style='mso-bidi-font-weight: 
normal'><span
style='font-size:20.0pt;mso-bidi-font-size:12.0pt;color:#3366FF'>Hello 
World!<o:p/></span></b></p>

You'll notice that the font size (20 point), font color, justification (centered), and bold text is all preserved with this code fragment. The reference to the class "MsoNormal" is defined in the style section earlier as Times New Roman, which is the font I used in my Word document.

All of this makes it easier to exchange my Word 2000 document with someone else. They can see the style and layout of my text, something that HTML hasn't been very good at doing since day one.

While this isn't a review of the product, let me touch on one other feature in Word 2000 that makes it easier for web authors. When you go to save your document, you can save it directly to your web site via FTP. Once you enter the URL, username, and password, the FTP site appears on your local directory tree as just another location.

But the side effect is that I have to make a pact with the devil. Once I go down the route of saving my pages as MS-XML, the naked code may become unreadable to me. The pages also take up more room and thus will take a bit longer to download and view. As I said, I am not a XML programmer. I have purposely kept my web pages sparse and relatively devoid of "advanced" features in the name of being browser agnostic and universally viewed. I fear that the more people use Word 2000, the more MS-XML will replace ordinary HTML code on the Web.

What about PowerPoint 2000? Earlier versions of PowerPoint had the ability to publish to the Web. While simple to use, this produced rather clunky code and a long series of files. The new and XML-ized version produces a single "pointer file" which contains this code enumerating in a separate directory the other files that comprise your PowerPoint slide show. Here are the contents for filelist.xml for our single slide presentation:

<xml xmlns:o="urn:schemas-microsoft-com:office:office">
<o:File HRef="master03.htm"/>
<o:File HRef="master03.xml"/>
<o:File HRef="preview.wmf"/>
<o:File HRef="pres.xml"/>
<o:File HRef="slide0001.htm"/>
<o:File HRef="master03_stylesheet.css"/>
<o:MainFile HRef="../Hello Worldppt.htm"/>
<o:File HRef="error.htm"/>
<o:File HRef="script.js"/>
<o:File HRef="filelist.xml"/>
</xml>

Why so many files? Each is essentially a style sheet for different purposes: one for all the XML-capable browsers (guess who?), one for browsers that can't read XML, one that uses CSS, and one that uses JavaScript. Slide0001.htm is where you'll find the actual content for our presentation. And "Hello Worldppt.htm" is the control code for the whole show: You'll see a small Visual Basic program that determines which browser you are running and what you get to see.

if ( msie >= 0 )
    ver = parseFloat( appVer.substring( msie+5, appVer.indexOf ( ";",
msie ) ) );
  else
    ver = parseInt( appVer );
  path = "./Hello%20Worldppt_files/error.htm";
  if( (ver < 4) || (msie <= 0) )
  {
    if ( !msieWin31 && ( ( msie >= 0 && ver >= 3.02 ) || 
                         ( msie < 0 && ver >= 3 ) ) )
      window.location.replace( path );
    else
      window.location.href = path;
  }
  else

window.location.replace(
'./Hello%20Worldppt_files/slide0001.htm'+document.location.hash );

Again, this has the effect of making it easy to publish your work to the Web and exchange it with others.

If you buy into my explanation, the whole idea of suing Microsoft for putting IE into the operating system becomes really a minor sideshow. With Office 2000, something bigger is at stake: to capture all the current non-MS Office users, those few hardy holdouts who use Lotus and Corel tools to create their documents, spreadsheets, and presentations.

And while they are at it, Microsoft also wants to capture those others who use non-MS tools for writing web pages. The underlying effort is to be the single document interchange vendor for everyone, even those folks who don't run some form of Windows on their desktop. And MS-XML will be the Trojan Horse to pull this off. Taken in this context, whether Microsoft supports or doesn't support the overall XML standards effort isn't that important anymore. Because soon more people will be writing MS-XML documents than anything else, and then MS-XML will become the standard.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.