I am looking forward to store each line a validate a specific condition while parsing the XML file using SAX parser in Java.
Issue: when I convert the character [] to a new string with Characters(...) method of the parser, I am not getting the line text properly.
Expected: Need to store a line of XML file inside a String variable.
Code:
public void characters(char[] arg0, int arg1, int arg2) throws SAXException {
if (text) {
String str = new String(arg0,arg1,arg2);
System.out.println(str.trim());
}}