Java Code Examples for org.xml.sax.helpers.AttributesImpl.setAttribute()

The following are Jave code examples for showing how to use setAttribute() of the org.xml.sax.helpers.AttributesImpl class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: openjdk-jdk10   File: AttrImplTest.java   View Source Code Vote up 5 votes
/**
 * Basic test for getLocalName(int), getQName(int), getType(int),
 * getType(String) and getURI(int).
 */
@Test
public void testcase06() {
    AttributesImpl attr = new AttributesImpl();
    attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
    attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
            JEEP_VALUE);
    attr.setAttribute(1, "www.megginson.com", "author", "meg", "s", "SAX2");
    assertEquals(attr.getLocalName(1), "author");
    assertEquals(attr.getQName(1), "meg");
    assertEquals(attr.getType(1), "s");
    assertEquals(attr.getType("meg"), "s");
    assertEquals(attr.getURI(1), "www.megginson.com");
}