Mr. Bad Example

We're all examples: some good, some bad, some ugly.

RTF or WordML for Office solutions?

John Durant has an interesting post talking about RTF or WordML for Office solutions?

John's main point is that its easier to generate WordML on the server than it is RTF. As a Document-centeric kind of guy, my first reaction was "its really a function of the complexity of document involved."

Just to be safe, I decided to take a look at an exmple in our "real world." For example, I'm changed with maintaining an ASP.NET application that generates Safety Guides on the server. We use RTF largely because its what was available to us at the time. So this morning I decide to look into what it would take to rewrite that to use WordML instead. I'd love to say that I concluded that redoing that to output WordML instead of RTF would be hard enough that the best solution going forward is to would be to stick with RTF.

I can't. The WordML format for these documents seems both cleaner to generate programatically and to serve up efficiently.

What is going to be hard (maybe) is changing how we do it. Instead of just building up a big string of data and literally writing both the data and the markup, maybe its time to invest in writing my our own version of a streaming writter that would construct valid WordML on the fily. I'm sure that sounds easier that it is, but I can see all kinds of places where we would use it. In short, what I need is WordMLTextWritter that's a decendent of XmlTextWriter. Now if somebody has already written that, my life really would be simple!

John's does make assertion that doesn't quite jive with me though: That is XML is a better choice because it has more mind share than RTF. I'm not sure that I completely agree. While that's true the closer you get to the cutting edge, there's lots of cases where RTF is still the defacto standard because "its what we've always done. Its not broken."

If that were really true, we'd still be riding horses.

Posted: Oct 26 2004, 11:21 AM by ktegels | with 3 comment(s)
Filed under: ,

Comments

andy said:

I think that another thing that would have to be factored into the mix is what version of office is expected to be able to open your server generated file. If it is only 2003 then you can pretty much do whatever results in least code serverside. If you have to support multiple versions of office then I don't see why wordML would be used.
# October 26, 2004 1:47 PM

MikeH said:

I've made a hobby of studying different formats -- RTF or XML-variants. That means I'm not an expert, but I have opinions.

RTF is nice because it's portable -- I think it was the last open standard that Microsoft ever wrote. Any word processor can read and write RTF's. But it's not an easy format to parse (okay, if you have Word -- but what about Java? Python? Perl?)

XML, of course, it parsable and portable. But I've seen documents in XML format that were so messy the best XML parsers were brought to their knees in anguish. And what if the word processor you have doesn't know that variant of XML -- be it WordML, DocBook, or TEI or just something someone made up?? What good is a document that can't be read?

So, what's my point? I think it's this -- WordML is great for machines but not for word processors. RTF is great for word processors but not machines.

And now back to real work.
# October 26, 2004 2:30 PM

John R. Durant said:

Hey guys- you have offered up some interesting thoughts. I have a few thoughts to add, and I blogged about your feedback and so forth on my blog today (October 29).

I think it is really hard to argue that RTF has more mindshare than XML. Without wanting to sound sarcastic, I would sum it up this way: Do you see any "RTF Developer!" magazines on the rack at Barnes & Noble? However, there are magazines, conferences, and more wholly dedicated to XML, not counting the innumerable examples of XML-orientation in almost every developer article, book, code sample, and demo. While I agree that XML use in documents is still in its infancy, it is a sign of things to come. RTF will go the way of the Dodo bird....in time. But, I'm a patient man (kind of).

Anyway, you guys got me thinking, and I'm glad you jumped on the topic. I'm interested in hearing more of your ideas.
# October 29, 2004 10:57 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)