Formatter Internals
DITYPE core consists of components, each is an XML-RPC server, answering requests from other components, and sending them requests in turn. Different components are written in different languages, currently in Python and Common Lisp. New components can be added to the bus, existing components replaced by new versions, as long as they adhere to their protocols.
The main process, the Integral, passes a document from the transformer to backends, generating PostScript, PDF and other formats. The transformer determines the document type, applies necessary transformations to convert it to XSL FO, and then passes on. This way, documents in !WordML, XHTML, XSL 1.1, DocBook and potentially other formats are processed automatically; alternatively, the transformer applies the stylesheet referred to in xml-stylesheet processing instruction, allowing custom transformations as long as they produce XSL FO. The transformer is also capable of applying non-XSLT transformations, for example, external programs such as RTF2FO.
The processing is then continued in the preprocessor to turn XSL into FOSI, an internal format suitable for actual formatting job. This step is present but concealed in the current (XEP4) implementation, in the coming version it is explicit, which will allow to replace the preprocessor with a faster version when it comes to it. The document is then actually rendered into XEPOUT, and passed to backends. The backends generate external output format: PostScript, PDF and eventually others.
To process images, retrieve remote resources, write messages to the log stream, as well as for other actions, the main components call other parts of DITYPE: logger, resource-proxy, font-server, graphic-server, file-server.
