WPTools (*.WPT) Format

    • Offizieller Beitrag

    Q: Why is WPT format not directly XML?

    A:
    a) The WPTools component and RTF supports fields and links which span paragraphs. This is the reason we did not use XML directly.

    b) WPT format has been designed to be concatenable. This means you can append to a document and it still stays valid. This is why it does not have a header like RTF and does not use nesting like XML.

    WPT has been designed to "look" like HTML. The reason was to make it possible to scan it using code which is expecting HTML (mainly full text search). All other properties were meant to be ignored by the scan.

    It is, on the other hand a very simple format. The most complicated part is the WPCSS which is written by the textstyles directly. Other than that it reproduces the structure of the document as it was in memory. This makes it a good option to debug text, for example to find faults like table objects without rows.

    WPT format supports property inheritance. This makes it more versatile than RTF which requires complicated tasks for aceptable style handling. In contrast to XML it can do numbered list without needing to add nested tags (ol, ul).

    WPTools 6 comes with a unit WPXMLIO1.pas. This unit implements a rudimentary XML format. The unit was specially designed to make it eays to adapt the format to the needs of the specific product.