Code example for NamespaceSupport

Methods: processNamepushContextsetNamespaceDeclUris

0
                ns.processName("ck:lorem", parts, true));
 
        assertNull("Test 14: Null expected for xmlns prefix.",
                ns.processName("xmlns:ipsum", parts, true));
 
        ns = new NamespaceSupport();
        ns.setNamespaceDeclUris(true);
        ns.pushContext();
        assertNotNull("Test 15: Non-null value expected.",
                ns.processName("xmlns", parts, true));
        assertEquals("Test 16: Incorrect namespace URI;", NamespaceSupport.NSDECL, parts[0]);
        assertEquals("Test 17: Incorrect local name;", "xmlns", parts[1]);
        assertEquals("Test 18: Incorrect raw name;", "xmlns", parts[2]);
    } 
 
    @SuppressWarnings("unchecked") 
    private int countPrefixes() 
    { 
        ArrayList<String> prefixes = Collections.list(ns.getPrefixes());
        return prefixes.size();
Stop searching for code, let great code find you!  Add Codota to your java IDE