sgml-in, sgml-out

action

Syntax
sgml-in (string-expression | #none)

or

sgml-out (string-expression | #none)


Purpose

sgml-in is used to manipulate record boundaries that are passed to the #markup-parser stream. sgml-out is used to manipulate record boundaries that are passed from the SGML parser to the output. Only in very rare circumstances does an OmniMark program have to use these actions to override OmniMark's default behavior.

In SGML, a "record" is simply a line of text. The record boundaries are the characters that the SGML parser recognizes at the beginning and end of each line. For example, in MS-DOS systems, the record-end (RE) character is the line-end character, and the record-start (RS) character is the newline character. OmniMark's default behavior is to convert from the program's newline character ("%n") to SGML record boundaries on input to the SGML parser, and back to newline characters for text coming out of the SGML parser.

If you want to change which characters are recognized by the SGML parser as record boundary characters, you would use sgml-in to designate new characters. If you want to change which characters the SGML parser outputs as record boundary characters, you would use sgml-out to designate the characters.

For example, the following sgml-out actions change which characters the SGML parser outputs as record boundaries:

  sgml-out "%13#%10#"  ; "normal" record boundaries
  sgml-out "]%13#%10#["  ; surrounds each line (except for the first and last)  with square brackets

sgml-in may not be used in cross-translations. In all other OmniMark programs, it may never be used in markup-error rules.

sgml-out cannot be used in cross-translations. In other translations, it may be used only in markup rules, and is not allowed in markup-error rules.

Note that any change in the conversion of record boundaries by an sgml-in action takes effect immediately for subsequent characters written to the #markup-parser stream.

When #none is specified, the conversion of the newline sequence is suppressed.