package com.erigir.maven.plugin.validator;

import org.apache.maven.plugin.MojoExecutionException;
import org.xml.sax.SAXException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;

/**
 * Created by maxkeene on 10/10/14.
 */
public class XMLValidator implements Validator {
    @Override
    public void validate(File src) throws MojoExecutionException {
        try {
            DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            parser.parse(src);
        } catch (IOException | ParserConfigurationException | SAXException e) {
            throw new MojoExecutionException("found invalid xml in file: " + src.getName(), e);
        }
    }
}

@@ -658,22 +658,8 @@
 ch (
-IOException %7C 
 Pars
@@ -687,13 +687,127 @@
 ion 
-%7C SAX
+e) %7B%0A            throw new MojoExecutionException(%22unable to create xml parser%22, e);%0A        %7D catch (SAXException %7C IO
 Exce

split up exception handling