Two Laptop Bag*
The moose likes Java in General and the fly likes converting xml into rtf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "converting xml into rtf " Watch "converting xml into rtf " New topic
Author

converting xml into rtf

cogol tina
Greenhorn

Joined: Oct 14, 2003
Posts: 3
HI,
I want to print a rtf document in java for which i have to convert an xml into rtf using style sheet. how can i do that.
don cline
Ranch Hand

Joined: Oct 10, 2003
Posts: 35
tina
Things to check out -- for xml parsing - SAXParser (unless you prefer the DOM), for outputing rtf - javax.swing.text.rtf and the RTFEditorKit. I wrote a servlet years ago that converted an xml document to rtf, but that was before RTF support was built in to java. I was reading the RTF spec and building classes to output different parts of the RTF. I would not recommend that approach.
Don
El Durango
Greenhorn

Joined: Oct 09, 2003
Posts: 23
I've worked on converting XML to RTF, and so far the "cleanest" tool I can recommend to use is RFK (RTF Formatting Kit), however I still am not impressed with it since it has no support for Windows Drawing Objects used to make diagrams and other drawings. The other issue I had with it is that this tool does not come with an API, I had to write a script to access it and that becomes inconvenient at times.
Another thing that might be useful in the near future is XML FOP (XML Formatting Object Processor). This is being worked on by Apache XML group, however they still do not have RTF support, although they propose to have it. They will integrate JFor for the RTF support which to me is a tool in its embryonic stage. There may be other tools I may not be aware of but most of the ones I have come across are nothing to woo about. :roll:
Here are the links for the FOP project.
http://xml.apache.org/fop/index.html
http://xml.apache.org/fop/output.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: converting xml into rtf