• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

converting xml into rtf

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic