2. Qualification refers to whether a value
(element, attribute) must be qualified by a its
namespace
◦ When an element (or attribute) doesn’t have a
namespace declaration it’s unqualified
◦ Determines how name is used in data (instance)
document
A schema has the attributes elementFormDefault
and attributeFormDefault
◦ Set to qualified or unqualified
◦ By setting to qualified, must include a namespace when
use attributes or elements
4. Have several different ways to specify how
elements fit together
Sequence: specifies that elements must be in
order, and there’s variability in when and how
many times a child element occurs
All: elements may appear (or not), and in any
order
Choice: one of several child elements may
appear
Group: a set of elements may be referenced
by name
5. Allows elements to appear in any order or not
at all
Rules governing use
1. Must be only content model declaration of a
<complexType> definition
For example, can’t follow with <sequence>
2. Can only have element declarations as children
3. The children of the <all> element may appear
once – or not at all
7. Similar in syntax to sequence
Only one member of list can appear in the
document
Allow a middle initial or a middle name
<choice>
<element name=“middleInitial” type=“xs:string” />
<element name=“middleName type=“xs:string” />
</choice>
Note: Best case would restrict Middle Initial to one
character with a simple type.
8. A group allows you to tie elements together, and
then reference then with a single name
Definition:
<group name=“nameFields”>
<element name=“first” type=“xs:string” />
<element name=“middle” type=“xs:string” />
<element name=“last” type=“xs:string” />
</group>
Use:
<element name=“name”>
<complexType>
<group ref=“nameFields” />
</complexType>
</element>
9. Can create a group of attributes similar to
element groups
Allows re-use of common members without
multiple definitions
◦ Attribute groups cannot be recursive (refer to
themselves
10. Create limits on acceptable values as a simple
type
A facet is a single property or trait of a simple
type
Twelve facets can be applied to limit
acceptable values
11. minExclusive: smallest value, excluding
what’s specified
minInclusive: smallest value, including what’s
specified
maxExclusive: largest value, excluding what’s
specified
maxInclusive: largest value, including what’s
specified
totalDigits: total number of digits of a
numeric type
12. fractionDigits: number of decimal places
length: number of items in a list or characters
in a string
minLength: minimum number of list items or
characters
maxLength: maximum number of list items
or characters
enumeration: specify member of a list
whitespace: how whitespace should be
treated
pattern: restrict string types by pattern
18. A list allows an element or attribute to store
multiple values
◦ Uses enumerated values
◦ Values are separated by whitespace, so whitespace
cannot be part of the content
◦ Can be built-in XML or a defined simpleType data
type
19. Define
<simpleType name=“Degrees”> different
<restriction base=“string”> values
<enumeration value=“AA” />
<enumeration value=“AS” />
<enumeration value=“AAS” />
</restriction>
</simpleType>
Define
<simpleType name=“DegreesList”> data type
<list itemType=“Degrees”/> using
</simpleType> values
<element name=“degreesEarned” type=“DegreesList” />
Define element storing different values
20. <union> allows the combination of two data
type for an element or attribute
If have a possiblePoints element, expected
value would be an integer; <union> would
allow a string entry to note a “Missing” value
Separate data types with whitespace
<simpleType name=“CreditValue”>
<union memberTypes=“xs:integer xs:string />
</simpleType