OwS Style Sheet Directive: stylemapping: Unterschied zwischen den Versionen
(Die Seite wurde neu angelegt: „== Syntax == <font face="courier"> {|border="0" |- style="vertical-align:top" | style="width:10em" | ''StyleMappingDirective'' | style="width:3em" | := | s…“) |
K (→Syntax) |
||
| (2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 20: | Zeile 20: | ||
| | | | ||
| | | | ||
| + | |- style="vertical-align:top" | ||
| + | | | ||
| + | | style="text-align:right" | | | ||
| + | | [[OwS Statement: Base Types|''StyleName'']] ''':''' '''*''' | ||
| + | | | ||
| + | | <font face="arial" size="2">An asterisk signals that any text matches the trigger as long as the style matches</font> | ||
|- style="vertical-align:top" | |- style="vertical-align:top" | ||
| ''SourceStyleName'' | | ''SourceStyleName'' | ||
| Zeile 35: | Zeile 41: | ||
</font> | </font> | ||
<hr> | <hr> | ||
| + | |||
| + | == 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): | ||
| + | |||
| + | {| | ||
| + | |- | ||
| + | |style="background:#fff588"|'''Dokumentationscodes'''<br> | ||
| + | A551: Ausdauertraining mit Monitoring in der Gruppe<br> | ||
| + | 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: | ||
| + | <pre> | ||
| + | #stylemapping Standard : Dokumentationscodes => Standard => Level3Concept | ||
| + | #pattern Level3Concept => %c : %n => define concept (%n) { set .Code = %c } | ||
| + | </pre> | ||
| + | |||
| + | 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 == | ||
| + | |||
| + | * [[OwS StyleMapping Directive - Example 1|Linking of Infectious Diseases with Diagnoses and Methods]] | ||
Aktuelle Version vom 13. Oktober 2016, 15:47 Uhr
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 |
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.