Package org.apache.xml.resolver

Examples of org.apache.xml.resolver.CatalogManager


     * the behaviour of this catalog resolver.
     */
    private void init (String [] catalogs, boolean preferPublic) {
        fCatalogsList = (catalogs != null) ? (String[]) catalogs.clone() : null;
        fPreferPublic = preferPublic;
        fResolverCatalogManager = new CatalogManager();
        fResolverCatalogManager.setAllowOasisXMLCatalogPI(false);
        fResolverCatalogManager.setCatalogClassName("org.apache.xml.resolver.Catalog");
        fResolverCatalogManager.setCatalogFiles("");
        fResolverCatalogManager.setIgnoreMissingProperties(true);
        fResolverCatalogManager.setPreferPublic(fPreferPublic);
View Full Code Here


  private void init(String[] paramArrayOfString, boolean paramBoolean)
  {
    this.fCatalogsList = (paramArrayOfString != null ? (String[])paramArrayOfString.clone() : null);
    this.fPreferPublic = paramBoolean;
    this.fResolverCatalogManager = new CatalogManager();
    this.fResolverCatalogManager.setAllowOasisXMLCatalogPI(false);
    this.fResolverCatalogManager.setCatalogClassName("org.apache.xml.resolver.Catalog");
    this.fResolverCatalogManager.setCatalogFiles("");
    this.fResolverCatalogManager.setIgnoreMissingProperties(true);
    this.fResolverCatalogManager.setPreferPublic(this.fPreferPublic);
View Full Code Here

                configs.add(new File(configName));
            }
        }
        EntityResolver entityResolver = null;
        if (catalogLocation != null) {
            CatalogManager catalogManager = CatalogManager.getStaticManager();
            catalogManager.setCatalogFiles(catalogLocation);
            entityResolver = new PassThroughResolver(new CatalogResolver());
        }
        List classPathList = new ArrayList();
        if (classpath != null) {
            for (StringTokenizer st = new StringTokenizer(classpath, ","); st.hasMoreTokens();) {
View Full Code Here

        }

        final String[] included = scanIncludedFiles();

        // configure a resolver for catalog files
        final CatalogManager catalogManager = createCatalogManager();
        final CatalogResolver catalogResolver = new CatalogResolver(catalogManager);
        // configure a resolver for urn:dockbx:stylesheet
        final URIResolver uriResolver = createStyleSheetResolver(catalogResolver);
        // configure a resolver for xml entities
        final InjectingEntityResolver injectingResolver = createEntityResolver(catalogResolver);
View Full Code Here

     * Creates a <code>CatalogManager</code>, used to resolve DTDs and other entities.
     *
     * @return A <code>CatalogManager</code> to be used for resolving DTDs and other entities.
     */
    protected CatalogManager createCatalogManager() {
        CatalogManager manager = new CatalogManager();
        manager.setIgnoreMissingProperties(true);
        ClassLoader classLoader = Thread.currentThread()
                .getContextClassLoader();
        StringBuffer builder = new StringBuffer();
        boolean first = true;
        for (int i = 0; i < catalogs.length; i++) {
            final String catalog = catalogs[i];
            try {
                Enumeration enumeration = classLoader.getResources(catalog);
                while (enumeration.hasMoreElements()) {
                    if (!first) {
                        builder.append(';');
                    } else {
                        first = false;
                    }
                    URL resource = (URL) enumeration.nextElement();
                    builder.append(resource.toExternalForm());
                }
            } catch (IOException ioe) {
                getLog().warn("Failed to search for catalog files: " + catalog);
                // Let's be a little tolerant here.
            }
        }

        String catalogFiles = builder.toString();
        if (catalogFiles.length() == 0) {
            getLog().warn("Failed to find catalog files.");
        } else {
            if (getLog().isDebugEnabled()) {
                getLog().debug("Catalogs to load: " + catalogFiles);
            }
            manager.setCatalogFiles(catalogFiles);
        }
        return manager;
    }
View Full Code Here

TOP

Related Classes of org.apache.xml.resolver.CatalogManager

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.