# Extension instructions

A Saxon extension instruction is invoked using a name such as `<saxon:localname>`.

The `saxon` prefix (or whatever prefix you choose to use) must be associated with the Saxon namespace URI `http://saxon.sf.net/`. The prefix must also be designated as an extension element prefix by including it in the `extension-element-prefixes` attribute on the `xsl:stylesheet` element, or the `xsl:extension-element-prefixes` attribute on any enclosing literal result element or extension element.

However, top-level elements such as `saxon:collation` and `saxon:script` can be used without designating the prefix as an extension element prefix.

The extension instructions and declarations are:

- saxon:assign: assigns a new value to a global variable

- saxon:call-template: calls a template whose name is decided at run-time

- saxon:collation: names and describes a collating sequence

- saxon:doctype: constructs a serialized DOCTYPE declaration

- saxon:import-query: imports functions from an XQuery library module

- saxon:entity-ref: creates an entity reference in the serialized output

- saxon:script: declares an extension function

- saxon:while: iterates until a condition becomes false

Expand |