XML Patterns

Generated Text Pattern

Synopsis

The Generated Text Pattern is used when text must be rendered but is not itself included in the XML document. The markup must support the generation of the correct text at the correct place, and may allow the text to be supplied in the document in order to override the automatic generation algorithm.

Actors

The Generated Text Pattern has one participant:

Running Text or block level elements
The environment in which the pattern occurs
text marker
The object serving as an external annotation

Any piece of XML markup may use this pattern, usually via a style sheet.

Markup

Generated Text is not marked up directly in the document, since it is not there. If a default value is to be supplied, it may be given in an attribute value or in a sub­element.

Generated text may be constant for all occurrences of a given element, such as See also inserted before the content of an <xref> element.

Generated text such as a number for a list item may be derived automatically from an attribute value in the content, such as where

<paragraph n="14">Item for discussion

is rendered as:

xiv: Item for discussion

If the value for generated text may have to contain markup or formatting, it will have to be supplied in element content and not in an attribute:

     <Requirements>
      <label>X<sup>4</sup> Optional Requirements Phase</label>
      . . .
     </Requirements>
   

Processing

Formatting software generally has to see a start tag or empty element tag at the point at which the Generated Text is to appear. This means that if a group of similar items need to have a Generated Text heading, there should normally be a Container Element grouping the related items, and the generated text produced when the start tag for the container element is seen.


See Also

Container Pattern