OwS Style Sheet Directive: stylemapping

Aus CTS2-LE
Version vom 13. Oktober 2016, 15:47 Uhr von Caumanns (Diskussion | Beiträge) (Syntax)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Syntax

StyleMappingDirective := #stylemapping Trigger => SourceStyleName => TargetStyleName  
| #stylemapping Trigger
Trigger := StyleName : Text
| StyleName : * An asterisk signals that any text matches the trigger as long as the style matches
SourceStyleName := StyleName
TargetStyleName := StyleName


Description

The stylemapping directive changes the formatting of text parapgrahs from a SourceStyleName to a TargetStyleName whenever a defined Trigger is discoverd within a document. The Trigger for activating the mapping is a text formatted in a defined style. The style mapping is active until

  • another Trigger is activated or
  • the style sheet of a paragraph is not defined as a SourceStyleName for a mapping.

This directive is especially useful for processing existing documents where different property values can be detected through intermediate headings or specific introductional texts.

E.g. in the original specification of the Katalog der Therapeutischen Leistungen level-3 concepts are defined within level-2 concepts as follows (all text formatted with the Standard style sheet):

Dokumentationscodes

A551: Ausdauertraining mit Monitoring in der Gruppe
A552: Ausdauertraining ohne Monitoring in der Gruppe

One possibility for turning the Dokumentationscodes into OwS define statements would be to define a dedicated pattern or heading and then to format all occurences of such concept definition with the newly defined style or heading. Given that there are some hundreds of such concept definitions this is a errorprone work and makes it had to further maintain the document. The #stylemapping directive makes this much easier:

#stylemapping Standard : Dokumentationscodes => Standard => Level3Concept
#pattern Level3Concept => %c : %n => define concept (%n) { set .Code = %c }

The first directive directs the OwS tokenizer to look out for the phrase "Dokumentationscodes" formatted with the style sheet "Standard". Whenever it detects such a paragraph, all following paragraphs formatted as "Standard" will be considered as being formatted withthe style sheet "Level3Concept". The second directive then tells how to handle any text formatted as "Level3Concept": extract code and name from the text and assemble a concept defnition from these values.

Beispiele