![](https://csdnimg.cn/release/download_crawler_static/1357408/bgc.jpg)
ISO/IEC 8825-5:2004 (E)
4 ITU-T Rec. X.694 (01/2004)
standardized, and conforming implementations of the mapping may choose any syntactic form (or a mixture of syntactic
forms) for the assignment of final XER encoding instructions.
NOTE – The choice among these options does not affect the final binary or XML encodings.
6.5 A formal specification of the required mapping is not provided.
6.6 This Recommendation | International Standard is concerned only with the mapping of XSD Schemas that
conform to W3C XML Schema.
NOTE – Such conformance can be either by the provision of one or more W3C XSD schema documents or by other means as
specified in W3C XML Schema.
7 Mapping XSD Schemas
7.1 A mapping is based on a source XSD Schema, which is a set of schema components (see W3C XML Schema
Part 1, 2.2). No particular representation of schema components or sets of schema components is required or assumed
for the mapping, although it is expected that the source XSD Schema will usually be provided as one or more XML
schema documents (see W3C XML Schema Part 1, 3.15.2).
NOTE 1 – Since the mapping is defined in terms of schema components (and not in terms of their XML representation), it is not
affected by details of the XML representation, such as the use of multiple schema documents linked by
xsd:include and
xsd:redefine element information items, the placement of element information items in one or another schema documents, the
order of
xsd:attribute element information items within a xsd:complexType element information item, and so on.
NOTE 2 – Two sets of schema documents that differ in many aspects but represent the same set of schema components generate
the same set of ASN.1 type assignments, with the same final encoding instructions assigned to them and to their components to
any depth.
7.2 The source XSD Schema shall meet all the constraints imposed by the XSD specification. If the source XSD
Schema is represented (in part or all) as a set of XML schema documents, each schema document shall be valid
according to the XSD Schema for Schemas (see W3C XML Schema Part 1, Appendix A).
7.3 At least one ASN.1 module (see 7.4) shall be generated for each different
target namespace (whether a
namespace name or the keyword absent) that is the target namespace of one or more schema components in the source
XSD Schema. Each ASN.1 module shall contain one or more type assignments corresponding to top-level schema
components (see 7.9) that have the same
target namespace. Each ASN.1 module can also contain one or more special
ASN.1 type assignments whose associated ASN.1 type assignments are in the same ASN.1 module (see 7.6).
NOTE –The schema components represented in the multiple schema documents become part of the same XSD Schema through
the use of the
xsd:include, xsd:redefine, and xsd:import element information items.
7.4 The number of ASN.1 modules generated for each target namespace (including the keyword absent) may be
more than one, but each ASN.1 module shall not contain type assignments corresponding to top-level schema
components with different
target namespaces (including the keyword absent).
7.5 When multiple ASN.1 modules are generated for a given
target namespace (including the keyword absent), all
the type assignments present in them shall be generated as if they were being added to a single ASN.1 module for the
purpose of generating distinct type reference names (see 10.3). The type reference names generated from the
names of
the top-level schema components with a given
target namespace shall be the same type reference names regardless of the
number of ASN.1 modules generated for that
target namespace and regardless of the way type assignments are divided
among the various ASN.1 modules.
NOTE – This is designed to provide flexibility without compromising interoperability.
7.6 Each special ASN.1 type assignment (see clauses 29, 30, and 31) shall be inserted in the same ASN.1 module
as its associated ASN.1 type assignment (see 29.4, 31.4, and 30.4, respectively).
7.7 All ASN.1 modules generated by the mapping shall contain (in the XER encoding control section) a
GLOBAL-
DEFAULTS MODIFIED-ENCODINGS encoding instruction and a GLOBAL-DEFAULTS CONTROL-NAMESPACE encoding
instruction specifying the XSI namespace.
7.8 A source XSD Schema shall be processed as follows:
a) for each top-level
element declaration, an ASN.1 type assignment shall be generated by applying
clause 14 to the
element declaration;
b) for each top-level
attribute declaration, an ASN.1 type assignment shall be generated by applying
clause 15 to the
attribute declaration;
c) for each user-defined top-level
simple type definition, an ASN.1 type assignment shall be generated by
applying clause 13 to the
simple type definition;
d) for each top-level
complex type definition, an ASN.1 type assignment shall be generated by applying
clause 20 to the
complex type definition;