title: Different parent child namespace prefix expected
body: <p>I have two xsds from which i have generated jaxb pojos using xjc. And i have generated XMLs using jaxb marshaller with jaxb-impl-2.2.6
  For this I have overriden NamespacePrefixMapper as MyNamespacePrefixMapper</p>
  
  <p>Parent.xsd</p>
  
  <pre><code> &lt;xs:schema targetNamespace="parent" 
         elementFormDefault="qualified" 
         xmlns:xs="http://www.w3.org/2001/XMLSchema" 
         xmlns:Env="Parent" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xmlns:child="urn:xsd:child"&gt;
  &lt;xs:import namespace="urn:xsd:child" schemaLocation="child.xsd"/&gt;
  &lt;xs:element name="parent"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="child" type="child:child1"/&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
   &lt;/xs:schema&gt;
  </code></pre>
  
  <p>child.xsd</p>
  
  <pre><code>  &lt;xs:schema xmlns="urn:xsd:child" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:xsd:child"&gt;
  &lt;xs:element name="child" type="child1"/&gt;
  &lt;xs:complexType name="child1"&gt;
      &lt;xs:sequence&gt;
          &lt;xs:element name="Id" type="Max20Text"/&gt;    
      &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:simpleType name="Max20Text"&gt;
      &lt;xs:restriction base="xs:string"&gt;
          &lt;xs:minLength value="1"/&gt;
          &lt;xs:maxLength value="20"/&gt;
      &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  </code></pre>
  
  <p></p>
  
  <p>XmlMarshallingTest.java</p>
  
  <pre><code> import javax.xml.bind.*;
   import javax.xml.stream.XMLStreamException;
   import org.junit.Test;
   import parent.Parent;
   import xsd.child.Child1;
    public class XmlMarshallingTest {
  
  
    @Test
     public void testXmlMarshalling() throws  JAXBException, XMLStreamException{
      Parent envelope = new Parent();
      Child1 businessApplicationHeaderV01 = new Child1();
      businessApplicationHeaderV01.setId("ABC123");
      envelope.setChild(businessApplicationHeaderV01);
      JAXBContext context = JAXBContext.newInstance(envelope.getClass());
      Marshaller marshaller = context.createMarshaller();
      marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
      marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new MyNamespacePrefixMapper());
      marshaller.marshal(envelope, System.out);
      }
  }
  </code></pre>
  
  <p>MyNamespacePrefixMapper.java</p>
  
  <pre><code>    import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
      import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
  
      public class MyNamespacePrefixMapper extends NamespacePrefixMapper {
  @Override
  public String getPreferredPrefix(String namespaceUri, String suggestion, boolean arg2) {
      if("Parent".equals(namespaceUri)) {
          return "parentPrefix";
      } else if("urn:xsd:child".equals(namespaceUri)) {
          return "childPrefix";
      }
      return "defaultPrefix";
  }
    }
  </code></pre>
  
  <p>the generated xml is like </p>
  
  <pre><code> &lt;parentPrefix:parent xmlns:childPrefix="urn:xsd:child" xmlns:parentPrefix="parent"&gt;
     &lt;parentPrefix:child&gt;
      &lt;childPrefix:Id&gt;ABC123&lt;/childPrefix:Id&gt;
     &lt;/parentPrefix:child&gt;
   &lt;/parentPrefix:parent&gt;
  </code></pre>
  
  <p>Here, my problem is , I expect the xml to be look like following</p>
  
  <pre><code> &lt;parentPrefix:parent xmlns:childPrefix="urn:xsd:child" xmlns:parentPrefix="parent"&gt;
    &lt;childPrefix:child&gt;
      &lt;childPrefix:Id&gt;ABC123&lt;/childPrefix:Id&gt;
    &lt;/childPrefix:child&gt;
   &lt;/parentPrefix:parent&gt;
  </code></pre>
  
  <p>I expect the prefix of child tag to be "<strong>childPrefix</strong>" but it shows "<strong>parentPrefix</strong>"
  The parent tag is well generated with prefix "<strong>parentPrefix</strong>"</p>
  
  <p><strong>Environment  Description</strong> </p>
  
  <p>Maven 3.0.4</p>
  
  <p>Java version: 1.7.0_04</p>
  
  <p>OS : windows 7</p>