Java XML Document Parse parseXMLDoc(Element element, Document doc, Map oauthResponse)

Here you can find the source of parseXMLDoc(Element element, Document doc, Map oauthResponse)

Description

parse XML Doc

License

Open Source License

Declaration

public static void parseXMLDoc(Element element, Document doc,
            Map<String, String> oauthResponse) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Map;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class Main {
    public static void parseXMLDoc(Element element, Document doc,
            Map<String, String> oauthResponse) {
        NodeList child = null;/*from w  w  w.j a v a2 s . co m*/
        if (element == null) {
            child = doc.getChildNodes();

        } else {
            child = element.getChildNodes();
        }
        for (int j = 0; j < child.getLength(); j++) {
            if (child.item(j).getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) {
                org.w3c.dom.Element childElement = (org.w3c.dom.Element) child
                        .item(j);
                if (childElement.hasChildNodes()) {
                    System.out.println(childElement.getTagName() + " : "
                            + childElement.getTextContent());
                    oauthResponse.put(childElement.getTagName(),
                            childElement.getTextContent());
                    parseXMLDoc(childElement, null, oauthResponse);
                }

            }
        }
    }
}

Related

  1. parseHTMLDocument(String paramString)
  2. parseInitMap(InputStream in, DocumentBuilder builder, Map> initMap)
  3. parseMultipleWorkouts(Document doc)
  4. parseResponse(InputSource is, DocumentBuilder documentBuilder)
  5. parseToDocument(InputStream is, boolean debugModeEnabled)
  6. parseXmlDocToString(Document xmlDoc)
  7. parseXmlDocument(InputStream is, boolean namespaceAware)
  8. parseXMLDocument(String xml)
  9. parseXmlDocument(String xml, boolean namespaceAware)