Code example for DOMImplementation

Methods: getFeaturehasFeature

    private void assertFeature(String feature, String version) {
        String message = "This implementation is expected to support "
                + feature + " v. " + version + " but does not.";
        assertTrue(message, domImplementation.hasFeature(feature, version));
        assertNotNull(message, domImplementation.getFeature(feature, version));
    private void assertNoFeature(String feature, String version) {
        assertFalse(domImplementation.hasFeature(feature, version));
        assertNull(domImplementation.getFeature(feature, version));
    public void testIsSupported() { 
        // we don't independently test the features; instead just assume the 
        // implementation calls through to hasFeature (as tested above) 
        for (Node node : allNodes) {
            assertTrue(node.isSupported("XML", null));
            assertTrue(node.isSupported("XML", "3.0"));
Stop searching for code, let great code find you!  Add Codota to your java IDE