Deserializing XML Attributes to Object Fields Using Jackson XML Mapper

I am trying to deserialize XML to an object in Java using the Jackson XML library. I have a class structure that has been generated from a schema. Here is an example of the classes:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BijlageType", propOrder = {
    "mimeContentId",
    "mimeTypeCode",
    "bestandsnaam"
})
public class BijlageType {
    @XmlElement(name = "MimeContentId", required = true)
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlSchemaType(name = "token")
    protected String mimeContentId;

    @XmlElement(name = "MimeTypeCode", required = true)
    protected IANAMimeMediaTypeCodeType mimeTypeCode;

    @XmlElement(name = "Bestandsnaam", required = true)
    protected String bestandsnaam;

    // getters and setters ...
}

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "IANAMimeMediaTypeCodeType", namespace = "urn:un:unece:uncefact:data:standard:QualifiedDataType:11", propOrder = {
    "value"
})
public class IANAMimeMediaTypeCodeType {
    @XmlValue
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    protected String value;

    @XmlAttribute(name = "listID")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlSchemaType(name = "token")
    protected String listID;

    @XmlAttribute(name = "listAgencyID")
    protected AgencyIdentificationCodeContentType listAgencyID;

    @XmlAttribute(name = "listVersionID")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlSchemaType(name = "token")
    protected String listVersionID;

    @XmlAttribute(name = "listURI")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlSchemaType(name = "token")
    protected String listURI;

    // getters and setters ...
}

@XmlType(name = "AgencyIdentificationCodeContentType", namespace = "urn:un:unece:uncefact:codelist:standard:6:3055:D09B")
@XmlEnum
public enum AgencyIdentificationCodeContentType {
    EBV,
    IANA;

    public String value() {
        return name();
    }

    public static AgencyIdentificationCodeContentType fromValue(String v) {
        return valueOf(v);
    }
}

Here is an example of the XML content I am trying to deserialize:

<ns0:Bijlage>
    <gsk:MimeContentId>6816d9b3-d5fe-469e-877c-79aaa81777ca</gsk:MimeContentId>
    <gsk:MimeTypeCode listAgencyID="IANA">application/pdf</gsk:MimeTypeCode>
    <gsk:Bestandsnaam>202331509570500551.pdf</gsk:Bestandsnaam>
</ns0:Bijlage>

When I deserialize the XML to the Java objects, the mimeTypeCode value is null even though the listAgencyID is correctly set to “IANA”.
This issue occurs for any element that has an attribute(s) (listAgencyID=”IANA” is an example of one of them).

Here is the code I am using for deserialization:

private AanvraagType xmlContent(String urlPath) {
    String url = fileService.getTextfileFromUrl(urlPath);
    XmlMapper xmlMapper = getXmlWrapper();

    AanvraagType data = xmlMapper.readValue(url, AanvraagType.class);
    return data;
}

public static XmlMapper getXmlWrapper() {
    // Create a JacksonXmlModule with default use of wrapper elements turned off
    JacksonXmlModule module = new JacksonXmlModule();
    module.setDefaultUseWrapper(false);

    // Create an XmlMapper instance with the configured module
    XmlMapper xmlMapper = new XmlMapper(module);
    // Configure various settings for the XmlMapper instance
    xmlMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
    xmlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    xmlMapper.configure(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES, false);
    xmlMapper.configure(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, false);
    xmlMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
    xmlMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
    xmlMapper.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET, false);

    return xmlMapper;
}

Questions:

Why is the mimeTypeCode value not being set correctly during deserialization?
What is wrong with my setup or code that is causing this issue?
How can I solve this problem to ensure that the mimeTypeCode value and other objects are set up correctly deserialized?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật