Browsable XSD Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: xmlware/xsd/tennison/extracted
Source used for this grammar: Jeni Tennison, RELAX NG schema for XML Schema, 12 Oct 2010 [Source]

Summary

Syntax

openAttrs ::=
	string*
annotated ::=
	openAttrs [id]::string? annotation?
schemaTop ::=
	redefinable
	topLevelElement
	topLevelAttribute
	notation
redefinable ::=
	topLevelSimpleType
	topLevelComplexType
	namedGroup
	namedAttributeGroup
formChoice ::=
	"qualified"
	"unqualified"
reducedDerivationControl ::=
	("extension" | "restriction")*
derivationSet ::=
	"#all"
	reducedDerivationControl
allNNI ::=
	integer
	"unbounded"
occurs ::=
	([minOccurs]::integer | [maxOccurs]::allNNI)*
typeDefParticle ::=
	groupRef
	all
	choice
	sequence
nestedParticle ::=
	localElement
	groupRef
	choice
	sequence
	any
fixedOrDefault ::=
	ε
	[fixed]::string
	[default]::string
attributeType ::=
	ε
	[type]::string
	localSimpleType
localAttribute ::=
	[attribute]::(annotated [use]::("optional" | "prohibited" | "required")? fixedOrDefault ([ref]::string | [name]::string [form]::formChoice? attributeType))
topLevelAttribute ::=
	[attribute]::(annotated [name]::string fixedOrDefault attributeType)
attrDecls ::=
	(localAttribute | attributeGroupRef)* anyAttribute?
anyAttribute ::=
	[anyAttribute]::wildcard
complexTypeModel ::=
	simpleContent
	[mixed]::("true" | "false")? (complexContent | typeDefParticle? attrDecls)
complexType ::=
	annotated complexTypeModel
topLevelComplexType ::=
	[complexType]::(complexType [name]::string ([abstract]::("true" | "false") | [block]::derivationSet | [final]::derivationSet)*)
localComplexType ::=
	[complexType]::complexType
complexRestriction ::=
	[restriction]::(annotated [base]::string typeDefParticle? attrDecls)
extensionType ::=
	annotated [base]::string
complexExtension ::=
	[extension]::(extensionType typeDefParticle? attrDecls)
complexContent ::=
	[complexContent]::(annotated [mixed]::("true" | "false")? (complexRestriction | complexExtension))
simpleRestriction ::=
	[restriction]::(annotated simpleRestrictionModel attrDecls)
simpleExtension ::=
	[extension]::(extensionType attrDecls)
simpleContent ::=
	[simpleContent]::(annotated (simpleRestriction | simpleExtension))
blockSet ::=
	"#all"
	("extension" | "restriction" | "substitution")*
element ::=
	annotated fixedOrDefault ([nillable]::("true" | "false") | [block]::blockSet)* (ε | [type]::string | localSimpleType | localComplexType) identityConstraint*
topLevelElement ::=
	[element]::(element [name]::string ([substitutionGroup]::string | [abstract]::("true" | "false") | [final]::derivationSet)*)
localElement ::=
	[element]::(occurs ([ref]::string | element [name]::string [form]::formChoice?))
namedGroup ::=
	[group]::(annotated [name]::string ([all]::allModel | [choice]::simpleExplicitGroup | [sequence]::simpleExplicitGroup))
groupRef ::=
	[group]::(annotated occurs [ref]::string)
explicitGroup ::=
	annotated occurs nestedParticle*
simpleExplicitGroup ::=
	annotated nestedParticle*
allModel ::=
	annotated [element]::(([minOccurs]::("0" | "1") | [maxOccurs]::("0" | "1"))* ([ref]::string | element [name]::string [form]::formChoice?))*
all ::=
	[all]::(allModel ([minOccurs]::("0" | "1") | [maxOccurs]::"1")*)
choice ::=
	[choice]::explicitGroup
sequence ::=
	[sequence]::explicitGroup
wildcard ::=
	annotated ([namespace]::("##any" | "##other" | (string | "##targetNamespace" | "##local")*) | [processContents]::("lax" | "skip" | "strict"))*
any ::=
	[any]::(wildcard occurs)
namedAttributeGroup ::=
	[attributeGroup]::(annotated [name]::string attrDecls)
attributeGroupRef ::=
	[attributeGroup]::(annotated [ref]::string)
include ::=
	[include]::(annotated [schemaLocation]::string)
redefine ::=
	[redefine]::(openAttrs [id]::string? [schemaLocation]::string (annotation | redefinable)*)
import ::=
	annotated [schemaLocation]::string?
importRequiredNamespace ::=
	[import]::(import [namespace]::string)
importOptionalNamespace ::=
	[import]::(import [namespace]::string?)
selector ::=
	[selector]::(annotated [xpath]::string)
field ::=
	[field]::(annotated [xpath]::string)
keybase ::=
	annotated [name]::string selector field+
identityConstraint ::=
	unique
	key
	keyref
unique ::=
	[unique]::keybase
key ::=
	[key]::keybase
keyref ::=
	[keyref]::(keybase [refer]::string)
notation ::=
	[notation]::(annotated [name]::string [public]::string [system]::string?)
appinfoContent ::=
	anyContent
anyContent ::=
	(string | α* anyContent)*
appinfo ::=
	[appinfo]::([source]::string? appinfoContent)
documentationContent ::=
	anyContent
documentation ::=
	[documentation]::(([source]::string | [xml:lang]::string)* documentationContent)
annotation ::=
	[annotation]::(openAttrs [id]::string? (documentation | appinfo)*)
simpleDerivation ::=
	simpleRestriction
	list
	union
simpleDerivationSet ::=
	"#all"
	("list" | "union" | "restriction")*
simpleType ::=
	annotated simpleDerivation
topLevelSimpleType ::=
	[simpleType]::(simpleType [name]::string [final]::simpleDerivationSet?)
localSimpleType ::=
	[simpleType]::simpleType
rangeFacets ::=
	(minExclusive | minInclusive)? (maxExclusive | maxInclusive)?
digitFacets ::=
	totalDigits? fractionDigits?
lengthFacets ::=
	length
	minLength? maxLength?
commonFacets ::=
	enumeration* whiteSpaceCollapse? pattern*
simpleRestrictionModel ::=
	[base]::"xs:anySimpleType" rangeFacets digitFacets lengthFacets whiteSpace? enumeration* pattern*
	[base]::"xs:string" lengthFacets whiteSpace? enumeration* pattern*
	[base]::"xs:normalizedString" lengthFacets whiteSpaceReplaceOrCollapse? enumeration* pattern*
	[base]::("xs:token" | "xs:language" | "xs:Name" | "xs:NCName" | "xs:ID" | "xs:IDREF" | "xs:IDREFS" | "xs:NMTOKEN" | "xs:NMTOKENS" | "xs:ENTITY" | "xs:ENTITIES" | "xs:hexBinary" | "xs:base64Binary" | "xs:anyURI" | "xs:QName" | "xs:NOTATION") lengthFacets commonFacets
	[base]::"xs:boolean" whiteSpaceCollapse? pattern*
	[base]::("xs:decimal" | "xs:integer" | "xs:nonPositiveInteger" | "xs:nonNegativeInteger" | "xs:positiveInteger" | "xs:negativeInteger" | "xs:unsignedLong" | "xs:unsignedInt" | "xs:unsignedShort" | "xs:unsignedByte" | "xs:long" | "xs:int" | "xs:short" | "xs:byte") digitFacets rangeFacets commonFacets
	[base]::("xs:float" | "xs:double" | "xs:duration" | "xs:dateTime" | "xs:time" | "xs:date" | "xs:gYearMonth" | "xs:gYear" | "xs:gMonthDay" | "xs:gMonth" | "xs:gDay") rangeFacets commonFacets
	([base]::string | localSimpleType) rangeFacets digitFacets lengthFacets whiteSpace? enumeration* pattern*
list ::=
	[list]::(annotated (localSimpleType | [itemType]::string))
union ::=
	[union]::(annotated ([memberTypes]::string+ localSimpleType* | [memberTypes]::ε? localSimpleType+))
facet ::=
	annotated [fixed]::("true" | "false")?
noFixedFacet ::=
	annotated [value]::string
rangeFacet ::=
	facet [value]::(integer | string | "UNKNOWN data")
minExclusive ::=
	[minExclusive]::rangeFacet
minInclusive ::=
	[minInclusive]::rangeFacet
maxExclusive ::=
	[maxExclusive]::rangeFacet
maxInclusive ::=
	[maxInclusive]::rangeFacet
numFacet ::=
	facet [value]::integer
totalDigits ::=
	[totalDigits]::(facet [value]::integer)
fractionDigits ::=
	[fractionDigits]::numFacet
length ::=
	[length]::numFacet
minLength ::=
	[minLength]::numFacet
maxLength ::=
	[maxLength]::numFacet
enumeration ::=
	[enumeration]::noFixedFacet
whiteSpace ::=
	[whiteSpace]::(facet [value]::("preserve" | "replace" | "collapse"))
whiteSpaceReplaceOrCollapse ::=
	[whiteSpace]::(facet [value]::("replace" | "collapse"))
whiteSpaceCollapse ::=
	[whiteSpace]::(facet [value]::"collapse")
pattern ::=
	[pattern]::noFixedFacet

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