XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (241 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
4.38Mb size Format: txt, pdf, ePub
ads

Format

  id? = 
id

  default-collation? = 
uri-list

  default-validation? = “preserve” | “strip”

  exclude-result-prefixes? = 
tokens

  extension-element-prefixes? = 
tokens

  input-type-annotations? = “preserve” | “strip” | “unspecified”

  use-when? = 
expression

  version = 
number

  xpath-default-namespace? = 
uri

  


Position


(or its synonym,

) appears as the outermost element of every stylesheet module, except one that uses the
simplified–stylesheet
syntax described on page 125, in Chapter 3. It is used both on a principal stylesheet module and on one that is imported or included into another module.

As described in Chapter 3, a stylesheet can be embedded in another XML document. In this case the

element still forms the root of the stylesheet module, but it is no longer the outermost element of an XML document.

Namespace Declarations

There will always be at least one namespace declaration on the

element, typically:

xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”

This defines the
XSLT Namespace
, which is necessary to identify the document as an XSLT stylesheet. The URI part must be written exactly as shown. The prefix
xsl
is conventional and is used in all XSLT documentation, including this book and the standard itself, but you could choose a different prefix if you wanted; for example,
XSLT
. You would then have to name the element

instead of

.

You can also make this the default namespace by using the following declaration:

xmlns=“http://www.w3.org/1999/XSL/Transform”

In this case the element name will simply be

, and other XSLT elements will similarly be unprefixed; for example,