How to parse xml file containing multiple tags using LinkedHashMap?
问题 I want to build a parser to parse an XML file in Java . As you can see in my code below I am using a LinkedHashMap to access the desired values First , Middle and Last . My problem is that I have NameList tags containing multiple Person tags and the LinkedHashMap so far gives me only the last Person , in my example (output): given: Ghi family: Tom given: Jkl family: Mary How can I access the other two (Karl Abc, Thomas Def) using my approach with LinkedHashMap ? This is my XML file: <Sources>