Xml not parsing String as input with sax

后端 未结 5 1375
灰色年华
灰色年华 2021-02-14 10:31

I have a string input from which I need to extract simple information, here is the sample xml (from mkyong):



    &l         


        
5条回答
  •  孤独总比滥情好
    2021-02-14 11:08

    You should replace the line saxParser.parse(xml.toString(), handler); with the following one:

    saxParser.parse(new InputSource(new StringReader(xml)), handler);
    

提交回复
热议问题