Markup source data type

A markup source produces a markup stream; that is, a stream of data content that includes markup events. markup source is a supertype of string source, so a string source may be used anywhere a markup source is expected.

The following actions and operators can be used with markup source.

  • do markup-parse accepts markup source as its argument.
  • using input as accepts markup source as its argument.
  • The put action accepts a markup source as its right-hand argument only if the destination (its left-hand argument) is a markup sink.
  • The output action accepts a markup source. As a result, #current-output is a markup sink.
  • Two markup source expressions may be joined using the || operator. The result will be a markup source expression.
  • The drop, matches, and take operators accept a markup source on their left-hand side. The result of take is always a string source and the result of drop is the same type as its first argument.
  • There is a built-in markup source cast operator that tries to invoke an appropriate user-defined conversion-function. OmniMark will automatically convert from a string source to a markup source, but to convert from markup source to string source, string, integer, or any other data type, the user must define a conversion function.

The following actions and operators work only on string source values.

  • The scanning actions, submit, do scan and repeat scan, will only accept a string source argument; they will not accept a markup source.
  • The parsing actions, do sgml-parse and do xml-parse, will only accept a string source argument; they will not accept a markup source.
  • The ||* and repeated operators cannot be used with a markup source expression on their left hand side, though a user may define the markup source overloading of ||* if required.
  • Comparison operators do not work with markup source.