Created
April 7, 2012 05:38
-
-
Save yamanyar/2325578 to your computer and use it in GitHub Desktop.
Cursor Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URL u = new URL("http://www.cafeconleche.org/"); | |
InputStream in = u.openStream(); | |
XMLInputFactory factory = XMLInputFactory.newInstance(); | |
XMLStreamReader parser = factory.createXMLStreamReader(in); | |
while (true) { | |
int event = parser.next(); | |
if (event == XMLStreamConstants.END_DOCUMENT) { | |
parser.close(); | |
break; | |
} | |
if (event == XMLStreamConstants.START_ELEMENT) { | |
System.out.println(parser.getLocalName()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment