// Path: src/com/omtgdesigner/xml/XMLValidator.java
// public class XMLValidator {
// 
// 	private static final XMLValidator xmlValidator = new XMLValidator();
// 	
// 	private SchemaFactory factory;
// 	
// 	/**
// 	 * Constructor
// 	 */
// 	private XMLValidator() {
// 		factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
// 	}
// 	
// 	/**
// 	 * @return the instance of this singleton class.
// 	 */
// 	public static XMLValidator getInstance() {
// 		return xmlValidator;
// 	}
// 
// 	/**
// 	 * @param xml
// 	 * @param schema
// 	 * @return
// 	 */
// 	public boolean validateXML(String xsdPath, String xml){
// 		try {         
//             Schema schema = factory.newSchema(new StreamSource(getClass().getResourceAsStream(xsdPath)));
//             Validator validator = schema.newValidator();
//             validator.validate(new StreamSource(new StringReader(xml)));
//         } catch (SAXException e) {
//             return false;
//         } catch (IOException e) {
//             return false;
//         }
//         return true;
// 	}	
// }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.omtgdesigner.xml.XMLValidator;
package com.omtgdesigner.servlets;




/**
 * Servlet implementation class XMLImporter
 */
public class XMLImporter extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * Validates the XML document;
	 */
// Path: src/com/omtgdesigner/xml/XMLValidator.java
// public class XMLValidator {
// 
// 	private static final XMLValidator xmlValidator = new XMLValidator();
// 	
// 	private SchemaFactory factory;
// 	
// 	/**
// 	 * Constructor
// 	 */
// 	private XMLValidator() {
// 		factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
// 	}
// 	
// 	/**
// 	 * @return the instance of this singleton class.
// 	 */
// 	public static XMLValidator getInstance() {
// 		return xmlValidator;
// 	}
// 
// 	/**
// 	 * @param xml
// 	 * @param schema
// 	 * @return
// 	 */
// 	public boolean validateXML(String xsdPath, String xml){
// 		try {         
//             Schema schema = factory.newSchema(new StreamSource(getClass().getResourceAsStream(xsdPath)));
//             Validator validator = schema.newValidator();
//             validator.validate(new StreamSource(new StringReader(xml)));
//         } catch (SAXException e) {
//             return false;
//         } catch (IOException e) {
//             return false;
//         }
//         return true;
// 	}	
// }


// Path: src/com/omtgdesigner/servlets/XMLImporter.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.omtgdesigner.xml.XMLValidator;

package com.omtgdesigner.servlets;




/**
 * Servlet implementation class XMLImporter
 */
public class XMLImporter extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * Validates the XML document;
	 */
	private XMLValidator xmlValidator;