List of usage examples for org.apache.commons.configuration XMLConfiguration registerEntityId
public void registerEntityId(String publicId, URL entityURL)
Registers the specified DTD URL for the specified public identifier.
From source file:io.datalayer.conf.XmlConfigurationTest.java
/** * Tests registering the publicId of a DTD. *///from www. j ava2 s . co m @Test public void testRegisterEntityId() throws Exception { URL dtdURL = getClass().getResource("/properties.dtd"); final String publicId = "http://commons.apache.org/test/properties.dtd"; conf = new XMLConfiguration("testDtd.xml"); conf.setPublicID(publicId); conf.save(testSaveConf); XMLConfiguration checkConfig = new XMLConfiguration(); checkConfig.setFile(testSaveConf); checkConfig.registerEntityId(publicId, dtdURL); checkConfig.setValidating(true); checkSavedConfig(checkConfig); }