@Override protected void setUp() throws Exception { properties = new CleanerProperties(); properties.setOmitHtmlEnvelope(true); properties.setOmitXmlDeclaration(true); compactXmlSerializer = new BrowserCompactXmlSerializer(properties); }
public void testRandomCloseTagsRemoved() throws IOException { HtmlCleaner cleaner = new HtmlCleaner(); CleanerProperties properties = cleaner.getProperties(); properties.setOmitHtmlEnvelope(true); properties.setOmitXmlDeclaration(true); SimpleXmlSerializer serializer = new SimpleXmlSerializer(properties); TagNode cleaned = cleaner.clean("Some</span> text </b></div>"); assertEquals("Some text ", serializer.getAsString(cleaned)); }