Skip to Main Content
XML Schema
book

XML Schema

by Eric van der Vlist
June 2002
Intermediate to advanced content levelIntermediate to advanced
396 pages
11h 8m
English
O'Reilly Media, Inc.
Content preview from XML Schema

Name

xs:import — Import of a W3C XML Schema for another namespace.

Synopsis

<xs:import
           id               = xs:ID
           namespace        = xs:anyURI
           schemaLocation   = xs:anyURI
           {any attributes with non-schema namespace}
           >
           Content: (xs:annotation?)
</xs:import>

May be included in: xs:schema

Description

xs:import identifies the location at which a W3C XML Schema validator may find the definition corresponding to namespaces other than the target namespace of the current schema.

All the global definitions (elements, attributes, element and attribute groups, simple and complex types) and unique and key constraints of the imported schemas can be referenced using a namespace prefix defined for the corresponding namespace URI.

The schema locations indicated in xs:import elements are only hints provided to the schema validators and may be omitted. In this case, the Recommendation states that “the schema author is leaving the identification of that schema to the instance, application or user, via the mechanisms described in Layer 3: Schema Document Access and Web-interoperability.”

xs:import may also be used to import components with no target namespaces into schemas with target namespaces.

Restrictions

xs:import must not be used to import component definitions from the target namespace since two other elements are available for this purpose (see xs:include and xs:redefine ).

Only global component definitions of the imported schemas can be referenced (local definitions can never be referenced).

The rules of scoping described ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

XML in a Nutshell, 3rd Edition

XML in a Nutshell, 3rd Edition

Elliotte Rusty Harold, W. Scott Means
Beginning XML, 5th Edition

Beginning XML, 5th Edition

Danny Ayers, Liam R.E. Quin, Joe Fawcett
XML Schema Complete Reference, The

XML Schema Complete Reference, The

Cliff Binstock, Chris Galtenberg, Mike Wooding, Chris Dix, Mitchell Smith, Dave Peterson
Programming Web Services with SOAP

Programming Web Services with SOAP

James Snell, Doug Tidwell, Pavel Kulchenko

Publisher Resources

ISBN: 0596002521Supplemental ContentErrata Page