Examples of loadSchema()


Examples of com.thaiopensource.validate.ValidationDriver.loadSchema()

      ByteArrayOutputStream error = new ByteArrayOutputStream();
        ErrorHandlerImpl eh = new ErrorHandlerImpl(new BufferedWriter(new OutputStreamWriter(error)));
        ValidateProperty.ERROR_HANDLER.put(properties, eh);
        SchemaReader schemaReader = new AutoSchemaReader();
        ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), schemaReader);
        if (driver.loadSchema(in)) {
            if (driver.validate(ValidationDriver.uriOrFileInputSource(xml.getAbsolutePath()))) {
                log.debug("" + error);
                return null;
            } else {
                log.error("" + error);
View Full Code Here

Examples of com.thaiopensource.validate.ValidationDriver.loadSchema()

   
    private static void validateXmlDocumentUsingRng(final String xmlFileName, final String validationFileName)
            throws SAXException, IOException, ApplicationException {
       
        final ValidationDriver validationDriver = new ValidationDriver();
        if (!validationDriver.loadSchema(new InputSource(
                XmlUtils.class.getResourceAsStream("/" + validationFileName)))) {
            throw new ApplicationException("Error during loading RNG schema");
        }
        if (!validationDriver.validate(ValidationDriver.fileInputSource(xmlFileName))) {
            throw new ApplicationException("Error during parsing project file");
View Full Code Here

Examples of com.thaiopensource.validate.ValidationDriver.loadSchema()

  ByteArrayOutputStream error = new ByteArrayOutputStream();
        ErrorHandlerImpl eh = new ErrorHandlerImpl(new BufferedWriter(new OutputStreamWriter(error)));
        ValidateProperty.ERROR_HANDLER.put(properties, eh);
        SchemaReader schemaReader = new AutoSchemaReader();
        ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), schemaReader);
        if (driver.loadSchema(in)) {
            if (driver.validate(ValidationDriver.uriOrFileInputSource(xml.getAbsolutePath()))) {
                System.out.println("" + error);
                return null;
            } else {
                return "" + error;
View Full Code Here

Examples of com.thaiopensource.validate.ValidationDriver.loadSchema()

            ErrorHandlerImpl eh = new ErrorHandlerImpl(
                    new BufferedWriter(new OutputStreamWriter(error)));
            ValidateProperty.ERROR_HANDLER.put(properties, eh);
            SchemaReader schemaReader = new AutoSchemaReader();
            ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), schemaReader);
            if (driver.loadSchema(schemaInputSource)) {
                if (driver.validate(xmlInputSource)) {
                    log.debug("" + error);
                    return null;
                }
              log.error("" + error);
View Full Code Here

Examples of com.thaiopensource.validate.ValidationDriver.loadSchema()

            // Setup driver
            final ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), schemaReader);

            // Load schema
            driver.loadSchema(new InputSource(grammarUrl));

            // Validate XML instance
            driver.validate(new InputSource(stream));

        } catch(final IOException ex) {
View Full Code Here

Examples of com.thaiopensource.validate.ValidationDriver.loadSchema()

        InputSource nvdl = S9apiUtils.xdmToInputSource(runtime, nvdldoc);
        InputSource doc = S9apiUtils.xdmToInputSource(runtime, srcdoc);

        try {
            driver.loadSchema(nvdl);

            if (!driver.validate(doc)) {
                if (assertValid) {
                    throw XProcException.stepError(53);
                }
View Full Code Here

Examples of com.thaiopensource.validate.ValidationDriver.loadSchema()

            schemaInputSource = S9apiUtils.xdmToInputSource(runtime, schema);
        }

        ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), sr);
        try {
            if (driver.loadSchema(schemaInputSource)) {
                InputSource din = S9apiUtils.xdmToInputSource(runtime, doc);
                if (!driver.validate(din)) {
                    if (assertValid) {
                        throw XProcException.stepError(53);
                    }
View Full Code Here

Examples of com.thaiopensource.validate.ValidationDriver.loadSchema()

            // Setup driver
            final ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), schemaReader);

            // Load schema
            driver.loadSchema(grammar);

            // Validate XML instance
            driver.validate(instance);
           
        } catch (final MalformedURLException ex) {
View Full Code Here

Examples of com.thaiopensource.validate.ValidationDriver.loadSchema()

      ByteArrayOutputStream error = new ByteArrayOutputStream();
        ErrorHandlerImpl eh = new ErrorHandlerImpl(new BufferedWriter(new OutputStreamWriter(error)));
        ValidateProperty.ERROR_HANDLER.put(properties, eh);
        SchemaReader schemaReader = new AutoSchemaReader();
        ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), schemaReader);
        if (driver.loadSchema(in)) {
            if (driver.validate(ValidationDriver.uriOrFileInputSource(xml.getAbsolutePath()))) {
                log.debug("" + error);
                return null;
            } else {
                log.error("" + error);
View Full Code Here

Examples of com.thaiopensource.validate.ValidationDriver.loadSchema()

   
    InputStream schemaIn = schema.openStream();
    try {
      InputSource schemaSource = new InputSource(schema.openStream());
      schemaSource.setSystemId(schema.toString());
      driver.loadSchema(schemaSource);
      return driver.validate(in);
    } catch (SAXException e) {
      System.out.println(e);
      return false;
    } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.