Browsable XSLT Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: xmlware/xslt/clark/extracted
Source used for this grammar: James Clark, XSLT 1.0 in RELAX NG, xslt.rng, 28-Oct-2008 [Source]

Summary

Syntax

version ::=
	"1.0"
top-level-elements.model ::=
	(top-level-element.category | top-level-extension)*
any ::=
	(α | string | any)*
top-level-extension ::=
	any
template.model ::=
	(instruction.category | literal-result-element | string)*
literal-result-element-as-stylesheet ::=
	[version]::version literal-result-element-no-version.atts template.model
literal-result-element ::=
	literal-result-element.atts template.model
literal-result-element.atts ::=
	literal-result-element-no-version.atts [version]::version?
literal-result-element-no-version.atts ::=
	(avt.datatype | [extension-element-prefixes]::prefixes.datatype | [exclude-result-prefixes]::prefixes.datatype | [use-attribute-sets]::qnames.datatype)*
top-level-element.category ::=
	include.element
	strip-space.element
	preserve-space.element
	template.element
	namespace-alias.element
	attribute-set.element
	variable.element
	param.element
	key.element
	decimal-format.element
	output.element
instruction.category ::=
	apply-templates.element
	apply-imports.element
	call-template.element
	element.element
	attribute.element
	text.element
	processing-instruction.element
	comment.element
	copy.element
	value-of.element
	number.element
	for-each.element
	if.element
	choose.element
	variable.element
	copy-of.element
	message.element
	fallback.element
extension.atts ::=
	α*
stylesheet.element ::=
	[stylesheet]::stylesheet.model
transform.element ::=
	[transform]::stylesheet.model
stylesheet.model ::=
	extension.atts [id]::string? [extension-element-prefixes]::prefixes.datatype? [exclude-result-prefixes]::prefixes.datatype? [version]::version import.element* top-level-elements.model
include.element ::=
	[include]::(extension.atts [href]::string)
import.element ::=
	[import]::(extension.atts [href]::string)
strip-space.element ::=
	[strip-space]::(extension.atts [elements]::wildcards.datatype)
preserve-space.element ::=
	[preserve-space]::(extension.atts [elements]::wildcards.datatype)
template.element ::=
	[template]::(extension.atts [match]::pattern.datatype? [name]::qname.datatype? [priority]::number.datatype? [mode]::qname.datatype? param.element* template.model)
apply-templates.element ::=
	[apply-templates]::(extension.atts [select]::expression.datatype? [mode]::qname.datatype? (sort.element | with-param.element)*)
apply-imports.element ::=
	[apply-imports]::extension.atts
call-template.element ::=
	[call-template]::(extension.atts [name]::qname.datatype with-param.element*)
namespace-alias.element ::=
	[namespace-alias]::(extension.atts [stylesheet-prefix]::prefix.datatype [result-prefix]::prefix.datatype)
element.element ::=
	[element]::(extension.atts [name]::(qname.datatype | expr-avt.datatype) [namespace]::(string | brace-avt.datatype)? [use-attribute-sets]::qnames.datatype? template.model)
attribute.element ::=
	[attribute]::(extension.atts [name]::(qname.datatype | expr-avt.datatype) [namespace]::(string | brace-avt.datatype)? template.model)
attribute-set.element ::=
	[attribute-set]::(extension.atts [name]::qname.datatype [use-attribute-sets]::qnames.datatype? attribute.element*)
text.element ::=
	[text]::(extension.atts [disable-output-escaping]::("yes" | "no")? string)
processing-instruction.element ::=
	[processing-instruction]::(extension.atts [name]::(string | expr-avt.datatype) template.model)
comment.element ::=
	[comment]::(extension.atts template.model)
copy.element ::=
	[copy]::(extension.atts [use-attribute-sets]::qnames.datatype? template.model)
value-of.element ::=
	[value-of]::(extension.atts [select]::expression.datatype [disable-output-escaping]::("yes" | "no")?)
number.element ::=
	[number]::(extension.atts [level]::("single" | "multiple" | "any")? [count]::pattern.datatype? [from]::pattern.datatype? [value]::expression.datatype? [format]::avt.datatype? [lang]::(string | expr-avt.datatype)? [letter-value]::("alphabetic" | "traditional" | expr-avt.datatype)? [grouping-separator]::(char.datatype | expr-avt.datatype)? [grouping-size]::(number.datatype | expr-avt.datatype)?)
for-each.element ::=
	[for-each]::(extension.atts [select]::expression.datatype sort.element* template.model)
if.element ::=
	[if]::(extension.atts [test]::expression.datatype template.model)
choose.element ::=
	[choose]::(extension.atts when.element+ otherwise.element?)
when.element ::=
	[when]::(extension.atts [test]::expression.datatype template.model)
otherwise.element ::=
	[otherwise]::(extension.atts template.model)
sort.element ::=
	[sort]::(extension.atts [select]::expression.datatype? [lang]::(string | expr-avt.datatype)? [data-type]::("text" | "number" | qname-but-not-ncname.datatype | expr-avt.datatype)? [order]::("ascending" | "descending" | expr-avt.datatype)? [case-order]::("upper-first" | "lower-first" | expr-avt.datatype)?)
variable.element ::=
	[variable]::(extension.atts [name]::qname.datatype ([select]::expression.datatype | template.model))
param.element ::=
	[param]::(extension.atts [name]::qname.datatype ([select]::expression.datatype | template.model))
copy-of.element ::=
	[copy-of]::(extension.atts [select]::expression.datatype)
with-param.element ::=
	[with-param]::(extension.atts [name]::qname.datatype ([select]::expression.datatype | template.model))
key.element ::=
	[key]::(extension.atts [name]::qname.datatype [match]::pattern.datatype [use]::expression.datatype)
decimal-format.element ::=
	[decimal-format]::(extension.atts [name]::qname.datatype? [decimal-separator]::char.datatype? [grouping-separator]::char.datatype? [infinity]::string? [minus-sign]::char.datatype? [NaN]::string? [percent]::char.datatype? [per-mille]::char.datatype? [zero-digit]::char.datatype? [digit]::char.datatype? [pattern-separator]::char.datatype?)
message.element ::=
	[message]::(extension.atts [terminate]::("yes" | "no")? template.model)
fallback.element ::=
	[fallback]::(extension.atts template.model)
output.element ::=
	[output]::(extension.atts [method]::("xml" | "html" | "text" | qname-but-not-ncname.datatype)? [version]::string? [encoding]::string? [omit-xml-declaration]::("yes" | "no")? [standalone]::("yes" | "no")? [doctype-public]::string? [doctype-system]::string? [cdata-section-elements]::qnames.datatype? [indent]::("yes" | "no")? [media-type]::string?)
prefixes.datatype ::=
	(string | "#default")*
prefix.datatype ::=
	string
	"#default"
wildcards.datatype ::=
	string*
qname.datatype ::=
	string
qnames.datatype ::=
	string*
char.datatype ::=
	string
number.datatype ::=
	integer
expression.datatype ::=
	string
pattern.datatype ::=
	string
qname-but-not-ncname.datatype ::=
	string
expr-avt.datatype ::=
	string
brace-avt.datatype ::=
	string
avt.datatype ::=
	string

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []