简体   繁体   中英

dumb xml-file with unique tags (Java)

I have a .xml file with this kind of tag: "tag_X" and "sub_tagY". Like this:

<tag_1>
  <sub_tag1>
    <key>something here</key>
  </sub_tag1>
<tag_1>
<tag_2>
  <sub_tag1>
    <key>something here</key>
  </sub_tag1>
  <sub_tag2>
    <key>something here</key>
  </sub_tag2>
<tag_2>
<tag_3>
  <sub_tag1>
    <key>something here</key>
  </sub_tag1>
<tag_3>

I started using DOM but this is not working properly... Can anyone help me to read it in Java? Thanks!!

You can use the xstream library. More details about XStream Docs

Thanks

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