stylesheet

The stylesheet is the root of the document and encloses the entire group of templates. There should be only one stylesheet definition for each file. Any stylesheet statements that occur after the first declaration are ignored.

Syntax
<stylesheet> ::= "stylesheet" "{" "version" <version number> ( "id" <name> )? <output>? ( <name space def> | <attribute set> | <decimal format> | <exclude result prefixes> | <import> | <include> | <key> | <namespace alias> | <parameter> | <preserve space> | <script> | <strip space> | <variable> | <matcher> | <proc> )* "}"
Options

None.

Elements

It is wise to consult the documentation for the XSLT processor being used for restrictions on the various compnents suported.

version The version number of the XSLT required by this stylesheet. Currently "1.0" or "1.1".
id An optional id for the stylesheet.
exclude result prefixes A space separated list of namespace prefixes that should not be sent to the output document.
name space def An optional namespace used within the stylesheet. Note that the namespaces for "xml" and "xsl" are added by the Rexsel uncompiler and may need to be removed manually.
Examples

For example the skeleton of a Rexsel stylesheet is

stylesheet { version "1.0" }

would give the following XSLT. The "xmlns:xsl" namespace is automatically added to the output

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"/>
Errors

Note that the version declaration is required and will generate an error if not there.

stylesheet { }

will give the errors

**** (148) "stylesheet" requires "version" in line 1 Check syntax requirements for "stylesheet" **** (138) Missing or empty block in 1 Supply block

Any statements that are invalid within a stylesheet declaration are reported as an error.

stylesheet { version "1.0" element "div" { } }

would return

**** (106) Unexpected symbol "element" instead of "include, xmlns, decimal-format, namespace-alias, parameter, preserve-space, proc, import, key, version, strip-space, id, script, output, match, attribute-set, number, variable" in "stylesheet" in line 4 Check spelling, missing expression, bracket or quote?\end{Verbatim}
Copyright 2024 Hugh Field-Richards. All Rights Reserved.