Results 1 to 2 of 2

Thread: problem in reading attribute value from xml

Hybrid View

  1. #1
    Join Date
    Sep 2011
    Location
    China Shenzhen
    Posts
    2

    Default problem in reading attribute value from xml

    hi,
    am using Jaxb2Marshaller to unmarshall xml data.i cant able to read attribute value.

    xml record ...

    <?xml version="1.0" encoding="Shift_JIS"?>
    <ExposureData xsi:noNamespaceSchemaLocation="Exposure_Data.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ProductType>a</ProductType>
    <Product>SFT_NHA</Product>
    <BusinessUnit Entity="NHA">NHA</BusinessUnit>
    <BaseDate>2008-12-30</BaseDate>
    <CSAContract>YES</CSAContract>
    </ExposureData>

    i want to get Entity value and have annotated the field like this ....

    @XmlAttribute(required = true)
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    private String Entity = null;

    any idea's....
    how to get attribute value.

    thanks,
    Yolanda.

    XML inspection before OXM binding

  2. #2
    Join Date
    Sep 2011
    Location
    China Shenzhen
    Posts
    2

    Default Help!!

    Help!! I find the answer for a long time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •