Results 1 to 3 of 3

Thread: problem in reading attribute value from xml.

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Posts
    6

    Post problem in reading attribute value from xml.

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

    i have annotated the field like this ....

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

    can u say me how to get attribute value.

    thanks,
    GOkul.

  2. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    We need a little more information about the files you're reading, etc in order to help. Although, considering that Spring OXM has been moved into core with Spring 3.0, you might want to try the question in that forum.

  3. #3
    Join Date
    Nov 2009
    Posts
    6

    Post

    my xml record seems to be like this...

    <?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 read the Entity value..
    any idea ??

    thanks,
    GOkul

Posting Permissions

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