// Path: ask-app/src/main/java/com/androidstarterkit/exception/IllegalDocumentException.java
// public class IllegalDocumentException extends RuntimeException {
// 
//   public IllegalDocumentException(String msg) {
//     super(msg);
//   }
// }


import com.androidstarterkit.exception.IllegalDocumentException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
package com.androidstarterkit.tool;






public class XmlDomReader {
  private static final String TAG = XmlDomReader.class.getSimpleName();

  private Document document;

  public XmlDomReader(File file) {
    DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();

    DocumentBuilder documentBuilder;
    try {
      documentBuilder = builderFactory.newDocumentBuilder();
      document = documentBuilder.parse(file);
    } catch (ParserConfigurationException | SAXException | IOException e) {
// Path: ask-app/src/main/java/com/androidstarterkit/exception/IllegalDocumentException.java
// public class IllegalDocumentException extends RuntimeException {
// 
//   public IllegalDocumentException(String msg) {
//     super(msg);
//   }
// }


// Path: ask-app/src/main/java/com/androidstarterkit/tool/XmlDomReader.java
import com.androidstarterkit.exception.IllegalDocumentException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

package com.androidstarterkit.tool;






public class XmlDomReader {
  private static final String TAG = XmlDomReader.class.getSimpleName();

  private Document document;

  public XmlDomReader(File file) {
    DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();

    DocumentBuilder documentBuilder;
    try {
      documentBuilder = builderFactory.newDocumentBuilder();
      document = documentBuilder.parse(file);
    } catch (ParserConfigurationException | SAXException | IOException e) {
      throw new IllegalDocumentException("failed to create document : " + file.getPath());