[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: a simple RTF <> XML question

Subject: RE: a simple RTF <> XML question
From: "Nilsson, David F" <dfnilsson@xxxxxxxxxx>
Date: Wed, 18 Oct 2006 16:18:14 -0400
convert rtf wordml
slacker hacker says he wants to:

> 1:  read RTF, convert to XML  (not a problem)
> 2:  pass XML to tool (not a problem)
> 3:  get XML result and write XML final version (not a problem)
> 4:  convert XML back to RTF  (omg is this complicated!)


If the tools suggested by others work for your project, that sounds
great.

If you're going to end up writing an XSLT stylesheet, however, I would
suggest avoiding XSL-FO, which I think is a needless complication.

I'm assuming that when you say "RTF" you're meaning RTF that someone
will open with MS Word. If that's not the case, this advice may not
apply.

To convert an XML dialect to Word, I would write an XSLT stylesheet to
convert the XML to WordML, an XML dialect which Microsoft introduced in
Word 2003 Professional. You can then open the WordML as a fully
formatted document in Word. And you can save that as RTF, if you wish.

You can get an idea of how to create WordML from the O'Reilly book,
"Office 2003 XML," by Evan Lenz, Mary McRae, and Simon St. Laurent.

The people who maintain the DocBook XML stylesheets also have
stylesheets for converting DocBook XML to WordML and from WordML to
DocBook. Taking a look at their stylesheets may save you some time. Some
of what they've done is more complicated than you would need since
they're trying to "round-trip" the documents, and you just want to make
a one-way conversion.

The handy thing about taking this route is that you can use Word to do
part of the work. You can create a document template in Word, save it as
WordML, and extract the style and font definitions with your stylesheet.
The DocBook stylesheets show how to do that.

Of course, you have to teach yourself XSLT, but after that, all this is
pretty straightforward.

-----------------

Dave Nilsson

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.