5. Stylesheet template

Example 9. General structure of XSieve stylesheets

<x:stylesheet
  xmlns:x = "http://www.w3.org/1999/XSL/Transform"  1
  xmlns:s = "http://xsieve.sourceforge.net"         2
  extension-element-prefixes="s"                    3
  version = "1.0">
<!-- -->

<s:init>                     4
  ... initialization code ...
</s:init>

<x:template match="...">     5
  ... XSLT code ...
</x:template>

<x:template match="...">
  ... XSLT code ...
  <s:scheme>                 6
    ... Scheme code ...
  </s:scheme>
  ... XSLT code ...
</x:template>

</x:stylesheet>
1

Defining the XSLT namespace

2

Defining the XSieve Scheme namespace

3

Notifying xsltproc that s prefix is used for extending XSLT

4

Scheme initialization code, if required

5

Any number of usual XSLT templates

6

Switching to Scheme