Package org.fao.geonet.exceptions

Examples of org.fao.geonet.exceptions.XSDValidationErrorEx


        DataManager.setNamespacePrefix(xml);
        try {
            dataMan.validate(schema, xml);
        } catch (XSDValidationErrorEx e) {
            if (!fileName.equals(" ")) {
                throw new XSDValidationErrorEx(e.getMessage()+ "(in "+fileName+"): ",e.getObject());
            } else {
                throw new XSDValidationErrorEx(e.getMessage(),e.getObject());
            }
        }

        //--- Now do the schematron validation on this file - if there are errors
        //--- then we say what they are!
View Full Code Here


    Schema schema = factory().newSchema();
    ErrorHandler eh = new ErrorHandler();
    validateRealGuts(schema, xml, eh);
    if (eh.errors()) {
      Element xsdXPaths = eh.getXPaths();
      throw new XSDValidationErrorEx("XSD Validation error(s):\n"+getString(xsdXPaths), xsdXPaths);
    }
  }
View Full Code Here

     * @throws Exception
     */
  public static void validate(String schemaPath, Element xml) throws Exception
  {
    Element xsdXPaths = validateInfo(schemaPath,xml);
    if (xsdXPaths != null && xsdXPaths.getContent().size() > 0) throw new XSDValidationErrorEx("XSD Validation error(s):\n"+getString(xsdXPaths), xsdXPaths);
  }
View Full Code Here

TOP

Related Classes of org.fao.geonet.exceptions.XSDValidationErrorEx

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.