Yes, but you need to have a schema document for each namespace that you
use.
If your "top" element is not in a namespace, your main schema document
would not have a target namespace. It would look roughly like this:
<xs:schema xmlns:anotherNamespace="foo" ...>
<xs:import namespace="anotherNamespace"
schemaLocation=...
<xs:element name="top">
<xs:complexType>
<xs:sequence>
<xs:element ref="anotherNamespace:a"/>
.....
The schema document that declares "a" would import the third namespace,
looking roughly like this:
<xs:schema targetNamespace="foo"
xmlns:anotherNamespace="foo"
xmlns:aThirdNamespace="bar" ...
<xs:import namespace="aThirdNamespace"
schemaLocation=...
<xs:element name="a">
<xs:complexType>
<xs:sequence>
<xs:element ref="aThirdNamespace:b"/>
.....
And the third schema document would look like:
<xs:schema targetNamespace="bar"
xmlns:aThirdNamespace="bar" ...
<xs:element name="b">
.....
etc.
Hope that helps,
Priscilla
----------------------------------
Priscilla Walmsley
Author, Definitive XML Schema
http://www.datypic.com
----------------------------------
*** Sent via Developersdex
http://www.developersdex.com ***