![]() |
|
||||
![]() ![]() ![]() ![]() |
|||||
|
|
|||||
| Related Syntax | |||||
Co-routines |
|||||
OmniMark has the capability to run processes as co-routines. Co-routines occurs whenever a program is generating markup which is then fed to the XML or SGML parser. This occurs in up-translate and context-translate programs, in programs that do subdocument processing, and in programs that use an string source function to supply input to the parser in a do xml-parse and do sgml-parse.
The use of co-routines has three principal advantages:
For the most part, you do not need to concern yourself with the mechanics of co-routines. OmniMark handles all the details for you. However, there are some important restrictions you need to be aware of:
save and save-clear operations are specific to the co-routine in which they occur.
do xml-parse and do sgml-parse in an string source function or in the find rules of an up-translate or context-translate program (unless those rules are processing the results of a submit action initiated in a markup rule, and therefore acting on the output of the parser rather than the input).
domain-free modifier. Note that it may not always be obvious which co-routine a certain piece of code is running in. For instance, a find rule that could be fired either by the main input of a cross-translate or up-translate program, or by input from a submit action in a markup rule would be in one co-routine in the first instance and in another co-routine in the second instance.
using nested-referents can only be used in one co-routine at a time.
If you write code that depends on the interaction between two co-routines, you may need to be aware of the rules OmniMark uses when switching from one co-routine to another.
element is test.
repeat over loop or a using block applied to the attributes shelf, the data-attributes shelf, or a list-valued attributes shelf.
|
Related Syntax do sgml-parse |
Copyright © Stilo International plc, 1988-2008.