Simple Java XML Parser with CSS support
String myString = "<div><text>Hello !</text></div>";
XMLElement rootDiv = new XMLParser().parse(myString);
File file = new File(getClass().getResource("myFile.xml").getFile());
try (FileInputStream fis = new FileInputStream(file)) {
XMLElement root = XMLParser.parse(fis);
} catch (IOException e) {
e.printStackTrace();
}
String myString = "<div><text id=\"my-text\">Hello !</text></div>";
XMLParser parser = new XMLParser().with("text", TextElement::new);
XMLElement rootDiv = parser.parse(myString);
TextElement textElement = (TextElement) parser.getElementById("my-text");