XML technologies / XSLT / XSLT 3.0 / XSLT streaming / Why streaming?
Streaming may be necessary for several reasons when processing XML files. There are three factors requiring streaming.
File size
Type of input file
Type of output file
Traditional XML transformation parses the entire file and loads it into memory, so very large XML files require correspondingly large memory. Efficient parsing requires 3 to 10 times the XML file’s size in memory (see Michael Kay, Streaming in XSLT 2.1., in XML Prague 2010 Conference Prodeedings, February 2010, XML Prague 2010, p. 4). Streaming can process files too large for memory. The XML file is effectively processed on the fly.
Some input files are not complete finished files but streams, such as continuously updated weather data, logs or live football reporting. Streaming lets the processor produce output before all input has been read. Parallel handling of input and output also substantially reduces latency.
Disadvantages include processing that is 1.2 to 1.3 times slower (see Jakub Malý, Parallel XSLT Processing of Large Documents., in XML Prague 2015 Conference Prodeedings, February 2015, XML Prague 2015, p. 15) than traditional processing, and restrictions on the available instructions. These are described in more detail under Streamability rules.
Above a certain file size, or when input exists only as a stream, streaming is the only way to transform it. The alternative would be to forgo processing the file entirely.