W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2002

Re: Bundling Of Multiple XML Schemas

From: Jeni Tennison <jeni@jenitennison.com>
Date: Sat, 9 Mar 2002 12:12:14 +0000
Message-ID: <50354162418.20020309121214@jenitennison.com>
To: "Konstantin Komissarchik" <kosta@www.lt-rider.net>
CC: xmlschema-dev@w3.org
Hi Konstantin,

> Our question is how to deliver this "compound schema" that
> references multiple namespaces, without requiring that the schema
> documents be stored in multiple files, or retrieved independently by
> URL, etc. In other words, we need some way to bundle these schemas
> together, and possibly also some legal way to use the schema
> location "hint" to indicate that the schemas are bundled together.

I *think* that it is possible to bundle schemas for distinct
namespaces together in the same document with the id attribute on
xs:schema used to provide anchors for links between them. So with your
example, I think that you should be able to do:

<?xml version="1.0"?>
<!DOCTYPE schemas [
<!ELEMENT xs:schema ANY>
<!ATTLIST xs:schema id ID #REQUIRED>
<schemas xmlns:xs="http://www.w3.org/2001/XMLSchema"

<xs:schema id="resultenvelope"
  <xs:import namespace="http://www.nimble.com/results"
             schemaLocation="#results" />

  <xs:element name="envelope">
        <xs:element ref="rs:record" maxOccurs="unbounded" />

<xs:schema id="results"
  <xs:import namespace="http://www.nimble.com/HumanResources" />
  <xs:import namespace="http://www.nimble.com/Engineering" />

  <xs:element name="record">
        <xs:element ref="hr:employee" />
        <xs:element ref="eng:project" minOccurs="0"
                                      maxOccurs="unbounded" />


If this file were schemas.xml, you should then be able to validate
against the resultenvelope schema with the URL

However, just because this is theoretically possible doesn't mean that
any schema validator will be able to use it - I don't know if any of
the processors recognise fragment identifiers within URLs that are
supposed to be pointing to XML Schema documents.



Jeni Tennison
Received on Saturday, 9 March 2002 07:12:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:55 UTC