Structural guidelines

The following rules must be observed when designing custom content:

  • commands and custom markers together must be properly nested as in well-formed XML;

  • commands and custom markers can be freely intermixed, except that a <switch> can only contain <case> blocks, and <case> blocks can only appear within a <switch>;

  • <if>, <while> and <switch> blocks can be nested as required;

  • text, including variables, can appear anywhere except immediately within a <switch>;

  • variables can be freely intermixed with general text, and inside attribute values;

  • attribute values can contain text and/or variables, but not commands or custom markers;

  • variables cannot contain commands/markers.

[Warning] Warning

Pre content and Post content customisations are parsed separately. It is not legal to place a start marker (command or custom marker) in a Pre content customisation and the corresponding end marker in the Post content customisation.

If you do make a mistake, TopLeaf will let you know when you try to save the mapping. There are a few more subtle errors that only appear after variable expansion. They will be flagged during the typesetting.