Constructs needed for Schema "compilation"

I have been thinking about the needs of a XML Schema "compiler" that attempts to resolve external references, etc and produce a self-contained XML Schema.  I haven't gotten to actually start the code,
but there is one thing that I see would be needed off the bat.

The first need is a mechanism to make an "import" schema a local resource.  There could either be two approaches to this, one would be to allow import to have an optional schema child element or to
allow schemas to appear directly under schemas.

<schema>
	<import namespace="http://www.w3.org/XML/1999/namespace" schemaLocation="http://www.w3.org/XML/1998/xml.xsd"/>

could be translated to

<schema>
	<import namespace="http://www.w3.org/XML/1999/namespace">
		<!-- contents of http://www.w3.org/XML/1998/xml.xsd   go here  -->
		<schema targetNamespace="http://...

alternatively, the import element could be completely replaced with the imported schema.

<schema>
	<!--  imported schema gets expressed in here  -->
	<schema targetNamespace="http://

I think I would prefer the second form as it is simplier when the same schema is imported more than one.

Received on Thursday, 17 February 2000 16:09:41 UTC