{{{ #!rst ============== Markup Streams ============== A stream is the common representation of markup as a *stream of events*. .. contents:: Contents :depth: 2 .. sectnum:: Basics ====== A stream can be attained in a number of ways. It can be: * the result of parsing XML or HTML text, or * programmatically generated, or * the result of selecting a subset of another stream filtered by an XPath expression. For example, the functions ``XML()`` and ``HTML()`` can be used to convert literal XML or HTML text to a markup stream:: >>> from markup import XML >>> stream = XML('
Some text and '
... 'a link.'
... '
Some text and a link.
Some text and a link.