Aslam Kakkove
Aslam Kakkove

Reputation: 97

How to read quotes type of XML file in Android Studio

I need to read this kind of XML files.. I wrote many codes, all are not working..

enter image description here

nodelist = doc.getElementsByTagName("Table");

            } catch (Exception e) {
                Log.e("Error", e.getMessage());
                e.printStackTrace();
            }
            return null;
        }

        @Override
        protected void onPostExecute(Void args) {

            for (int temp = 0; temp <nodelist.getLength(); temp++) {
                Node nNode = nodelist.item(temp);
                if (nNode.getNodeType() == Node.ELEMENT_NODE) {
                    Element eElement = (Element) nNode;

                textview.setText(getNode("StaffID", eElement));

This code does not works..Please help me. Thanks in advance

Upvotes: 1

Views: 57

Answers (1)

Uriel Frankel
Uriel Frankel

Reputation: 14622

The code you try to parse is NOT xml. It is JSON. First try to learn what is JSON. Later try to parse it with JsonObject or maybe GSON. Here are a link to help you understand what is JSON.

Upvotes: 1

Related Questions