简体   繁体   中英

JAXB Unmarshalling with outer and inner tags having same name and different attributes

   <xyz>
      <a attributeA, AttributeB>
        <b> </b>
        <c>
            <a attribute1,attribute2,attribute3/>
        </c>
     </a>
  </xyz>

can anyone suggest me how to deal with 'a' innertag.

I find JAXB annotations easier.

@XMLElement
xyz.A a;

Probably in another bean class:

@XMLElement(name = "a")
xyz.c.A suba;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM