Best code examples for Android XmlPullParser class (org.xmlpull.v1.XmlPullParser)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android XmlPullParser class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android XmlPullParser examples from Open Source projects
This code example shows how to use the following methods: getAttributeValue, next, setInput
330:	parser.setInput(new StringReader("<foo a='\"' b=\"'\"></foo>")); 
331:	assertEquals(XmlPullParser.START_TAG, parser.next()); 
332:	assertEquals("\"", parser.getAttributeValue(0)); 
333:	assertEquals("'", parser.getAttributeValue(1)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getName, getText, next, nextToken, setInput
484:	assertEquals(XmlPullParser.DOCDECL, parser.nextToken()); 
485:	assertEquals(" foo [<!ENTITY bb \"bar baz\">]", parser.getText()); 
486:	assertNull(parser.getName()); 
487:	assertEquals(XmlPullParser.START_TAG, parser.nextToken()); 
488:	assertEquals(XmlPullParser.TEXT, parser.next()); 
489:	assertEquals("abar bazc", parser.getText()); 
490:	assertEquals(XmlPullParser.END_TAG, parser.next()); 
491:	assertEquals(XmlPullParser.END_DOCUMENT, parser.next()); 
-
534:	result.setInput(new StringReader(xml)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getName, getText, next, nextToken, setInput
169:	assertEquals(XmlPullParser.DOCDECL, parser.nextToken()); 
170:	assertEquals(XmlPullParser.START_TAG, parser.nextToken()); 
171:	assertEquals("foo", parser.getName()); 
172:	assertEquals(XmlPullParser.TEXT, parser.nextToken()); 
173:	assertEquals("a", parser.getText()); 
174:	assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); 
175:	assertEquals("bb", parser.getName()); 
176:	assertEquals("", parser.getText()); 
177:	assertEquals(XmlPullParser.START_TAG, parser.nextToken()); 
178:	assertEquals("bar", parser.getName()); 
179:	assertEquals(XmlPullParser.TEXT, parser.nextToken()); 
180:	assertEquals("baz", parser.getText()); 
181:	assertEquals(XmlPullParser.COMMENT, parser.nextToken()); 
182:	assertEquals("quux", parser.getText()); 
183:	assertEquals(XmlPullParser.END_TAG, parser.nextToken()); 
184:	assertEquals("bar", parser.getName()); 
185:	assertEquals(XmlPullParser.TEXT, parser.nextToken()); 
186:	assertEquals("c", parser.getText()); 
187:	assertEquals(XmlPullParser.END_TAG, parser.next()); 
188:	assertEquals(XmlPullParser.END_DOCUMENT, parser.next()); 
-
534:	result.setInput(new StringReader(xml)); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getAttributeValue
99:	String extension = mXpp.getAttributeValue(null, ATTR_EXTENSION); 
100:	String mimetype = mXpp.getAttributeValue(null, ATTR_MIMETYPE); 
101:	String icon = mXpp.getAttributeValue(null, ATTR_ICON); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getAttributeValue, getName, getText, next, nextTag
252:	parser.require(XmlPullParser.START_TAG, null,TAG_CHANGELOGTEXT); 
-
254:	String tag = parser.getName(); 
-
260:	String changeLogTextTitle=parser.getAttributeValue(null,ATTRIBUTE_CHANGETEXTTITLE); 
-
265:	String bulletedList = parser.getAttributeValue(null, ATTRIBUTE_BULLETEDLIST); 
-
277:	if (parser.next() == XmlPullParser.TEXT) { 
278:	String changeLogText=parser.getText(); 
-
282:	parser.nextTag(); 
-
288:	parser.require(XmlPullParser.END_TAG, null,TAG_CHANGELOGTEXT); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getAttributeValue
99:	String extension = mXpp.getAttributeValue(null, ATTR_EXTENSION); 
100:	String mimetype = mXpp.getAttributeValue(null, ATTR_MIMETYPE); 
101:	String icon = mXpp.getAttributeValue(null, ATTR_ICON); 
Full Snippet Info
7
CodeRank
Related Android XmlPullParser Questions & Answers:
Other Android XmlPullParser Examples
13:	         XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
14:	         factory.setNamespaceAware(true);
15:	         XmlPullParser xpp = factory.newPullParser();
16:	
17:	         xpp.setInput(new StringReader ("<foo>Hello World!</foo>"));

Read More

See Code Examples for Android XmlPullParser Methods: