Keep new lines when parsing xml

I am using the SAX xml parser to parse some XML data containing newlines. When using the # getValue attributes, newline data is lost. How to save newlines?

+1
source share
2 answers

The solution was to use 
 instead of \ n

-2
source

you can use this code when getting a string for parsing:

  public void characters(char ch[], int start, int length) { for(int i=start; i<length; i++) if(!Character.isISOControl(ch[i])) content.append(ch[i]); } 
0
source

Source: https://habr.com/ru/post/1332177/


All Articles