users@jaxb.java.net

XSD import support

From: Lisa Bahler <bahler_at_RESEARCH.TELCORDIA.COM>
Date: Fri, 06 Dec 2002 16:43:38 -0700

Schema import directives seem to be handled identically to include directives.

Mapping this schema:


<?xml version='1.0' ?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:imp="http://www.xyz.com/common/imp"
     targetNamespace="http://www.xyz.com/prod/test"
     xmlns ="http://www.xyz.com/prod/test">

   <xsd:import namespace="http://www.xyz.com/common/imp"
 schemaLocation = "../../common/imp/imported.xsd"/>
   <xsd:include schemaLocation = "included.xsd"/>


   <xsd:element name = "test" type = "testType" />

   <xsd:complexType name = "testType" >
      <xsd:sequence>
         <xsd:element name = "IMP" type = "imp:imported" />
         <xsd:element name = "INC" type = "included"/>
      </xsd:sequence>
   </xsd:complexType>

</xsd:schema>


causes both prod/test/Imported.java to be created in package prod.test and prod/test/impl/ImportedImpl.java to be created in package prod.test.impl.

Why doesn't the generated Java code do an import of common.imp.* and common.imp.impl.* to refer to Imported in its own package, and not create these files?