read xml file as a string in java code example
Example: java read xml
String dir = System.getProperty("user.dir");
File inputFile = new File(dir + File.separator + "dats.xml");
DocumentBuilderFactory dbFactory =
DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(inputFile);
doc.getDocumentElement().normalize();
/*
Elimina nodos vacíos y combina adyacentes en caso de que los
hubiera
*/