100% found this document useful (2 votes)
191 views

XML Schema - Structures

This document provides a quick reference to the structures and components used to define XML schemas, including declarations for elements like schema, simpleType, complexType, group, attribute, and annotation. It also outlines constraining facets that can be used to restrict values like length, pattern, enumeration, and whitespace. The summary describes the main components for defining namespaces, data types, elements and attributes in XML schemas.

Uploaded by

Sneetsher Crispy
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
191 views

XML Schema - Structures

This document provides a quick reference to the structures and components used to define XML schemas, including declarations for elements like schema, simpleType, complexType, group, attribute, and annotation. It also outlines constraining facets that can be used to restrict values like length, pattern, enumeration, and whitespace. The summary describes the main components for defining namespaces, data types, elements and attributes in XML schemas.

Uploaded by

Sneetsher Crispy
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Content: ( annotation ?, ( simpleType ?

, ( minExclusive | minInclusive | name = NCName>


maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | Content: (annotation?, (simpleContent | complexContent | ((group | all | choice |
maxLength | enumeration | whiteSpace | pattern )*)) </restriction> sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))) </complexType>
<list id = ID Complex Content
XML Schema - Structures itemType = QName>
Content: ( annotation ?, ( simpleType ?)) </list> <complexContent id = ID
mixed = boolean>
Quick Reference <union id = ID
memberTypes = List of QName>
Content: (annotation?, (restriction | extension)) </complexContent>

Content: ( annotation ?, ( simpleType *)) </union> <restriction id = ID


ver 9/01
©2001 D VInt Productions, base = QName>
http://www.xml.dvint.com Constraining Facets Content: (annotation?, (group | all | choice | sequence)?,
<length id = ID Content: (annotation?) ((attribute | attributeGroup)*, anyAttribute?)) </restriction>
1 Namespaces fixed = boolean : false </maxInclusive> <extension id = ID
• http://www.w3.org/2001/XMLSchema value = nonNegativeInteger > base = QName>
<maxExclusive id = ID
• http://www.w3.org/2001/XMLSchema-instance Content: (annotation?) </length> Content: (annotation?, ((group | all | choice | sequence)?,
fixed = boolean : false
2 Schema declaration <minLength id = ID value = anySimpleType> ((attribute | attributeGroup)*, anyAttribute?))) </extension>
fixed = boolean : false Content: (annotation?)
<schema id = ID Sim p l e C o n t e n t
value = nonNegativeInteger > </maxExclusive>
attributeFormDefault = (qualified | unqualified) : unqualified
Content: (annotation?) </minLength> <simpleContent id = ID>
blockDefault = (#all | List of (extension | restriction | substitution)) : '' <minExclusive id = ID
Content: (annotation?, (restriction | extension)) </simpleContent>
elementFormDefault = (qualified | unqualified) : unqualified <maxLength id = ID fixed = boolean : false
finalDefault = (#all | List of (extension | restriction)) : '' fixed = boolean : false value = anySimpleType> <restriction id = ID
targetNamespace = anyURI value = nonNegativeInteger > Content: (annotation?) base = QName>
version = token Content: (annotation?) </maxLength> </minExclusive> Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive
xml:lang = language > <pattern id = ID <minInclusive id = ID | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength |
Content: ((include | import | redefine | annotation)*, (((simpleType | complexType | value = anySimpleType fixed = boolean : false enumeration | whiteSpace | pattern)*)?, ((attribute | attributeGroup)*,
group | attributeGroup) | element | attribute | notation), annotation*)*) </schema> Content: (annotation?) </pattern> value = anySimpleType> anyAttribute?)) </restriction>
<include id = ID Content: (annotation?) <extension id = ID
<enumeration id = ID
schemaLocation = anyURI > </minInclusive> base = QName>
value = anySimpleType >
Content: (annotation?) </include> Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?)) </extension>
Content: (annotation?) <totalDigits id = ID
<redefine id = ID </enumeration> fixed = boolean : false <attributeGroup id = ID
schemaLocation = anyURI> value = positiveInteger > ref = QName>
<whiteSpace id = ID
Content: (annotation | (simpleType | complexType | group | attributeGroup))* Content: (annotation?) Content: (annotation?) </attributeGroup>
fixed = boolean : false
</redefine> </totalDigits>
value = (collapse | preserve | replace)> <anyAttribute id = ID
<import id = ID Content: (annotation?) <fractionDigits id = ID namespace = ((##any | ##other) | List of (anyURI |
namespace = anyURI </whiteSpace> fixed = boolean : false (##targetNamespace | ##local)) ) : ##any
schemaLocation = anyURI> value = nonNegativeInteger > processContents = (lax | skip | strict) : strict >
<maxInclusive id = ID
Content: (annotation?) </import> Content: (annotation?) Content: (annotation?)</anyAttribute>
fixed = boolean : false
</fractionDigits>
3 Simple Data Type Declaration value = anySimpleType> 5 Model Group Definition

<simpleType id = ID 4 Complex Data Type Declaration <group


final = (#all | (list | union | restriction)) name = NCName>
<complexType id = ID
name = NCName> Content: (annotation?, (all | choice | sequence)) </group>
abstract = boolean : false
Content: ( annotation ?, ( restriction | list | union )) </simpleType> block = (#all | List of (extension | restriction)) <all id = ID
<restriction id = ID final = (#all | List of (extension | restriction)) maxOccurs = 1 : 1 minOccurs = (0 | 1) : 1>
base = QName> mixed = boolean : false Content: (annotation?, element*) </all>
6 Attribute Group Definition ref = QName [final]
<attributeGroup id = ID type = QName list A finite-length (possibly empty) sequence of values
name = NCName use = (optional | prohibited | required) : optional >
union A combination of the of one or more other datatypes.
ref = QName > Content: (annotation?, (simpleType?)) </attribute>
restriction Values for constraining facets are specified to a subset of
Content: (annotation?, 10 Notation Declaration
those of its base type.
((attribute | attributeGroup)*, anyAttribute?)) </attributeGroup> <notation id = ID
[namespace]
7 Element Declaration name = NCName
public = anyURI ##any Any namespace (default)
<element id = ID
abstract = boolean : false system = anyURI }> ##other Any namespace other than target namespace
block = (#all | List of (extension | restriction | substitution)) Content: (annotation?) </notation> # # t a r g e t N a m e s p a c e Must belong to the target Namespace of schema
default = string 11 Annotation Components ##local Any unqualified XML
final = (#all | List of (extension | restriction)) <annotation id = ID> [processContents]
fixed = string Content: (appinfo | documentation)* </annotation>
form = (qualified | unqualified) strict There must be a top-level declaration for the item available,
maxOccurs = (nonNegativeInteger | unbounded) : 1 <appinfo or the item must have an xsi:type, and must be valid.
minOccurs = nonNegativeInteger : 1 source = anyURI> skip No constraints at all: the item must simply be well-formed.
name = NCName Content: ({any})* </appinfo>
lax Validate where you can, don't worry when you can't.
nillable = boolean : false <documentation [form]
ref = QName source = anyURI
substitutionGroup = QName qualified Namespace qualified
xml:lang = language>
type = QName> Content: ({any})* </documentation> unqualified No namespace qualification
Content: (annotation?, ((simpleType | complexType)?, [use]
12 Identity-constriant defintions
(unique | key | keyref)*)) </element>
<unique id = ID optional Attribute is optional
8 Model Group (content model)
name = NCName > prohibited Attribute is prohibited
<choice id = ID Content: (annotation?, (selector, field+)) </unique> required Attribute is required to have a value
maxOccurs = (nonNegativeInteger | unbounded) : 1
<key id = ID [value]
minOccurs = nonNegativeInteger : 1}>
name = NCName >
Content: (annotation?, (element | group | choice | sequence | any)*)</choice> p r e s e r v e The value is the normalized value
Content: (annotation?, (selector, field+)) </key>
<sequence id = ID replace All occurrences of tab, line feed and carriage return are
<keyref id = ID replaced with space.
maxOccurs = (nonNegativeInteger | unbounded) : 1
name = NCName
minOccurs = nonNegativeInteger : 1}> collapse Contiguous sequences of spaces are collapsed to a single
refer = QName >
Content: (annotation?, (element | group | choice | sequence | any)*) </sequence> space, and initial and/or final spaces are deleted.
Content: (annotation?, (selector, field+)) </keyref>
<any id = ID 14 Schema Instance Related Markup
<selector id = ID
maxOccurs = (nonNegativeInteger | unbounded) : 1 xsi:type An element in an instance may explicitly assert its type
xpath = a subset of XPath expression, see below >
minOccurs = nonNegativeInteger : 1 using the attribute xsi:type. The value is a QName associ-
Content: (annotation?) </selector>
namespace = ((##any | ##other) | List of (anyURI | ated with a type definition.
(##targetNamespace | ##local)) ) : ##any <field id = ID xsi:nil An element may be valid without content if it has the
processContents = (lax | skip | strict) : strict> xpath = a subset of XPath expression, see below > attribute xsi:nil with the value true.
Content: (annotation?) </any> Content: (annotation?) </field>
x s i : s c h e m a L o c a t i o n , x s i : n o N a m e s p a c e S c h e m a L o c a t i o n Provide hints
9 Attribute Declaration 13 Defined Values as to the physical location of schema documents.
{any} Any element not part of Shema namespace.
<attribute id = ID
default = string #all All of the values listed
fixed = string #atomic A built-in primitive simple type definition ©2001 D Vint Productions
form = (qualified | unqualified) xmlhelp@ dvint.com
name = NCName http://w w w .xm l.dvint.com

You might also like