Code example for NamespaceSupport

Methods: processName, pushContext

0
                ns.processName("ck:lorem", parts, false));
 
        assertNull("Test 14: Null expected for xmlns prefix.",
                ns.processName("xmlns:ipsum", parts, false));
 
        ns = new NamespaceSupport();
        ns.pushContext();
        assertNotNull("Test 15: Non-null value expected.",
                ns.processName("world", parts, false));
        assertEquals("Test 16: Incorrect namespace URI;", "", parts[0]);
        assertEquals("Test 17: Incorrect local name;", "world", parts[1]);
        assertEquals("Test 18: Incorrect raw name;", "world", parts[2]);
    } 
 
    public void testProcessName_Attribute() { 
        String[] parts = new String[3];
 
        assertNotNull("Test 1: Non-null value expected.",
                ns.processName("ak:hello", parts, true));
        assertEquals("Test 2: Incorrect namespace URI;", marketUri, parts[0]);
        assertEquals("Test 3: Incorrect local name;", "hello", parts[1]);