ZVON
>
Tutorials
>
XML Schema and Relax NG Tutorial
Intro
/
Search
/
ZVON
>> Contents <<
|
Index
Schema Tutorial - series
Associating schema with document
Document root element is from null namespace
Document root element from some particular namespace
Document root element can be from a set of namespaces
[RNG: ns, choice]
The namespace of document root element
The document root element is from null namespace
[XSD: targetNamespace] [RNG: ns]
The document root element is from some particular namespace
[XSD: targetNamespace] [RNG: ns]
The namespace of the document root element does not match the targetNamespace
[XSD: targetNamespace] [RNG: ns]
elementFormDefault - elements
Top-level elements, null namespace
[XSD: elementFormDefault]
Top-level elements, non-null namespace
[XSD: elementFormDefault]
elementFormDefault unqualified for not-top-level elements, namespace non-null
[XSD: elementFormDefault] [RNG: ns]
elementFormDefault qualified for not-top-level elements, namespace non-null
[XSD: elementFormDefault] [RNG: ns]
Simple tasks
Empty element
Element with text only
[XSD: element] [RNG: element, text]
Element with mixed content (text and only one element)
[XSD: mixed] [RNG: interleave]
Element which contains elements only (order does not matter)
[XSD: all] [RNG: interleave]
Element which contains elements only (order is important)
[XSD: sequence]
Element which contains mixture of two elements (can appear more times)
[XSD: sequence, maxOccurs]
Element which contains one of two elements
[XSD: choice] [RNG: choice]
Element which contains two "patterns" (sequences), in any order
[XSD: group, sequence, choice] [RNG: choice, group]
Element contains text only and one attribute
[XSD: attribute] [RNG: attribute, text]
Simple types
Accessing data-types
[XSD: type] [RNG: datatype]
Restrictions
[XSD: restriction]
Multiple restrictions
[XSD: union, minInclusive, maxInclusive] [RNG: choice, param]
Element is either a fixed string or an integer
[XSD: union] [RNG: choice, param]
Element can contain a string from an enumerated set
[XSD: enumeration] [RNG: choice]
Element can contain a mixture of elements
[XSD: all] [RNG: interleave]
Defining a group of attributes
[XSD: attributeGroup] [RNG: attribute]
Element can have [x,y] either as attributes or as elements
[XSD: ] [RNG: choice, attribute, element]
Attribute contains a list of values
[XSD: list, restriction, simpleType] [RNG: list]
Element contains a list of values
[XSD: list, restriction, simpleType] [RNG: list]
Wildcard patterns
Attribute from any namespace
[XSD: anyAttribute] [RNG: anyName]
Attributes from namespace other then target namespace (which is null)
[XSD: anyAttribute] [RNG: anyName, nsName, except]
Attributes from namespace other than target namespace (which is not null)
[XSD: anyAttribute] [RNG: anyName, nsName, except]
Attributes from some particular namespace
[XSD: anyAttribute] [RNG: nsName]
Attributes must not be from some particular namespaces
[RNG: anyName, except, nsName]
Just one element from any namespace
[XSD: any] [RNG: anyName]
Arbitrary number of elements from any namespace
[XSD: any] [RNG: anyName, except, nsName]
Exact number of elements from any namespace
[XSD: maxOccurs]
Elements from namespace other than target namespace (which is not null)
[XSD: any, maxOccurs] [RNG: anyName, except, nsName]
Elements from namespace other than target namespace (which is null)
[XSD: any, maxOccurs] [RNG: anyName, except, nsName]
Definition of own types
Definition of a custom simpleType - temperature must be greater than -273.15
[XSD: restriction, base, double, minExclusive] [RNG: data, type, param]
Limiting string length
[XSD: restriction, base, string, length] [RNG: data, type, param]
Limiting the number of decimal places
[XSD: restriction, base, decimal, minExclusive, fractionDigits] [RNG: data, type, param]
Limiting both the number of decimal places and total places
[XSD: decimal, totalDigits, fractionDigits]
String must contain e-mail address
[XSD: string, pattern]
Element contains date
[XSD: date, minInclusive]
Element represents time duration
[XSD: duration, minInclusive, maxInclusive]
The number must not be in scientific notation
[XSD: decimal]
Overriding schema
nillable, xsi:nil
[XSD: nillable]
xsi:type
Naming and definitions
definition of a simpleType, target namespace is null
[XSD: type, simpleType] [RNG: define, ref]
definition of a simpleType, target namespace is not null
[XSD: type, simpleType] [RNG: define, ref]
Element and type have the same name
[XSD: type, name] [RNG: name]
Error - simpleType and complexType have the same name
[XSD: type, name] [RNG: name, combine]
Unique and key
Uniqueness
[XSD: unique]
Key
[XSD: key]
Uniqueness - comparison of numbers
[XSD: unique]
Key and nillable
[XSD: key, nillable]
Unique and nillable
[XSD: unique, nillable]
Keyref
[XSD: key, keyref]
Final
XML Schema - no more restrictions of a simpleType allowed
[XSD: final, restriction]
XML Schema - no more extensions allowed
[XSD: final, extension]
XML Schema - finalDefault attribute
[XSD: finalDefault]
Importing and combining multiple schemas
Importing schema and processContents "strict"
[XSD: import, processContents]
Importing schema and processContents "lax"
[XSD: import, processContents]
Importing schema and processContents "skip"
[XSD: import, processContents]
Redefine element
[XSD: redefine]
Substitutions
Abstract element, substitutionGroup
[XSD: abstract, substitutionGroup]
Attribute block
[XSD: block, substitutionGroup]
Attribute block set to "restriction"
[XSD: block]
Attribute block set to "extension"
[XSD: block]
XML Schema - blockDefault attribute
[XSD: blockDefault]
Combining block and blockDefault attributes
[XSD: block, blockDefault]
Attribute block and xsi:type
[XSD: block]
Abstract type
[XSD: complexType, abstract]
Annotation
Annotating your schema
[XSD: annotation]
Extending schema
[XSD: appinfo]
attributeFormDefault
Target namespace is not null, attributeFormDefault is qualified
[XSD: attributeFormDefault, attribute] [RNG: attribute, ns]
Target namespace is not null, attributeFormDefault is unqualified
[XSD: attributeFormDefault, attribute] [RNG: attribute, ns]
Target namespace is null
[XSD: attributeFormDefault, attribute] [RNG: attribute, ns]
Extensions of complexTypes
Extension of a sequence
[XSD: sequence, extension] [RNG: define, ref]
Extension of a choice
[XSD: choice, extension] [RNG: choice, define, ref]
Restrictions
Restriction of a sequence
[XSD: sequence, restriction]
Restriction of a choice
[XSD: choice, restriction]
Error in restriction - non-matching types
[XSD: type, restriction]
Error in restriction - maxOccurs
[XSD: maxOccurs, restriction]
Error in restriction - namespaces in wildcards
[XSD: any, restriction] [RNG: nsName]
"Sequence" from "all"
[XSD: restriction, sequence, all]
"Sequence" from "choice"
[XSD: restriction, sequence, choice]
Element from any
[XSD: restriction, element, any]
Including
Target namespaces are the same (non-null)
[XSD: include, form]
Target namespaces are the same (null)
Including document has non-null target namespaces, included null target namespace
Including document has null target namespaces, included non-null target namespace
The wildcard "xsd:any" and inclusions
[XSD: include, any]
The wildcard "xsd:anyAttribute" and inclusions
[XSD: include, any]
Including in Relax NG - externalRef element, ns attribute
[RNG: externalRef]
Including in Relax NG - include element, ns attribute
[RNG: include]