Package org.apache.xerces.jaxp.validation

Examples of org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema()


    }

    protected void runTest() throws Throwable {
        SchemaFactory factory = new XMLSchemaFactory();
        DocumentBuilder builder = dbf.newDocumentBuilder();
        Schema schema = factory.newSchema(new DOMSource(
                builder.parse(TestValidator.class.getResourceAsStream("ipo.xsd"))));
        Validator validator = schema.newValidator();
        validator.validate(new DOMSource(
                builder.parse(TestValidator.class.getResourceAsStream("ipo_1.xml"))));
    }
View Full Code Here


    @Test
    public void test() throws Exception {
        SchemaFactory factory = new XMLSchemaFactory();
        DocumentBuilderFactory dbf = new DOOMDocumentBuilderFactory();
        DocumentBuilder builder = dbf.newDocumentBuilder();
        Schema schema = factory.newSchema(new DOMSource(
                builder.parse(ValidatorTest.class.getResourceAsStream("ipo.xsd"))));
        Validator validator = schema.newValidator();
        validator.validate(new DOMSource(
                builder.parse(ValidatorTest.class.getResourceAsStream("ipo_1.xml"))));
    }
View Full Code Here

            if (vHandler == null) {

                this.namespaceURI = uri;
                InputStream schemaStream = findSchemaFromNamespaceURI(uri);
                XMLSchemaFactory sf = new XMLSchemaFactory(); // Xerces
                Schema schema = sf.newSchema(new StreamSource(schemaStream));
                this.vHandler = schema.newValidatorHandler();

                configHandler = new XmlConfigHandler(vHandler.getTypeInfoProvider());
                vHandler.setContentHandler(configHandler);
                vHandler.setErrorHandler(this);
View Full Code Here

public class ValidatorTest extends TestCase {
    public void test() throws Exception {
        SchemaFactory factory = new XMLSchemaFactory();
        DocumentBuilderFactory dbf = new DOOMDocumentBuilderFactory();
        DocumentBuilder builder = dbf.newDocumentBuilder();
        Schema schema = factory.newSchema(new DOMSource(
                builder.parse(ValidatorTest.class.getResourceAsStream("ipo.xsd"))));
        Validator validator = schema.newValidator();
        validator.validate(new DOMSource(
                builder.parse(ValidatorTest.class.getResourceAsStream("ipo_1.xml"))));
    }
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.