Preserve newlines when parsing xml

后端 未结 2 2098
野趣味
野趣味 2021-01-22 04:18

I\'m using the SAX xml parser to parse some xml data which contains newlines. When using Attributes#getValue, the newline data is lost. How can keep the newlines?

2条回答
  •  太阳男子
    2021-01-22 04:50

    you can use this code when getting the String to parse:

      public void characters(char ch[], int start, int length) { 
    
    
          for(int i=start; i

提交回复
热议问题