@Override protected Document parseDomImpl(String source) throws GadgetException { MessageQueue mq = new SimpleMessageQueue(); try { DomParser parser = getDomParser(source, mq); Document doc = parser.parseDocument().getOwnerDocument(); VanillaCajaHtmlSerializer serializer = new VanillaCajaHtmlSerializer(); HtmlSerialization.attach(doc, serializer, null); return doc; } catch (ParseException e) { throw new GadgetException(GadgetException.Code.HTML_PARSE_ERROR, e.getCajaMessage().toString(), HttpResponse.SC_INTERNAL_SERVER_ERROR); } catch (NullPointerException e) { throw new GadgetException(GadgetException.Code.INTERNAL_SERVER_ERROR, e); } }
@Before public void setUp() throws Exception { DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance(); // Require the traversal API DOMImplementation domImpl = registry.getDOMImplementation("XML 1.0 Traversal 2.0"); parser = new VanillaCajaHtmlParser(domImpl, true); serializer = new VanillaCajaHtmlSerializer(); }
@Before public void setUp() throws Exception { DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance(); // Require the traversal API DOMImplementation domImpl = registry.getDOMImplementation("XML 1.0 Traversal 2.0"); parser = new VanillaCajaHtmlParser(domImpl, true); serializer = new VanillaCajaHtmlSerializer(); }
@Before public void setUp() throws Exception { DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance(); // Require the traversal API DOMImplementation domImpl = registry.getDOMImplementation("XML 1.0 Traversal 2.0"); parser = new VanillaCajaHtmlParser(domImpl, true); serializer = new VanillaCajaHtmlSerializer(); }
@Before public void setUp() throws Exception { DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance(); // Require the traversal API DOMImplementation domImpl = registry.getDOMImplementation("XML 1.0 Traversal 2.0"); parser = new VanillaCajaHtmlParser(domImpl, true); serializer = new VanillaCajaHtmlSerializer(); }