HOME

TheInfoList



OR:

Streaming Transformations for XML (STX) is an
XML transformation language An XML transformation language is a programming language designed specifically to transform an ''input'' XML document into an ''output'' document which satisfies some specific goal. There are two special cases of transformation: * XML to XML: ...
intended as a high-speed, low memory consumption alternative to
XSLT XSLT (Extensible Stylesheet Language Transformations) is a language originally designed for transforming XML documents into other XML documents, or other formats such as HTML for web pages, plain text or XSL Formatting Objects, which may subse ...
version 1.0 and 2.0. Current work on XSLT 3.0 includes Streaming capabilities.


Overview

STX is an
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. ...
standard for efficient processing of stream-based XML. Basic XSLT is not well suited to stream based processing, and STX fills this niche. Conventional XML processing involves loading the entire XML document into memory for use. In contrast, SAX streams XML events such as "open element," "close element," and "text node" so that other software can begin interpreting information immediately, before the end of the file is reached. Unfortunately some software can't effectively use XML fragments this way and must build up the whole document to begin processing. So is the case with XSLT. Because XSLT's
XPath XPath (XML Path Language) is an expression language designed to support the query or transformation of XML documents. It was defined by the World Wide Web Consortium (W3C) and can be used to compute values (e.g., strings, numbers, or Boolean v ...
can select any node throughout the document it must have the entire document available in memory. STX only allows queries immediately surrounding the current node so it can quickly start transforming and outputting SAX event nodes as they arrive. As it can discard nodes immediately after processing, memory use is significantly lower than that of XSLT. Having a limited query scope is a defining characteristic of STX. This architectural decision intentionally marginalises STX as a niche language. Indeed, it would be wrong to say that STX is a general purpose transformation language; however, if your transformation needs can be met by STX then it's an efficient and smart choice.


Specifications

STX's query language is called STXPath and is based on
XPath 2.0 XPath 2.0 is a version of the XPath language defined by the World Wide Web Consortium, W3C. It became a recommendation on 23 January 2007. As a W3C Recommendation it was superseded by XPath 3.0 on 10 April 2014. XPath is used primarily for sele ...
. Implementations of STX are available in
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
and
Perl Perl is a family of two High-level programming language, high-level, General-purpose programming language, general-purpose, Interpreter (computing), interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it ...
.


Similar projects

Unlike STX which is declared using an XML syntax, these two projects associate SAX events with
callback Callback may refer to: * Callback (comedy), a joke which refers to one previously told * Callback (computer programming), executable code that is passed as a parameter to other code * Callback (telecommunications), the telecommunications event tha ...
functions: * Xineo OAX *
SAX Adapter Sax or SAX may refer to: * Saxophone (or sax), a family of woodwind instruments People * Oett M. Mallard (1915–1986), also known as Sax Mallard, Chicago-based jazz saxophonist and bandleader * Lincoln Thompson (1949–1999), Jamaican reggae ...


External links


STX home page


XML-based standards