pp.require(pp.START_TAG, null, "test"); assertEquals("value", pp.getAttributeValue(pp.NO_NAMESPACE, "att"));
pp.require(XmlPullParser.START_TAG, null, "test"); assertEquals("value", pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, "att"));
    private void checkAttributeQuot(boolean useApostrophe, XmlSerializer ser) throws Exception {        StringWriter sw = new StringWriter();        ser.setOutput(sw);                ser.startTag("", "test");        ser.attribute(null, "att", "value");        ser.endTag("", "test");        ser.endDocument();                String s = sw.toString();        if(useApostrophe) {            assertTrue("use apostrophe for attribute value", s.indexOf("'value'") !=-1);        } else {            assertTrue("use quotation for attribute value", s.indexOf("\"value\"") !=-1);        }                // some validaiton of serialized XML        XmlPullParser pp = factory.newPullParser();        pp.setInput(new StringReader(s));        pp.nextTag();        pp.require(pp.START_TAG, null, "test");        assertEquals("value", pp.getAttributeValue(pp.NO_NAMESPACE, "att"));        pp.nextTag();        pp.require(pp.END_TAG, null, "test");    }