SimpleXMLParser { public static void parse(final SimpleXMLDocHandler doc, final SimpleXMLDocHandlerComment comment, final Reader r, final boolean html) throws IOException { SimpleXMLParser parser = new SimpleXMLParser(doc, comment, html); parser.go(r); } private  SimpleXMLParser(final SimpleXMLDocHandler doc, final SimpleXMLDocHandlerComment comment, final boolean html); static void parse(final SimpleXMLDocHandler doc, final SimpleXMLDocHandlerComment comment, final Reader r, final boolean html); static void parse(final SimpleXMLDocHandler doc, final InputStream in); static void parse(final SimpleXMLDocHandler doc,final Reader r); @Deprecated static String escapeXML(final String s, final boolean onlyASCII);  }
@Test public void whitespaceHtml() throws IOException { String whitespace = "<p>sometext\r moretext</p>"; String expected = "sometext moretext"; final StringBuilder b = new StringBuilder(); SimpleXMLParser.parse(new SimpleXMLDocHandler() { public void text(final String str) { b.append(str); } public void startElement(final String tag, final Map<String, String> h) { } public void startDocument() { } public void endElement(final String tag) { } public void endDocument() { } }, null, new StringReader(whitespace), true); Assert.assertEquals(expected, b.toString()); }