OwS Style Sheet Directive: obligation: Unterschied zwischen den Versionen

Aus CTS2-LE
Zur Navigation springen Zur Suche springen
Zeile 1: Zeile 1:
 +
The #obligation directive triggers the execution of a set of OwS statements whenever the OwS tokenizer discovers a paragraph of a certain style.
 +
 
== Syntax ==
 
== Syntax ==
 
   
 
   
Zeile 44: Zeile 46:
  
 
== Description ==
 
== Description ==
The #obligation directive triggers the execution of a set of OwS code whenever the OwS tokenizer discovers a paragraph of a certain style.  
+
The #obligation directive is a simplified variant of the #pattern directive. In contrast to the #pattern directive, #obligation can be used in conjunction with other directives. For this the most common scenario where #obligation is used is the postprocessing of object definitions that had been triggered by the #heading directive. A typical example is given below
 +
 
 +
{|style="background:#f8f8f8"
 +
|- style="background:#e8e8e8"
 +
! style="text-align:left; width:14em" | Style Sheet !!   !! style="text-align:left; width:40em" | Text !!   !! style="text-align:left" | ''Comment''
 +
|- style="vertical-align:top"
 +
| OwS|| ||style="background:f4f6f6"|
 +
  {|
 +
  |style="text-align:left; width:0em"|
 +
  |<span style="font-family:Courier;font-size:91%">#heading 2 concept .Name ( .Designation[Language=de] )</span>
 +
  |}
 +
|| || Comment
 +
|- style="vertical-align:top"
 +
| OwS|| ||style="background:f4f6f6"|
 +
  {|
 +
  |style="text-align:left; width:0em"|
 +
  |<span style="font-family:Courier;font-size:91%">#obligation Überschrift 2 => set me.Display = me.Name</span>
 +
  |}
 +
|| || Comment
 +
|- style="vertical-align:top"
 +
| Standard|| ||style="background:f4f6f6"|
 +
  {|
 +
  |style="text-align:left; width:0em"|
 +
  |<span style="font-family:Arial;font-size:100%">…</span>
 +
  |}
 +
|| || Comment
 +
|- style="vertical-align:top"
 +
| Überschrift 2|| ||style="background:f4f6f6"|
 +
  {|
 +
  |style="text-align:left; width:0em"|
 +
  |<span style="font-family:Arial;font-size:118%">'''Mammals (Säugetiere)'''</span>
 +
  |}
 +
|| || Comment
 +
|- style="vertical-align:top"
 +
| OwS.Definition|| ||style="background:f4f6f6"|
 +
  {|
 +
  |style="text-align:left; width:0em"|
 +
  |<span style="font-family:Arial;font-size:100%">Mammals are characterized by the possession of a neocortex (a region of the brain), hair, three middle ear bones and mammary glands.</span>
 +
  |}
 +
|| || Comment
 +
|}
 +
 +
 
  
 
== Examples ==
 
== Examples ==

Version vom 30. Dezember 2016, 13:18 Uhr

The #obligation directive triggers the execution of a set of OwS statements whenever the OwS tokenizer discovers a paragraph of a certain style.

Syntax

ObligationDirective := #obligation PrePostQualifier? StyleName => ExecutableCode  
| #obligation PrePostQualifier? StyleName de-registers all obligations for the given style and mode (pre/post)
PrePostQualifier := < Obligation is executed before a line of text with the given style is processed
| > Obligation is executed after a line of text with the given style is processed. This is the default behavior.
ExecutableCode := PackageName
| Text


Description

The #obligation directive is a simplified variant of the #pattern directive. In contrast to the #pattern directive, #obligation can be used in conjunction with other directives. For this the most common scenario where #obligation is used is the postprocessing of object definitions that had been triggered by the #heading directive. A typical example is given below

Style Sheet   Text   Comment
OwS
#heading 2 concept .Name ( .Designation[Language=de] )
Comment
OwS
#obligation Überschrift 2 => set me.Display = me.Name
Comment
Standard
Comment
Überschrift 2
Mammals (Säugetiere)
Comment
OwS.Definition
Mammals are characterized by the possession of a neocortex (a region of the brain), hair, three middle ear bones and mammary glands.
Comment


Examples