XSLT and RTF, rich text format
1. | RTF output handler, XT only |
See 4xt.org The good news is that you don't need to fight with the text output method any longer to generate RTF, the bad news is that you still need to know RTF to use this output method! RTFOutputHandler is an output method 4xt that serializes a XML tree following a RTF syntax. This method is working at a pure syntaxic level and doesn't know (nor test) any of the semantic of RTF. The conversion from XML elements and attributes is done using a straightforward and automatic algorithm: 1) Control names: The control names are the concatenation of the element name and the value of all its attributes. <rtf> --> \rtf 2) Blocks: A new block is started for each element with children elements: <rtf> This simple algorithm is... too simple, some controls need to be always enclosed in a group and a list of controls will have to be created in future releases. 3) "Special" characters: The RTF reserved characters ("\", "{" and "}") are escaped and the ANSI characters with a value greater then 127 are translated as specified by the RTF specification. 4) Unicode support: Unicode isn't supported yet. 5) Whitespaces: This is probably one of the biggest limitation of the current version: no treatment is done regarding whitespaces. This means that your XSLT transformation should strip the spaces (<xsl:strip-space elements="*"/>) and include whitespaces where there are expected even in first position of values (such as "author" or "froman" in our example). 6) Samples This Java class is provided with the following samples : - hello.fxml, hello.xsl and hello.rtf |