title: import xsd with no namespace
body: <p>As in the title, how do you import schema that has no targetNamespace defined? </p>
  
  <p>I've got following case:</p>
  
  <p>File: Data.xml</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;lib:library xmlns:lib="http://java2s.com/ns/library"&gt;
    &lt;lib:book id="b0836217462"&gt;
      &lt;lib:title&gt;Being a Dog Is a Full-Time Job&lt;/lib:title&gt;
      &lt;lib:authors&gt;
        &lt;person id="CMS"&gt;
          &lt;name&gt;Charles M Schulz&lt;/name&gt;
        &lt;/person&gt;
      &lt;/lib:authors&gt;
    &lt;/lib:book&gt;
  &lt;/lib:library&gt;
  </code></pre>
  
  <p>File: Schema.xsd</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;xs:schema targetNamespace="http://java2s.com/ns/library"
    elementFormDefault="qualified" attributeFormDefault="unqualified"
    xmlns:lib="http://java2s.com/ns/library"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;xs:import schemaLocation="another.xsd" /&gt;
    &lt;xs:element name="library"&gt;
      &lt;xs:complexType&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element name="book" type="lib:bookType" /&gt;
        &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;xs:complexType name="bookType"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="title" type="xs:string" /&gt;
        &lt;xs:element name="authors"&gt;
          &lt;xs:complexType&gt;
            &lt;xs:sequence&gt;
              &lt;xs:element ref="person" /&gt;
            &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name="id" type="xs:ID" use="required" /&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>File: another.xsd</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;xs:element name="person" type="personType" /&gt;
    &lt;xs:complexType name="personType"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="name" type="xs:string" /&gt;
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name="id" type="xs:ID" use="required" /&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>It all seems to be OK, but when I try to generate Jaxb classes for these XSDs, I get following exception:</p>
  
  <pre><code>org.xml.sax.SAXParseException: undefined element declaration 'person'
      at com.sun.xml.xsom.impl.parser.ParserContext$1.reportError(ParserContext.java:176)
      at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.reportError(NGCCRuntimeEx.java:170)
      at com.sun.xml.xsom.impl.parser.DelayedRef.resolve(DelayedRef.java:125)
      at com.sun.xml.xsom.impl.parser.DelayedRef.run(DelayedRef.java:100)
      at com.sun.xml.xsom.impl.parser.ParserContext.getResult(ParserContext.java:131)
      at com.sun.xml.xsom.parser.XSOMParser.getResult(XSOMParser.java:226)
      at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:519)
      at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:236)
      at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
      at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:411)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:603)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:248)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:142)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:300)
      at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
      at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
      at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
      at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:380)
      at org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:257)
      at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:477)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  </code></pre>
  
  <p>Adding <code>targetNamespace</code> to file <code>another.xsd</code> and qualifying it in file <code>Schema.xsd</code> solves the problem, but then element person in file <code>Delta.xml</code> will be in that targetNamespace, which is not what I want.</p>
  
  <p>My question is basically: Why does JAXB (or XJC) not recognize the person element when it has no namespace?</p>
  
  <p>For Jaxb generation I use cxf codegen plugin, which uses following: Version hudson-jaxb-ri-2.1-2 of JAXB XJC</p>