Book HomeJava and XSLTSearch this book

Appendix C. XSLT Quick Reference

This appendix provides a quick reference to the XSLT markup language. Each element is listed in alphabetical order, along with a reference to the appropriate section in Version 1.0 of the XSLT specification available at http://www.w3.org/TR/xslt.

Attributes are shown along with their allowable values, and square brackets indicate optional attributes. Values enclosed in curly braces are treated as attribute value templates, and quoted values are literals. XML-style comments indicate which elements allow content and the allowable type of that content.

<xsl:apply-imports>

<xsl:apply-imports/>

See XSLT specification section 5.6: "Overriding Template Rules." http://www.w3.org/TR/xslt#apply-imports

<xsl:apply-templates>

<xsl:apply-templates
    [select = node-set-expression]
    [mode = qname]>
  <!-- Content: Any number of <xsl:sort> or <xsl:with-param> -->
</xsl:apply-templates>

See XSLT specification section 5.4: "Applying Template Rules." http://www.w3.org/TR/xslt#section-Applying-Template-Rules

<xsl:attribute>

<xsl:attribute
    name = {qname}
    [namespace = {uri-reference}]>
  <!-- Content: template -->
</xsl:attribute>

See XSLT specification section 7.1.3: "Creating Attributes with <xsl:attribute>." http://www.w3.org/TR/xslt#creating-attributes

<xsl:attribute-set>

<xsl:attribute-set
    name = qname
    [use-attribute-sets = qnames]>
  <!-- Content: Any number of <xsl:attribute> -->
</xsl:attribute-set>

See XSLT specification section 7.1.4: "Named Attribute Sets." http://www.w3.org/TR/xslt#attribute-sets

<xsl:call-template>

<xsl:call-template
    name = qname>
  <!-- Content: Any number of <xsl:with-param> -->
</xsl:call-template>

See XSLT specification section 6: "Named Templates." http://www.w3.org/TR/xslt#named-templates

<xsl:choose>

<xsl:choose>
 <!-- Content: One or more <xsl:when>, followed by an optional <xsl:otherwise> -->
</xsl:choose>

See XSLT specification section 9.2: "Conditional Processing with <xsl:choose>." http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:choose

<xsl:comment>

<xsl:comment>
  <!-- Content: template -->
</xsl:comment>

See XSLT specification section 7.4: "Creating Comments." http://www.w3.org/TR/xslt#section-Creating-Comments

<xsl:copy>

<xsl:copy
    [use-attribute-sets = qnames]>
  <!-- Content: template -->
</xsl:copy>

See XSLT specification section 7.5: "Copying." http://www.w3.org/TR/xslt#copying

<xsl:copy-of>

<xsl:copy-of
    select = expression/>

See XSLT specification section 11.3: "Using Values of Variables and Parameters with <xsl:copy-of>." http://www.w3.org/TR/xslt#copy-of

<xsl:decimal-format>

<xsl:decimal-format
    [name = qname]
    [decimal-separator = char]
    [grouping-separator = char]
    [infinity = string]
    [minus-sign = char]
    [NaN = string]
    [percent = char]
    [per-mille = char]
    [zero-digit = char]
    [digit = char]
    [pattern-separator = char]/>

See XSLT specification section 12.3: "Number Formatting." http://www.w3.org/TR/xslt#format-number

<xsl:element>

<xsl:element
    name = {qname}
    [namespace = {uri-reference}]
    [use-attribute-sets = qnames]>
  <!-- Content: template -->
</xsl:element>

See XSLT specification section 7.1.2: "Creating Elements with <xsl:element>." http://www.w3.org/TR/xslt#section-Creating-Elements-with-xsl:element

<xsl:fallback>

<xsl:fallback>
  <!-- Content: template -->
</xsl:fallback>

See XSLT specification section 15: "Fallback." http://www.w3.org/TR/xslt#fallback

<xsl:for-each>

<xsl:for-each
    select = node-set-expression>
  <!-- Content: Any number of <xsl:sort>, followed by template -->
</xsl:for-each>

See XSLT specification section 8: "Repetition." http://www.w3.org/TR/xslt#for-each

<xsl:if>

<xsl:if
    test = boolean-expression>
  <!-- Content: template -->
</xsl:if>

See XSLT specification section 9.1: "Conditional Processing with <xsl:if>." http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:if

<xsl:import>

<xsl:import
    href = uri-reference/>

See XSLT specification section 2.6.2: "Stylesheet Import." http://www.w3.org/TR/xslt#import

<xsl:include>

<xsl:include
    href = uri-reference/>

See XSLT specification section 2.6.1: "Stylesheet Inclusion." http://www.w3.org/TR/xslt#include

<xsl:key>

<xsl:key
    name = qname
    match = pattern
    use = expression/>

See XSLT specification section 12.2: "Keys." http://www.w3.org/TR/xslt#key

<xsl:message>

<xsl:message
    [terminate = "yes" or "no"]>
  <!-- Content: template -->
</xsl:message>

See XSLT specification section 13: "Messages." http://www.w3.org/TR/xslt#message

<xsl:namespace-alias>

<xsl:namespace-alias
    stylesheet-prefix = prefix or "#default"
    result-prefix = prefix or "#default"/>

See XSLT specification section 7.1.1: "Literal Result Elements." http://www.w3.org/TR/xslt#literal-result-element

<xsl:number>

<xsl:number
    [level = "single" or "multiple" or "any"]
    [count = pattern]
    [from = pattern]
    [value = number-expression]
    [format = {string}]
    [lang = {nmtoken}]
    [letter-value = {"alphabetic" or "traditional"}]
    [grouping-separator = {char}]
    [grouping-size = {number}]/>

See XSLT specification section 7.7: "Numbering." http://www.w3.org/TR/xslt#number

<xsl:otherwise>

<xsl:otherwise>
  <!-- Content: template -->
</xsl:otherwise>

See XSLT specification section 9.2: "Conditional Processing with <xsl:choose>." http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:choose

<xsl:output>

<xsl:output
    [method = "xml" or "html" or "text" or qname-but-not-ncname]
    [version = nmtoken]
    [encoding = string]
    [omit-xml-declaration = "yes" or "no"]
    [standalone = "yes" or "no"]
    [doctype-public = string]
    [doctype-system = string]
    [cdata-section-elements = qnames]
    [indent = "yes" or "no"]
    [media-type = string]/>

See XSLT specification section 16: "Output." http://www.w3.org/TR/xslt#output

<xsl:param>

<xsl:param
    name = qname
    [select = expression]>
  <!-- Content: template -->
</xsl:param>

See XSLT specification section 11: "Variables and Parameters." http://www.w3.org/TR/xslt#variables

<xsl:preserve-space>

<xsl:preserve-space
    elements = tokens/>

See XSLT specification section 3.4: "Whitespace Stripping." http://www.w3.org/TR/xslt#strip

<xsl:processing-instruction>

<xsl:processing-instruction
    name = {ncname}>
  <!-- Content: template -->
</xsl:processing-instruction>

See XSLT specification section 7.3: "Creating Processing Instructions." http://www.w3.org/TR/xslt#section-Creating-Processing-Instructions

<xsl:sort>

<xsl:sort
    [select = string-expression]
    [lang = {nmtoken}]
    [data-type = {"text" or "number" or qname-but-not-ncname}]
    [order = {"ascending" or "descending"}]
    [case-order = {"upper-first" or "lower-first"}]/>

See XSLT specification section 10: "Sorting." http://www.w3.org/TR/xslt#sorting

<xsl:strip-space>

<xsl:strip-space
    elements = tokens/>

See XSLT specification section 3.4: "Whitespace Stripping." http://www.w3.org/TR/xslt#strip

<xsl:stylesheet>

<xsl:stylesheet
    version = number
    [id = id]
    [extension-element-prefixes = tokens]
    [exclude-result-prefixes = tokens]>
  <!-- Content: Any number of <xsl:import>, followed by top-level-elements -->
</xsl:stylesheet>

See XSLT specification section 2.2: "Stylesheet Element." http://www.w3.org/TR/xslt#stylesheet-element

<xsl:template>

<xsl:template
    [match = pattern]
    [name = qname]
    [priority = number]
    [mode = qname]>
  <!-- Content: Any number of <xsl:param>, followed by template -->
</xsl:template>

See XSLT specification section 5.3: "Defining Template Rules." http://www.w3.org/TR/xslt#section-Defining-Template-Rules

<xsl:text>

<xsl:text
    [disable-output-escaping = "yes" or "no"]>
  <!-- Content: #PCDATA -->
</xsl:text>

See XSLT specification section 7.2: "Creating Text." http://www.w3.org/TR/xslt#section-Creating-Text

<xsl:transform>

<xsl:transform
    version = number
    [id = id]
    [extension-element-prefixes = tokens]
    [exclude-result-prefixes = tokens]>
  <!-- Content: Any number of <xsl:import>, followed by top-level-elements -->
</xsl:transform>

See XSLT specification section 2.2: "Stylesheet Element." http://www.w3.org/TR/xslt#stylesheet-element

<xsl:value-of>

<xsl:value-of
    select = string-expression
    [disable-ouput-escaping = "yes" or "no"]/>

See XSLT specification section 7.6.1: "Generating Text with <xsl:value-of>." http://www.w3.org/TR/xslt#value-of

<xsl:variable>

<xsl:variable
    name = qname
    [select = expression]>
  <!-- Content: template -->
</xsl:variable>

See XSLT specification section 11: "Variables and Parameters." http://www.w3.org/TR/xslt#variables

<xsl:when>

<xsl:when
    test = boolean-expression>
  <!-- Content: template -->
</xsl:when>

See XSLT specification section 9.2: "Conditional Processing with xsl:choose." http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:choose

<xsl:with-param>

<xsl:with-param
    name = qname
    [select = expression]>
  <!-- Content: template -->
</xsl:with-param>

See XSLT specification section 11.6: "Passing Parameters to Templates." http://www.w3.org/TR/xslt#section-Passing-Parameters-to-Templates



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.