Markup sink data type

A markup sink consumes a markup stream; that is, a stream of data content that includes markup events. markup sink is a subtype of string sink; therefore, a markup sink can be used anywhere a string sink could be used.

Generally speaking, all actions and operators that work with string sink will also work with markup sink. There are a few things to keep in mind, however:

  • A put action that has a markup sink as its left hand argument can have either a markup sink or a string sink as its right hand argument. If the left hand argument is a string sink, though, then the right hand argument must also be a string sink.
  • The output-to action accepts a markup sink as well as a string sink with the same restrictions on scope-escaping.
  • The actions close, discard, and flush behave the same way on a markup sink as they would on a string sink. None of these actions works on a value argument.
  • The fork operator (&) can be used with markup sink arguments. If both arguments have markup sink type, then the result is also a markup sink. If one argument is a string sink, then the result is also a string sink.
  • The deprecated form of &, and, will accept markup sink arguments because they are a subtype of string sink. However, the result is always a string sink.
  • Any user-defined function that takes a string sink argument will also accept a markup sink in that position.
  • There is a built-in markup sink cast operator that tries to invoke an appropriate user-defined conversion function.