How can I transform XML into a List or String[]?

后端 未结 8 1749
半阙折子戏
半阙折子戏 2020-12-01 08:19

How can I transform the following XML into a List or String[]:


  1
  2<         


        
8条回答
  •  情歌与酒
    2020-12-01 08:54

    You can use Properties class.

    Properties prop = new Properties();
    prop.loadFromXML(stream);
    Set set = prop.keySet();
    

    You can than access Strings from set for each key. Key is element name of xml.

提交回复
热议问题