class TableTagParser {

    public Table parser(String file) throws TableTagParseException {
        Table table = null;
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

            SchemaFactory schfactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
            schfactory.setErrorHandler(null);
            Schema schema = schfactory.newSchema(new StreamSource(MifosResourceUtil.getClassPathResourceAsURIString(FilePaths.CUSTOMTABLETAGXSD)));
            factory.setNamespaceAware(false);
            factory.setValidating(false);
            factory.setSchema(schema);

            DocumentBuilder builder = factory.newDocumentBuilder();
            builder.setErrorHandler(null);
            Document document = builder.parse(MifosResourceUtil.getClassPathResourceAsURIString(file));

            table = createTable(document);

        } catch (Exception e) {
            throw new TableTagParseException(e);
        }
        return table;
    }

}