pp.require(pp.START_TAG, null, "test"); assertEquals("value", pp.getAttributeValue(pp.NO_NAMESPACE, "att")); assertEquals("valueA", pp.getAttributeValue(pp.NO_NAMESPACE, "attA")); assertEquals("valueQ", pp.getAttributeValue(pp.NO_NAMESPACE, "attQ"));
pp.require(XmlPullParser.START_TAG, null, "test"); assertEquals("value", pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, "att")); assertEquals("valueA", pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, "attA")); assertEquals("valueQ", pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, "attQ"));
    private void checkAttributeQuotMix(XmlSerializer ser) throws Exception {        StringWriter sw = new StringWriter();        ser.setOutput(sw);                ser.startTag("", "test");        ser.attribute(null, "att", "value");        ser.setFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE, true);        ser.attribute(null, "attA", "valueA");        ser.setFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE, false);        ser.attribute(null, "attQ", "valueQ");        ser.endTag("", "test");        ser.endDocument();                String s = sw.toString();        assertTrue("use apostrophe for attribute value", s.indexOf("'valueA'") !=-1);        assertTrue("use apostrophe for attribute value", s.indexOf("\"valueQ\"") !=-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"));        assertEquals("valueA", pp.getAttributeValue(pp.NO_NAMESPACE, "attA"));        assertEquals("valueQ", pp.getAttributeValue(pp.NO_NAMESPACE, "attQ"));        pp.nextTag();        pp.require(pp.END_TAG, null, "test");    }