Summary

  • W3C issued XSLT 1.0 and XPath 1.0 as Recommendations on 16 November 1999. XSLT described rules for building a result tree from an XML source tree.
  • A template rule matched source nodes and created result structure. The output could filter or reorder source elements and add new structure while the source document kept its own arrangement.

Imagine a shop with apples, oranges and books in its stockroom. The owner wants oranges in the front window today, books beside the till tomorrow and apples on a separate catalogue page. A photograph of the stockroom is a poor publishing system. Rearranging the stockroom every morning is worse. The XSLT 1.0 Recommendation offered XML publishers a third option in 1999: keep a source tree of information, then build a different result tree according to rules.

The distinction was written into the specification's opening. A transformation describes how to move from a source tree to a result tree. The result is separate; its structure may be completely different. Source elements may be selected, omitted, reordered or wrapped in new structure. In shop terms, the warehouse ledger records what exists, while the display plan decides what the passer-by sees first. The display can change without falsifying the ledger.

XSLT's working unit was a template rule. One part was a pattern that matched nodes in the source; the other was a template that created part of the result. Instructions could select descendants and ask the processor to apply the relevant rules to them. This gave a publisher a repeatable way to say, for example, that each item in a collection should produce a particular piece of output. The author specified the rearrangement once instead of manually constructing every view from scratch.

The companion XPath 1.0 Recommendation supplied expressions for locating and addressing parts of an XML document. That mattered because a display rule is useful only if it can say which source piece it means. A template may care about an item node, a price below it or all items in a chosen group. XSLT used those paths and selections to turn a document's internal order into a deliberate output order.

The word stylesheet can make this sound like a change of paint. The machinery went further. The result tree could acquire new elements, drop others and place the survivors in another sequence. XSLT 1.0 also described output methods for XML, HTML and plain text through xsl:output. A publisher could prepare an HTML-facing view from XML data or produce a text listing. The processor built the result before any final serialization; the transformed tree was the real editorial decision.

W3C announced XSLT and XPath together on 16 November 1999. That pairing gave the Web a way to point into structured information and a way to build something new from what it found. A catalogue could change its front page without changing its inventory document. The display window gained a schedule; the stockroom stopped having to move its shelves every time the editor changed a headline.