XML Schema Part 0: Primer Second Edition - 0 views
-
- ...47 more annotations...
-
-
<xsd:simpleType name="USStateList">
<xsd:list itemType="USState"/>
</xsd:simpleType>
<xsd:simpleType name="SixUSStates">
<xsd:restriction base="USStateList">
<xsd:length value="6"/>
</xsd:restriction>
</xsd:simpleType> -
Note that it is possible to derive a list type from the
atomic typestring.
However, astringmay
contain white space, and white space delimits the items in
a list type, so you should be careful using
list types whose base type is.
string -
The
mechanism enables you to use externally
include
created schema components "as-is", that is, without any
modification. -
base="ipo:Address"
-
El tipo base y el extendido tienen igual identificador.
Fuera del elemento "redefine" cualquier intento de nombrar a dos tipos de datos usando el mismo identificador producirá un error.
Notar cómo el elemento "redefine" debe ser el primer hijo del elemento "schema" y encerrar al tipo de dato que redefinimos.
-
-
The
redefine
element acts very much like theincludeelement as it includes
all the declarations and definitions from theaddress.xsdfile -
Outside of the
element, any such attempt to define a
redefine
complex type with the same name (and in the same namespace)
as the base from which it is being derived would cause an
error. -
Now that
Addresshas been redefined, the
extension applies to all schema components that make use of
Address -
Elements in a
substitution group must have the same type as the head
element, or they can have a type that has been derived from
the head element's type -
<ipo:shipComment>
-
- no todos los elementos del grupo de sustitución han de aparecer en la instancia XML.
- los indicadores minOccurs y maxOccurs del elemento cabecera deben ser adecuados al número de elementos de sustitución que permitamos aparecer (pueden aparecer tantos como el valor maxOccurs del elemento cabecera).
- si maxOccurs así lo permite, puede aparecer el elemento cabecera y sus sustitutos.
-
-
Abstract Elements and Types
XML Schema provides a mechanism to
force substitution for a particular element or type. When
an element or type is declared to be "abstract", it cannot
be used in an instance document. When an element is
declared to be abstract, a member of that element's
substitution group must appear in the instance document.
When an element's corresponding type definition is declared
as abstract, all instances of that element must usexsi:type to
indicate a derived type that is not abstract. -
Declaring an element as abstract requires the use of a
substitution group. Declaring a type as abstract simply
requires the use of a type derived from it (and identified
by theattribute) in the instance document
xsi:type -
-
schema authors will sometimes want
to control derivations of particular types, and the use of
derived types in instances. -
to specify that for a particular complex
type, new types may not be derived from it, either (a) by
restriction, (b) by extension, or (c) at all. -
The
restrictionvalue of
thefinal
attribute prevents derivations by restriction. Preventing
derivations at all, or by extension, are indicated by the
values#allandextension
respectively -
an optional
finalDefaultattribute
on theschema
element whose value can be one of the values allowed for
thefinal
attribute. The effect of specifying thefinalDefaultattribute
is equivalent to specifying afinalattribute on every type
definition and element declaration in the schema. -
When a simple type is defined, the
attribute
fixed
may be applied to any of its facets to prevent a derivation
of that type from modifying the value of the fixed facets. -
a mechanism
that controls which derivations and substitution groups may
be used in instance documents -
-
Preventing
replacement by derivations at all, or by
derivations-by-extension, are indicated by the values
#allandextensionrespectively.
As withfinal,
there exists an optionalblockDefaultattribute
on theschema
element whose value can be one of the values allowed for
theblock
attribute. -
mechanism that
enables schema components from different target namespaces
to be used together, and hence enables the schema
validation of instance content defined across multiple
namespaces. -
The
schemaLocation
attribute value consists of one or more pairs of URI references,
separated by white space. The first member of each pair is a namespace
name, and the second member of the pair is a hint describing where to
find an appropriate schema document for that namespace -
there is a
attribute which is
noNamespaceSchemaLocation
used to provide hints for the locations of schema documents
that do not have target namespaces. -
the
element has a required
includeschemaLocation
attribute, and it contains a URI reference which must
identify a schema document. -
the
element has optional
importnamespaceandschemaLocation
attributes. If present, theschemaLocation
attribute is understood in a way which parallels the
interpretation of
xsi:schemaLocation



