Package org.xml.sax

Examples of org.xml.sax.EntityResolver


            throw new TeiidComponentException(err);
        }
   
    // place the schema into the customized entity resolver so that we can
    // resolve the schema elements
    EntityResolver xmlEntityResolver = new MultiEntityResolver(nameSpaceMap);
    reader.setEntityResolver(xmlEntityResolver);

    // Create the specialized error handler so that we can get any warnings,
    // errors, or fatal errors back from validation
    MMErrorHandler errorHandler = new MMErrorHandler();   
View Full Code Here


        if(resolveEntity) {
            org.apache.xml.resolver.CatalogManager catalog = org.apache.xml.resolver.CatalogManager.getStaticManager();
            catalog.setIgnoreMissingProperties(true);
            catalog.setPreferPublic(true);
            catalog.setUseStaticCatalog(false);
            EntityResolver resolver = new org.apache.xml.resolver.tools.CatalogResolver(catalog);
            myReader.setEntityResolver(resolver);
        }
        return myReader;
    }
View Full Code Here

            preparser.setFeature("http://xml.org/sax/features/namespaces", true);
            preparser.setFeature("http://xml.org/sax/features/validation", true);
            preparser.setFeature("http://apache.org/xml/features/validation/schema", true);
            preparser.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);

            EntityResolver eresolver = new EntityResolver() {
                public InputSource resolveEntity(String publicID, String systemID) throws SAXException,
                    IOException {

                    String url = resolveUrl(systemID);
                    if (url == null) {
View Full Code Here

import org.springframework.core.io.UrlResource;

public class CeltixXmlBeanFactoryTest extends TestCase {

    public void testEntityResolver() throws SAXException, IOException, NoSuchMethodException {
        EntityResolver resolver = new CeltixBeansDtdResolver();
        assertNull(resolver.resolveEntity("-//SPRING//DTD BEAN//EN",
            "http://www.springframework.org/dtd/spring-beans.dtd"));
        assertNotNull(resolver.resolveEntity(null,
            "http://celtix.objectweb.org/configuration/spring/celtix-spring-beans.dtd"));
       
       
        CeltixBeansDtdResolver cer  = EasyMock.createMock(CeltixBeansDtdResolver.class,
            new Method[] {CeltixBeansDtdResolver.class.getDeclaredMethod("getDtdFile", (Class[])null)});
View Full Code Here

  // Implementation methods
  // -------------------------------------------------------------------------

  protected void loadSchema(Document document, String schemaInstanceURI) {
    try {
      EntityResolver resolver = document.getEntityResolver();

      if (resolver == null) {
        String msg = "No EntityResolver available for resolving URI: ";
        throw new InvalidSchemaException(msg + schemaInstanceURI);
      }

      InputSource inputSource = resolver.resolveEntity(null,
          schemaInstanceURI);

      if (resolver == null) {
        throw new InvalidSchemaException("Could not resolve the URI: "
            + schemaInstanceURI);
View Full Code Here

  }

  protected void loadSchema(Document document, String schemaInstanceURI,
                            Namespace namespace) {
    try {
      EntityResolver resolver = document.getEntityResolver();

      if (resolver == null) {
        String msg = "No EntityResolver available for resolving URI: ";
        throw new InvalidSchemaException(msg + schemaInstanceURI);
      }

      InputSource inputSource = resolver.resolveEntity(null,
          schemaInstanceURI);

      if (resolver == null) {
        throw new InvalidSchemaException("Could not resolve the URI: "
            + schemaInstanceURI);
View Full Code Here

      while (includeIter.hasNext()) {
        Element includeElement = (Element) includeIter.next();
        String inclSchemaInstanceURI = includeElement
            .attributeValue("schemaLocation");
        EntityResolver resolver = schemaDocument.getEntityResolver();

        try {
          if (resolver == null) {
            String msg = "No EntityResolver available";
            throw new InvalidSchemaException(msg);
          }

          InputSource inputSource = resolver.resolveEntity(null,
              inclSchemaInstanceURI);

          if (inputSource == null) {
            String msg = "Could not resolve the schema URI: "
                + inclSchemaInstanceURI;
View Full Code Here

            }

            // Generate the default handler to process the metadata
           
            DefaultHandler handler = null;
            EntityResolver entityResolver = null;
            try
            {
                entityResolver = EntityResolverFactory.getInstance(mgr.getOMFContext().getPluginManager(), handlerName);
                if (entityResolver != null)
                {
View Full Code Here

      }
      public void warning(SAXParseException e) throws SAXException {
        getLog().warn(e.getMessage());
      }
    });
    digester.setEntityResolver(new EntityResolver() {
      public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
        InputSource result = null;
        if (schemaResolver != null) {
          result = schemaResolver.resolveEntity(publicId, systemId);
        }
View Full Code Here

      protected Builder newBuilder() {
        if (validate.equals("wf")) {
          return builderPool.getBuilder(false);
        } else if (validate.equals("dtd")) {
          if (schema == null) return builderPool.getBuilder(true);
          EntityResolver resolver;
          try {
            resolver = new BuilderFactory().createResolver(
                  new FileInputStream(schema));
          } catch (IOException e) {
            throw new UsageException(e);
View Full Code Here

TOP

Related Classes of org.xml.sax.EntityResolver

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.