Package org.xml.sax

Examples of org.xml.sax.EntityResolver


  throws SAXException, IOException, ParserConfigurationException {
    XSContext data = getData();
    try {
      XsObjectFactory factory = data.getXsObjectFactory();
      XMLReader xr = factory.newXMLReader(isValidating());
      EntityResolver entityResolver = xr.getEntityResolver();
      InputSource schemaSource = null;
      if (entityResolver != null) {
        schemaSource = entityResolver.resolveEntity(null, pSchemaLocation);
      }
      if (schemaSource == null) {
        schemaSource = getInputSource(pLocator == null ? null : pLocator.getSystemId(),
            pSchemaLocation);
      }
View Full Code Here


        String s = "<!DOCTYPE a SYSTEM 'uri:dtd'><a/>";
        InputSource isource = new InputSource(new StringReader(s));
        SAXParserFactory spf = SAXParserFactory.newInstance();
        spf.setValidating(false);
        XMLReader xr = spf.newSAXParser().getXMLReader();
        xr.setEntityResolver(new EntityResolver(){
      public InputSource resolveEntity(String publicId, String pSystemId) throws SAXException, IOException {
        return "uri:dtd".equals(pSystemId) ? pSource : null;
            }
        });
        DtdDeclHandler handler = new DtdDeclHandler();
View Full Code Here

               return source;
            }
         }

         // first try to resolve using user's entity resolver
         EntityResolver resolver = fEntityHandler.getEntityResolver();
         if (resolver != null) {
            InputSource source = resolver.resolveEntity(publicId, systemId);
            if (source != null) {
               return source;
            }
         }
View Full Code Here

    public FacesConfigDigester() {
        digester = new Digester();
        // TODO: validation set to false during implementation of 1.2
        digester.setValidating(false);
        digester.setNamespaceAware(true);
        digester.setEntityResolver(new EntityResolver() {

            @Override
            public InputSource resolveEntity(String arg0, String arg1) throws SAXException, IOException {
                return EMPTY_INPUT_SOURCE;
            }
View Full Code Here

            if (validation) {
                factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
            }
           
            DocumentBuilder builder = factory.newDocumentBuilder();
            builder.setEntityResolver(new EntityResolver() {

                public InputSource resolveEntity(String publicId, String systemId) throws IOException {
                    if (systemId != null && systemId.startsWith("http://www.jgroups.org/schema/JGroups-")) {
                        String schemaName = systemId.substring("http://www.jgroups.org/".length());                       
                        InputStream schemaIs = getAsInputStreamFromClassLoader(schemaName);
View Full Code Here

  {
    try
    {
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
      this.documentBuilder = documentBuilderFactory.newDocumentBuilder();
      this.documentBuilder.setEntityResolver(new EntityResolver() {
        public InputSource resolveEntity(String publicId, String systemId)
        throws SAXException, IOException
        {
          if (systemId.contains("gwt-module.dtd"))
          {
View Full Code Here

          builderFactory.setNamespaceAware(true);
          builderFactory.setIgnoringComments(true);
          builderFactory.setIgnoringElementContentWhitespace(true);
         
          documentBuilder = builderFactory.newDocumentBuilder();
          documentBuilder.setEntityResolver(new EntityResolver() {
            @Override
            public InputSource resolveEntity(String publicId, String systemId)
                throws SAXException, IOException {
              if (systemId.contains("crux-view.dtd"))
              {
View Full Code Here

      debug.message(1, "Cannot read SAX catalog without a parser");
      throw new CatalogException(CatalogException.UNPARSEABLE);
    }

    debug = catalog.getCatalogManager().debug;
    EntityResolver bResolver = catalog.getCatalogManager().getBootstrapResolver();

    this.catalog = catalog;

    try {
      if (parserFactory != null) {
View Full Code Here

      String outputType = null;
      String media = null;
      Vector params = new Vector();
      boolean quietConflictWarnings = false;
      URIResolver uriResolver = null;
      EntityResolver entityResolver = null;
      ContentHandler contentHandler = null;
      int recursionLimit=-1;

      for (int i = 0; i < argv.length; i++)
      {
View Full Code Here

      debug.message(1, "Cannot read SAX catalog without a parser");
      throw new CatalogException(CatalogException.UNPARSEABLE);
    }

    debug = catalog.getCatalogManager().debug;
    EntityResolver bResolver = catalog.getCatalogManager().getBootstrapResolver();

    this.catalog = catalog;

    try {
      if (parserFactory != null) {
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.