title: JAXB unmarshal return null for attributes
body: <p>After unmarshalling the XML file, all properties which are attributes in the XML file have the value NULL (fileDateTime, fileId, etc...)</p>
  
  <p>I don't really understand why as I have the correct annotations <code>@XmlAttribute(name = "FileDateTime")</code> and <code>@XmlAttribute(name = "FileId")</code></p>
  
  <p>As you can see I don't use any namespace (so not a namespace issue I think!)</p>
  
  <p>I am using JDK 1.6, Sax 2.0.1 and XercesImpl 2.9.1</p>
  
  <p>Thanks for your help.</p>
  
  <p><strong>test.xml</strong></p>
  
  <pre><code>&lt;KeyImport_file FileDateTime="2013-05-30T09:00:00" FileId="KeyImport_source_20121231124500"&gt;
      &lt;!--1 or more repetitions:--&gt;
      &lt;record record_number="10"&gt;
      ...
      &lt;/record&gt;
  &lt;/KeyImport_file&gt;
  </code></pre>
  
  <p><strong>KeyImportFile.java</strong></p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "", propOrder = {
      "record"
  })
  @XmlRootElement(name = "KeyImport_file")
  public class KeyImportFile {
  
      @XmlElement(required = true)
      protected List&lt;KeyImportFile.Record&gt; record;
  
      @XmlAttribute(name = "FileDateTime")
      @XmlSchemaType(name = "dateTime")
      protected XMLGregorianCalendar fileDateTime;
  
      @XmlAttribute(name = "FileId")
      protected String fileId;
  etc...
  etc...
  </code></pre>
  
  <p><strong>The parse method (unmarshal &amp; XSD validation):</strong></p>
  
  <pre><code>import org.xml.sax.InputSource;
  import org.xml.sax.XMLReader;
  
  import javax.xml.XMLConstants;
  import javax.xml.bind.JAXBContext;
  import javax.xml.bind.UnmarshallerHandler;
  import javax.xml.parsers.SAXParser;
  import javax.xml.parsers.SAXParserFactory;
  import javax.xml.transform.stream.StreamSource;
  import javax.xml.validation.Schema;
  import javax.xml.validation.SchemaFactory;
  import java.io.InputStream;
  
  private KeyImportFile parseXML(final InputStream xmlInputStream, final StreamSource xsdSource)
          throws Exception
  {
      KeyImportFile keyImportFile;
  
      SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
      Schema schema = schemaFactory.newSchema(xsdSource);
  
      JAXBContext jc = JAXBContext.newInstance(KeyImportFile.class);
  
      UnmarshallerHandler unmarshallerHandler = jc.createUnmarshaller().getUnmarshallerHandler();
  
      SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
      saxParserFactory.setSchema(schema);
  
      SAXParser saxParser = saxParserFactory.newSAXParser();
      XMLReader xmlReader = saxParser.getXMLReader();
      xmlReader.setContentHandler(unmarshallerHandler);
      xmlReader.setErrorHandler(keyImportErrorHandler);
  
      InputSource inputSource = new InputSource(xmlInputStream);
      xmlReader.parse(inputSource);
      xmlInputStream.close();
  
      keyImportFile = (KeyImportFile) unmarshallerHandler.getResult();
  
      return keyImportFile;
  }
  </code></pre>
  
  <p><strong>EDIT</strong> </p>
  
  <p>Just change my parse method without using sax and it works. Any idea why? I would like to use sax with jabx for performance issue.</p>
  
  <pre><code>KeyImportFile keyImportFile;
  
  SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
  Schema schema = schemaFactory.newSchema(xsdSource);
  
  JAXBContext jc = JAXBContext.newInstance(KeyImportFile.class);
  
  Unmarshaller unmarshaller = jc.createUnmarshaller();
  unmarshaller.setSchema(schema);
  keyImportFile = (KeyImportFile) unmarshaller.unmarshal(xmlInputStream);
  </code></pre>