The following is a sample consolidated schema document:
<?xml version="1.0" encoding="UTF-8"?> <ConsolidatedSchema schemaURI="http://www.example.com/schemauri" > <ComponentSchema locationURI="http://example.com/schemauri" targetNamespace="http://www.example.com/tns"> <xs:schema xmlns:xs="..." xmlns:xsi="..." xmlns:tns="http://www.example.com/tns"> .... </xs:schema> </ComponentSchema> <ComponentSchema locationURI="http://www.example.com/includedschema1.xsd" targetNamespace="http://www.example.com/tns"> <xs:schema xmlns:xs="..." xmlns:xsi="..." xmlns:tns="http://www.example.com/tns"> .... </xs:schema> </ComponentSchema> <ComponentSchema locationURI="../otherschema/importedschema1.xsd" targetNamespace="http://www.example.com/tns2"> <xs:schema xmlns:xs="..." xmlns:xsi="..." xmlns:tns2="http://www.example.com/tns2"> .... </xs:schema> </ComponentSchema> </ConsolidatedSchema>
The ConsolidatedSchema element represents the envelope which contains the individual schema documents that make up the schema. It identifies the schema in question through a schemaURI attribute, making it a complete self-identifying package.
The ComponentSchema element, a child of the ConsolidatedSchema element, wraps each schema document that makes up the schema grammar. This element contains a locationURI attribute that is used to pick out the schema document when it is required during the processing of the root schema. For example, if a schema with a given location URI is imported in the root schema or one of the other imported/included schemas, the resolver picks the ComponentSchema element with the appropriate locationURI attribute and takes its xs:schema child element.