Schema Central  >  XSLT 4.0  >  schema-for-xslt40.xsd  >  xsl:template
Advanced search
Need XSLT Help?

Recommended Reading:

Definitive XML Schema

 

Advanced XML Applications

 

xsl:template

Element information

Namespace: http://www.w3.org/1999/XSL/Transform

Schema document: schema-for-xslt40.xsd

Type: Anonymous

Properties: Global, Qualified

Content

Attributes

NameOccTypeDescriptionNotes
default-collation [0..1]xsl:uri-listfrom type xsl:generic-element-type
default-mode [0..1]xsl:default-mode-typefrom type xsl:generic-element-type
default-validation [0..1]xsl:validation-strip-or-preserveDefault value is "strip". from type xsl:generic-element-type
exclude-result-prefixes [0..1]xsl:prefix-list-or-allfrom type xsl:generic-element-type
expand-text [0..1]xsl:yes-or-nofrom type xsl:generic-element-type
extension-element-prefixes [0..1]xsl:prefix-listfrom type xsl:generic-element-type
use-when [0..1]xsl:expressionfrom type xsl:generic-element-type
xpath-default-namespace [0..1]xsd:anyURIfrom type xsl:generic-element-type
_default-collation [0..1]xsd:stringfrom type xsl:generic-element-type
_default-mode [0..1]xsd:stringfrom type xsl:generic-element-type
_default-validation [0..1]xsd:stringfrom type xsl:generic-element-type
_exclude-result-prefixes [0..1]xsd:stringfrom type xsl:generic-element-type
_expand-text [0..1]xsd:stringfrom type xsl:generic-element-type
_extension-element-prefixes [0..1]xsd:stringfrom type xsl:generic-element-type
_use-when [0..1]xsd:stringfrom type xsl:generic-element-type
_xpath-default-namespace [0..1]xsd:stringfrom type xsl:generic-element-type
Any attribute [0..*]Namespace: ##other, Process Contents: laxfrom type xsl:generic-element-type
version [0..1]xsd:decimalfrom type xsl:versioned-element-type
_version [0..1]xsd:stringfrom type xsl:versioned-element-type
match [0..1]xsl:pattern
priority [0..1]xsd:decimal
mode [0..1]xsl:modes
name [0..1]xsl:EQName
as [0..1]xsl:sequence-typeDefault value is "item()*".
visibility [0..1]xsl:visibility-not-hidden-type
_match [0..1]xsd:string
_priority [0..1]xsd:string
_mode [0..1]xsd:string
_name [0..1]xsd:string
_as [0..1]xsd:string
_visibility [0..1]xsd:string

Assertions

TestDescriptionNotes
exists(@match | @_match) or exists(@name | @_name)

An xsl:template element must have either a match attribute or a name attribute, or both.

if (empty(@match | @_match)) then (empty(@mode | @_mode) and empty(@priority | @_priority)) else true()

An xsl:template element that has no match attribute must have no mode attribute and no priority attribute.

not(exists(@visibility | @_visibility) and empty(@name | @_name))

An xsl:template element that has no name attribute must have no visibility attribute

if (normalize-space(@visibility) = 'abstract') then empty(* except (xsl:context-item, xsl:param)) else true()

If the visibility attribute is present with the value abstract then (a) the sequence constructor defining the template body must be empty: that is, the only permitted children are xsl:context-item and xsl:param

not(normalize-space(@visibility) = 'abstract' and exists(@match))

If the visibility attribute is present with the value abstract then there must be no match attribute.

every $e in xsl:param satisfies empty($e/(@visibility | @_visibility))

A parameter for a template must have no visibility attribute.

Used in

Substitution hierarchy