XpathDocumentCopier extends MessageCopier { public void setXmlDocumentFactoryConfig(DocumentBuilderFactoryBuilder xml) { this.xmlDocumentFactoryConfig = xml; } XpathDocumentCopier();  XpathDocumentCopier(String xpath); @Override CloseableIterable<AdaptrisMessage> splitMessage(AdaptrisMessage msg); void setXpath(String xp); String getXpath(); KeyValuePairSet getNamespaceContext(); void setNamespaceContext(KeyValuePairSet kvps); DocumentBuilderFactoryBuilder getXmlDocumentFactoryConfig(); void setXmlDocumentFactoryConfig(DocumentBuilderFactoryBuilder xml);  }
@Test public void testSplit_DocTypeNotAllowed() throws Exception { AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(); msg.setContent(XML_WITH_DOCTYPE, msg.getContentEncoding()); XpathDocumentCopier splitter = new XpathDocumentCopier(XPATH_DOCUMENT_COUNT); DocumentBuilderFactoryBuilder builder = new DocumentBuilderFactoryBuilder(); builder.getFeatures().add(new KeyValuePair("http: splitter.setXmlDocumentFactoryConfig(builder); try { List<AdaptrisMessage> result = splitToList(splitter, msg); fail(); } catch (CoreException expected) { assertTrue(expected.getMessage().contains("DOCTYPE is disallowed")); } }