How to read an XML file with Java?

后端 未结 9 2139
执念已碎
执念已碎 2020-12-03 12:15

I don\'t need to read complex XML files. I just want to read the following configuration file with a simplest XML reader


    loc         


        
9条回答
  •  攒了一身酷
    2020-12-03 12:56

    Although I have not tried XPath yet as it has just come to my attention now, I have tried a few solutions and have not found anything that works for this scenario.

    I decided to make a library that fulfills this need as long as you are working under the assumptions mentioned in the readme. It has the advantage that it uses SAX to parse the entire file and return it to the user in the form of a map so you can lookup values as key -> value.

    https://github.com/daaso-consultancy/ConciseXMLParser

    If something is missing kindly inform me of the missing item as I only develop it based on the needs of others and myself.

提交回复
热议问题