Examples of JarFileEntityResolver


Examples of com.volantis.xml.schema.JarFileEntityResolver

                    "schema", true);

            builder.setIgnoringElementContentWhitespace(ignoreWhitespace);

            // Configure an entity resolver to find the schemas locally.
            JarFileEntityResolver resolver = new EclipseEntityResolver();
            resolver.addSystemIdMapping(DeviceSchemas.DEVICE_CURRENT);
            resolver.addSystemIdMapping(DeviceSchemas.CORE_CURRENT);
            resolver.addSystemIdMapping(DeviceSchemas.HEIRARCHY_CURRENT);
            resolver.addSystemIdMapping(DeviceSchemas.IDENTIFICATION_CURRENT);
            resolver.addSystemIdMapping(DeviceSchemas.TAC_IDENTIFICATION_CURRENT);
            resolver.addSystemIdMapping(DeviceSchemas.POLICY_DEFINITIONS_CURRENT);
            resolver.addSystemIdMapping(DeviceSchemas.REPOSITORY_CURRENT);

            builder.setEntityResolver(resolver);
        } else {
            // No validation requested.
            builder.setValidation(false);
View Full Code Here

Examples of com.volantis.xml.schema.JarFileEntityResolver

                    // to avoid the wrong parser being instantiated.
                    XMLReader reader =
                            new com.volantis.xml.xerces.parsers.SAXParser();
                    reader.setContentHandler(handler);
                    reader.setErrorHandler(handler);
                    reader.setEntityResolver(new JarFileEntityResolver());

                    // Parse the XML to check for correct tags etc.
                    reader.parse(new InputSource(new StringReader(xml)));
                } catch (SAXException se) {
                    // Invalid XML
View Full Code Here

Examples of com.volantis.xml.schema.JarFileEntityResolver

            InputStream is = new FileInputStream(configFile);
            if (is != null) {
                SAXBuilder builder = new SAXBuilder();

                // Create a jar file entity resolver on the MPS core jar
                JarFileEntityResolver resolver =
                        new JarFileEntityResolver(this);
                // Add the mapping for the MSS config schema file
                resolver.addSystemIdMapping(MSS_CONFIG_SCHEMA_URI,
                                            MSS_CONFIG_SCHEMA_LOCATION);
                // And tell the builder about it
                builder.setEntityResolver(resolver);

                // Read the config file into an XML document.
View Full Code Here

Examples of com.volantis.xml.schema.JarFileEntityResolver

        final XMLReader reader = new SAXParser();

        // Construct an entity resolver that looks in the JAR that
        // contains the same class as this class, and use it to look
        // up the XML file
        final JarFileEntityResolver resolver = new JarFileEntityResolver(this);
        // add the mapping for the style-catorgories.xml file.
        resolver.addSystemIdMapping(
            STYLE_CATEGORIES_XML_URI,
            STYLE_CATEGORIES_XML_LOCATION);
        // add the mapping for the style-catorgories.xsd file.
        resolver.addSystemIdMapping(
            STYLE_CATEGORIES_SCHEMA_URI,
            STYLE_CATEGORIES_SCHEMA_LOCATION);

        final InputSource xmlInputSource =
            resolver.resolveEntity(null, STYLE_CATEGORIES_XML_URI);

        // Create a content handler and attach it to the reader
        final StyleCategoryContentHandler handler =
            new StyleCategoryContentHandler();
        reader.setContentHandler(handler);
View Full Code Here

Examples of com.volantis.xml.schema.JarFileEntityResolver

        createDOMValidator(ErrorReporter errorReporter)
                throws SAXException, ParserErrorException {
            // return a XercesBasedDOMValidator that is configured with
            // the correct entity resolver.

            JarFileEntityResolver repositorySchemaResolver =
                    RepositorySchemaResolverFactory.create();

            QueueingXercesBasedDOMValidator validator =
                    new QueueingXercesBasedDOMValidator(
                            repositorySchemaResolver,
View Full Code Here

Examples of com.volantis.xml.schema.JarFileEntityResolver

    // javadoc inherited
    public void parse(String systemID) throws SAXException, IOException {
        // Create the XML parser to be used to parse the schema file
        XMLReader parser = new com.volantis.xml.xerces.parsers.SAXParser();
        JarFileEntityResolver repositorySchemaResolver =
                RepositorySchemaResolverFactory.create();
        parser.setEntityResolver(repositorySchemaResolver);

        // Set up a filter stack that will provide nicely resolved element
        // and attribute information that can be fed into a
View Full Code Here

Examples of com.volantis.xml.schema.JarFileEntityResolver

    private static VolantisXMLReaderFactory xmlReaderFactory =
            new VolantisXMLReaderFactory();

    public SchemaValidator() {
        jarFileEntityResolver = new JarFileEntityResolver();
    }
View Full Code Here

Examples of com.volantis.xml.schema.JarFileEntityResolver

        errorReporter = new StyleclassErrorReporter();

        String schemaLocation = MCSNamespace.LPDM.getURI() + " " +
                    PolicySchemas.MARLIN_LPDM_CURRENT.getLocationURL();
        try {
            JarFileEntityResolver repositorySchemaResolver =
                    RepositorySchemaResolverFactory.create();

            // create the validator
            validator = new XercesBasedDOMValidator(
                    repositorySchemaResolver,
View Full Code Here

Examples of com.volantis.xml.schema.JarFileEntityResolver

     */
    protected DOMValidator createValidator(
            ErrorReporter errorReporter)
            throws SAXException, ParserErrorException {

        JarFileEntityResolver er = new JarFileEntityResolver();
        er.addSystemIdMapping("http://fred.com", getXSDPath());
        DOMValidator xercesBasedValidator =
                new XercesBasedDOMValidator(er, errorReporter);
        xercesBasedValidator.deriveSchemaLocationFrom(document);

        return xercesBasedValidator;
View Full Code Here

Examples of com.volantis.xml.schema.JarFileEntityResolver

     * @throws ParserErrorException if a ParserErrorException is encountered.
     */
    private XercesBasedDOMValidator createDOMValidator(ErrorReporter errorReporter)
            throws SAXException, ParserErrorException {

        JarFileEntityResolver repositorySchemaResolver =
                RepositorySchemaResolverFactory.create();

        return new XercesBasedDOMValidator(repositorySchemaResolver,
                    errorReporter);
    }
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.