Package org.apache.xml.resolver

Examples of org.apache.xml.resolver.Catalog


        return getTargetNode(resolvedLocation);
    }

    private String resolveByCatalog(String url) {
        Bus bus = (Bus)env.get(Bus.class);
        Catalog catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog();
        String resolvedLocation;
        try {
            resolvedLocation = catalogResolver.resolveSystem(url);
            if (resolvedLocation == null) {
                resolvedLocation = catalogResolver.resolveURI(url);
            }
        } catch (Exception e1) {
            Message msg = new Message("FAILED_RESOLVE_CATALOG", LOG, url);
            throw new ToolException(msg, e1);
        }
View Full Code Here


        return getTargetNode(resolvedLocation);
    }

    private String resolveByCatalog(String url) {
        Bus bus = (Bus)env.get(Bus.class);
        Catalog catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog();
        String resolvedLocation;
        try {
            resolvedLocation = catalogResolver.resolveSystem(url);
            if (resolvedLocation == null) {
                resolvedLocation = catalogResolver.resolveURI(url);
            }
        } catch (Exception e1) {
            Message msg = new Message("FAILED_RESOLVE_CATALOG", LOG, url);
            throw new ToolException(msg, e1);
        }
View Full Code Here

        return getTargetNode(resolvedLocation);
    }

    private String resolveByCatalog(String url) {
        Bus bus = (Bus)env.get(Bus.class);
        Catalog catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog();
        String resolvedLocation;
        try {
            resolvedLocation = catalogResolver.resolveSystem(url);
            if (resolvedLocation == null) {
                resolvedLocation = catalogResolver.resolveURI(url);
            }
        } catch (Exception e1) {
            Message msg = new Message("FAILED_RESOLVE_CATALOG", LOG, url);
            throw new ToolException(msg, e1);
        }
View Full Code Here

   * Get a new catalog instance.
   *
   * This method always returns a new instance of the underlying catalog class.
   */
  public Catalog getPrivateCatalog() {
    Catalog catalog = staticCatalog;

    if (useStaticCatalog == null) {
      useStaticCatalog = new Boolean(getUseStaticCatalog());
    }

    if (catalog == null || !useStaticCatalog.booleanValue()) {

      try {
  String catalogClassName = getCatalogClassName();

  if (catalogClassName == null) {
    catalog = new Catalog();
  } else {
    try {
      catalog = (Catalog) Class.forName(catalogClassName).newInstance();
    } catch (ClassNotFoundException cnfe) {
      debug.message(1,"Catalog class named '"
        + catalogClassName
        + "' could not be found. Using default.");
      catalog = new Catalog();
    } catch (ClassCastException cnfe) {
      debug.message(1,"Class named '"
        + catalogClassName
        + "' is not a Catalog. Using default.");
      catalog = new Catalog();
    }
  }

  catalog.setCatalogManager(this);
  catalog.setupReaders();
  catalog.loadSystemCatalogs();
      } catch (Exception ex) {
  ex.printStackTrace();
      }

      if (useStaticCatalog.booleanValue()) {
View Full Code Here

   *
   * If this manager uses static catalogs, the same static catalog will
   * always be returned. Otherwise a new catalog will be returned.
   */
  public Catalog getCatalog() {
    Catalog catalog = staticCatalog;

    if (useStaticCatalog == null) {
      useStaticCatalog = new Boolean(getUseStaticCatalog());
    }

View Full Code Here

    }

    ResolvingParser.validating = validating;
    ResolvingParser.namespaceAware = nsAware;
    ResolvingParser reader = new ResolvingParser();
    Catalog catalog = reader.getCatalog();

    for (int count = 0; count < catalogFiles.size(); count++) {
      String file = (String) catalogFiles.elementAt(count);
      catalog.parseCatalog(file);
    }

    XParseError xpe = new XParseError(showErrors, showWarnings);
    xpe.setMaxMessages(maxErrs);
    reader.setErrorHandler(xpe);
View Full Code Here

      reader.setFeature("http://xml.org/sax/features/validation", validating);
    } catch (SAXException e) {
      // nop;
    }

    Catalog catalog = reader.getCatalog();

    for (int count = 0; count < catalogFiles.size(); count++) {
      String file = (String) catalogFiles.elementAt(count);
      catalog.parseCatalog(file);
    }

    XParseError xpe = new XParseError(showErrors, showWarnings);
    xpe.setMaxMessages(maxErrs);
    reader.setErrorHandler(xpe);
View Full Code Here

  }
      }
    }

    CatalogResolver catalogResolver = new CatalogResolver();
    Catalog resolver = catalogResolver.getCatalog();

    for (int count = 0; count < catalogFiles.size(); count++) {
      String file = (String) catalogFiles.elementAt(count);
      resolver.parseCatalog(file);
    }
    String result = null;

    if (resType == Catalog.DOCTYPE) {
      System.out.println("Resolve DOCTYPE (name, publicid, systemid):");
      if (name != null) { System.out.println("       name: " + name); }
      if (publicId != null) { System.out.println("  public id: " + publicId); }
      if (systemId != null) { System.out.println("  system id: " + systemId); }
      if (uri != null) { System.out.println("        uri: " + uri); }
      result = resolver.resolveDoctype(name, publicId, systemId);
    } else if (resType == Catalog.DOCUMENT) {
      System.out.println("Resolve DOCUMENT ():");
      result = resolver.resolveDocument();
    } else if (resType == Catalog.ENTITY) {
      System.out.println("Resolve ENTITY (name, publicid, systemid):");
      if (name != null) { System.out.println("       name: " + name); }
      if (publicId != null) { System.out.println("  public id: " + publicId); }
      if (systemId != null) { System.out.println("  system id: " + systemId); }
      result = resolver.resolveEntity(name, publicId, systemId);
    } else if (resType == Catalog.NOTATION) {
      System.out.println("Resolve NOTATION (name, publicid, systemid):");
      if (name != null) { System.out.println("       name: " + name); }
      if (publicId != null) { System.out.println("  public id: " + publicId); }
      if (systemId != null) { System.out.println("  system id: " + systemId); }
      result = resolver.resolveNotation(name, publicId, systemId);
    } else if (resType == Catalog.PUBLIC) {
      System.out.println("Resolve PUBLIC (publicid, systemid):");
      if (publicId != null) { System.out.println("  public id: " + publicId); }
      if (systemId != null) { System.out.println("  system id: " + systemId); }
      result = resolver.resolvePublic(publicId, systemId);
    } else if (resType == Catalog.SYSTEM) {
      System.out.println("Resolve SYSTEM (systemid):");
      if (systemId != null) { System.out.println("  system id: " + systemId); }
      result = resolver.resolveSystem(systemId);
    } else if (resType == Catalog.URI) {
      System.out.println("Resolve URI (uri):");
      if (uri != null) { System.out.println("        uri: " + uri); }
      result = resolver.resolveURI(uri);
    } else {
      System.out.println("resType is wrong!? This can't happen!");
      usage();
    }
View Full Code Here

    if (privateCatalog || catalog == null) {
      try {
  String catalogClassName = CatalogManager.catalogClassName();
  if (catalogClassName == null) {
    catalog = new Catalog();
  } else {
    try {
      catalog = (Catalog) Class.forName(catalogClassName).newInstance();
    } catch (ClassNotFoundException cnfe) {
      Debug.message(1,"Catalog class named '"
        + catalogClassName
        + "' could not be found. Using default.");
      catalog = new Catalog();
    } catch (ClassCastException cnfe) {
      Debug.message(1,"Class named '"
        + catalogClassName
        + "' is not a Catalog. Using default.");
      catalog = new Catalog();
    }
  }

  catalog.setupReaders();
View Full Code Here

                    return;
                }
            }
        }

        Catalog catalog = loadCatalog();

        WSDLLocator wsdlLocator = null;
        if (isURL(this.wsdlURI.toString())) {
            wsdlLocator = new CatalogWSDLLocator(this.wsdlURI.toString(), catalog);
        } else {
View Full Code Here

TOP

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

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.