Examples of newSchema()


Examples of javax.xml.validation.SchemaFactory.newSchema()

        }
        File file = getSchemaFile();
        if (file != null) {
            return factory.newSchema(file);
        }
        return factory.newSchema(getSchemaSource());
    }

}
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

            // Allow privileged access to check files. Requires FilePermission
            // in security policy.
            try {
                aggregatedSchema = AccessController.doPrivileged(new PrivilegedExceptionAction<Schema>() {
                    public Schema run() throws SAXException {
                        return schemaFactory.newSchema(sources.toArray(new Source[sources.size()]));
                    }
                });
            } catch (PrivilegedActionException e) {
              warn(monitor, "PrivilegedActionException", schemaFactory, (SAXException)e.getException());
              hasSchemas = false;
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

        SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
       
        JaxbJavaeeSchemaResourceResolver resourceResolver = new JaxbJavaeeSchemaResourceResolver()
        schemaFactory.setResourceResolver(resourceResolver)
       
        Schema schema = schemaFactory.newSchema(
                new Source[] {
                        new StreamSource(xmlSchemaURL.openStream()),
                        new StreamSource(javaeeSchemaURL.openStream())
                });
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

                        }
                        return null;
                    }
                   
                });
                schema = factory.newSchema(schemaSources.toArray(
                    new Source[schemaSources.size()]));
                if (schema != null) {
                    serviceInfo.setProperty(Schema.class.getName(), schema);
                    LOG.log(Level.FINE, "Obtained schema from ServiceInfo");
                }
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

    protected Schema createSchema() throws SAXException, IOException {
        SchemaFactory factory = getSchemaFactory();

        URL url = getSchemaUrl();
        if (url != null) {
            return factory.newSchema(url);
        }

        File file = getSchemaFile();
        if (file != null) {
            return factory.newSchema(file);
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

            return factory.newSchema(url);
        }

        File file = getSchemaFile();
        if (file != null) {
            return factory.newSchema(file);
        }

        byte[] bytes = getSchemaAsByteArray();
        if (bytes != null) {
            return factory.newSchema(new StreamSource(new ByteArrayInputStream(schemaAsByteArray)));
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

            return factory.newSchema(file);
        }

        byte[] bytes = getSchemaAsByteArray();
        if (bytes != null) {
            return factory.newSchema(new StreamSource(new ByteArrayInputStream(schemaAsByteArray)));
        }

        Source source = getSchemaSource();
        return factory.newSchema(source);
    }
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

        if (bytes != null) {
            return factory.newSchema(new StreamSource(new ByteArrayInputStream(schemaAsByteArray)));
        }

        Source source = getSchemaSource();
        return factory.newSchema(source);
    }

    /**
     * Checks whether we need an {@link InputStream} to access the message body or header.
     * <p/>
 
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

   
    public void validateSchema(Element ele) throws ToolException {
        SchemaFactory schemaFact = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        DOMSource domSrc = new DOMSource(ele);
        try {
            schemaFact.newSchema(domSrc);
        } catch (SAXException e) {
            if (e.getLocalizedMessage().indexOf("src-resolve.4.2") > -1)  {
                //Ignore schema resolve error and do nothing
            } else {
                throw new ToolException("Schema Error : " + e.getLocalizedMessage(), e);
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

            if (is != null) {
                final Source src = new StreamSource(is, LOG4J_XSD);
                final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
                Schema schema = null;
                try {
                    schema = factory.newSchema(src);
                } catch (final SAXException ex) {
                    LOGGER.error("Error parsing Log4j schema", ex);
                }
                if (schema != null) {
                    validator = schema.newValidator();
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.