This is a simple Perl-script which creates a Rich-Text-document (RTF) from an XML source.
Download here.
Please fork this. I don't have the time to merge patches. Please feel free to seize the project, but it would be nice if you drop me a line.
Usage: xml2rtf [OPTIONs] [FILEs]
Converts a XML-file into Microsofts(R) "Rich Text Format" (RTF).
-h, --help display this help and exit
--verbose be verbose
-d, --dump write output to STDOUT
--libxslt use Perls XML::LibXSLT library
--xsltproc use the external program "xsltproc"
If no XML-file is specified, the program reads from STDIN.
If no XSLT-stylesheet is specified, the program uses a build-in default stylesheet.
If no RTF-filename is specified, the program creates a filename from the filename of the XML-file and appends ".rtf" (or, if input is taken from STDIN, it outputs to STDOUT).
Examples:
xml2rtf reads XML from STDIN and writes RTF to STDOUT.
xml2rtf name.xml reads "name.xml" and writes output to "name.rtf".
xml2rtf name.xml --dump reads "name.xml" and writes output to STDOUT.
Tags:
The build-in stylesheet recognizes the following tags:
<document> encloses the whole document
<document format="FORMAT"> uses FORMAT ("a4" or "letter")
<p> paragraph
<p align="ALIGNMENT"> paragraph, aligned left, right, centered or justified
<i> italics
<b> bold
<ul> underlined
<strike> strike through
<caps> all caps
<smallcaps> all caps with lowercase in smaller caps
<outline> outline font
<font face="FONTNAME"> use font FONTNAME
<font color="COLOR"> use color COLOR (standard HTML/CSS-names are recognized)
<font size="POINTS"> use size POINTS (standard is 12)
xml2rtf version 0.9. Written & Copyright (C) 2014 by Peer Schaefer (peer@wolldingwacht.de). Licensed under the GNU General Public Licence (GPL), version 2 or later (at your choice). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GPL for more details.
Written and Copyright © 2014 by Peer Schaefer (peer@wolldingwacht.de).