users@jaxb.java.net

Re: Unable to include schema with no target namespace

From: Ellis Brover <ellis.brover_at_TOYOTA.COM.AU>
Date: Sun, 09 Feb 2003 17:02:26 -0700

On Tue, 28 Jan 2003 07:35:49 -0800, Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM> wrote:

>Could you send your schema to us so that we can see what's happening?

It's extremely simple to simulate, a minimal schema will do it.

For example, create a file "including.xsd" as follows:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="something" xmlns="something" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <xsd:include schemaLocation="included.xsd"/>
 <xsd:element name="Element1" type="xsd:string"/>
</xsd:schema>

Now create a file "included.xsd" as follows:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <xsd:element name="Element2" type="xsd:string"/>
</xsd:schema>

Now run "xjc including.xsd". You will get:

The target namespace of the included schema "" doesnt agree with the expected value "{1}"
  line 3 of included.xsd

Regards,
Ellis.