What is the way of data parsing in Android?
This article mainly introduces the relevant knowledge of what is the way of data parsing in Android, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on data parsing in Android. Let's take a look at it.
1.DOM parsing
/ / 1. Create a DocumentBuilderFactory object DocumentBuilderFactory dBuilderFactory=DocumentBuilderFactory.newInstance (); try {/ / 2. Create a DocumentBuilder object DocumentBuilder dBuilder=dBuilderFactory.newDocumentBuilder (); / / 3. Get Document object Document document=dBuilder.parse ("Movie.xml"); System.out.println ("parsing start:--"); / / get Movie element node collection NodeList movies=document.getElementsByTagName ("Movie"); System.out.println ("Commons" + movies.getLength () + "Movie") / / traversing the Movie element node collection for (int iTuno Teti)