Examples of IntegratedParserConfiguration

  • Properties @author Elena Litani, IBM
  • org.apache.xerces.parsers.IntegratedParserConfiguration
    e.org/xml/features/validation/schema
  • http://apache.org/xml/features/validation/schema-full-checking
  • http://apache.org/xml/features/validation/schema/normalized-value
  • http://apache.org/xml/features/validation/schema/element-default
  • Properties @author Elena Litani, IBM @version $Id: IntegratedParserConfiguration.java,v 1.6 2002/10/25 16:44:42 sandygao Exp $

  • Examples of org.apache.xerces.parsers.IntegratedParserConfiguration

        synchronized SAXParser getSAXParser() {
            if (fSAXParser != null) return fSAXParser;
            // REVISIT:  when schema handles XML 1.1, will need to
            // revisit this (and the practice of not prepending an XML decl to the annotation string
            IntegratedParserConfiguration config = new IntegratedParserConfiguration(fSymbolTable);
            // note that this should never produce errors or require
            // entity resolution, so just a barebones configuration with
            // a couple of feature  set will do fine
            config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
            config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, false);
            fSAXParser = new SAXParser(config);
            return fSAXParser;
        }
    View Full Code Here

    Examples of org.apache.xerces.parsers.IntegratedParserConfiguration

                System.exit(1);
            }
            // Now we have a grammar pool and a SymbolTable; just
            // build a configuration and we're on our way!
            if(parserConfiguration == null) {
                parserConfiguration = new IntegratedParserConfiguration(sym, grammarPool);
            } else {
                // set GrammarPool and SymbolTable...
                parserConfiguration.setProperty(SYMBOL_TABLE, sym);
                parserConfiguration.setProperty(GRAMMAR_POOL, grammarPool);
            }
    View Full Code Here

    Examples of org.apache.xerces.parsers.IntegratedParserConfiguration

                System.exit(1);
            }
            // Now we have a grammar pool and a SymbolTable; just
            // build a configuration and we're on our way!
            if(parserConfiguration == null) {
                parserConfiguration = new IntegratedParserConfiguration(sym, grammarPool);
            } else {
                // set GrammarPool and SymbolTable...
                parserConfiguration.setProperty(SYMBOL_TABLE, sym);
                parserConfiguration.setProperty(GRAMMAR_POOL, grammarPool);
            }
    View Full Code Here

    Examples of org.apache.xerces.parsers.IntegratedParserConfiguration

                System.exit(1);
            }
            // Now we have a grammar pool and a SymbolTable; just
            // build a configuration and we're on our way!
            if(parserConfiguration == null) {
                parserConfiguration = new IntegratedParserConfiguration(sym, grammarPool);
            } else {
                // set GrammarPool and SymbolTable...
                parserConfiguration.setProperty(SYMBOL_TABLE, sym);
                parserConfiguration.setProperty(GRAMMAR_POOL, grammarPool);
            }
    View Full Code Here

    Examples of org.apache.xerces.parsers.IntegratedParserConfiguration

                System.exit(1);
            }
            // Now we have a grammar pool and a SymbolTable; just
            // build a configuration and we're on our way!
            if(parserConfiguration == null) {
                parserConfiguration = new IntegratedParserConfiguration(sym, grammarPool);
            } else {
                // set GrammarPool and SymbolTable...
                parserConfiguration.setProperty(SYMBOL_TABLE, sym);
                parserConfiguration.setProperty(GRAMMAR_POOL, grammarPool);
            }
    View Full Code Here

    Examples of org.apache.xerces.parsers.IntegratedParserConfiguration

        * be used as the actual locations of those schemas, in the schema parse order.
        * @return The parser configuration object.
        */
       private static XMLParserConfiguration getParserConfiguration(LookupDeque schemaURLDeque) throws IOException
       {
          IntegratedParserConfiguration cfg;

          // Load the grammar if specified

          if (schemaURLDeque != null && schemaURLDeque.size() != 0)
          {
             SymbolTable symbolTable = new SymbolTable(SYMBOL_TABLE_SIZE);
             XMLGrammarPreparser preparser = new XMLGrammarPreparser(symbolTable);
             XMLGrammarPoolImpl grammarPool = new XMLGrammarPoolImpl();

             preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
             preparser.setGrammarPool(grammarPool);
             preparser.setProperty(BUFFER_SIZE_PROPERTY, BUFFER_SIZE);
             preparser.setFeature(NAMESPACES_FEATURE, true);
             preparser.setFeature(VALIDATION_FEATURE, true);
             preparser.setFeature(SCHEMA_VALIDATION_FEATURE, true);
             preparser.setFeature(NODE_DEFERRAL_FEATURE, false);
             preparser.setErrorHandler(ERROR_HANDLER);
             preparser.setEntityResolver(new MappedResolver(schemaURLDeque));

             for (Iterator itr = schemaURLDeque.valueIterator(); itr.hasNext(); )
             {
                URL xsdURL = (URL)itr.next();
                InputStream istream = URLUtil.openStream(xsdURL);

                try
                {
                   preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA,
                      new XMLInputSource(null, xsdURL.toExternalForm(), null, istream, ENCODING));
                }
                finally
                {
                   IOUtil.close(istream);
                }
             }

             grammarPool.lockPool();
             cfg = new IntegratedParserConfiguration(symbolTable, grammarPool);
             cfg.setFeature(VALIDATION_FEATURE, true);
             cfg.setFeature(SCHEMA_VALIDATION_FEATURE, true);
          }
          else
          {
             cfg = new IntegratedParserConfiguration(new SymbolTable(SYMBOL_TABLE_SIZE));
          }

          cfg.setFeature(EXTERNAL_DTD_LOADING_FEATURE, false);
          cfg.setErrorHandler(ERROR_HANDLER);
          cfg.setEntityResolver(SECURE_RESOLVER);

          // Enable FEATURE_SECURE_PROCESSING
          cfg.setProperty(SECURITY_MANAGER_PROPERTY, new org.apache.xerces.util.SecurityManager());

          return cfg;
       }
    View Full Code Here

    Examples of org.apache.xerces.parsers.IntegratedParserConfiguration

        // annotation support
        synchronized DOMParser getDOMParser() {
            if (fDOMParser != null) return fDOMParser;
            // REVISIT:  when schema handles XML 1.1, will need to
            // revisit this (and the practice of not prepending an XML decl to the annotation string
            IntegratedParserConfiguration config = new IntegratedParserConfiguration(fSymbolTable);
            // note that this should never produce errors or require
            // entity resolution, so just a barebones configuration with
            // a couple of feature  set will do fine
            config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
            config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, false);
            fDOMParser = new DOMParser(config);
            return fDOMParser;
        }
    View Full Code Here

    Examples of org.apache.xerces.parsers.IntegratedParserConfiguration

        synchronized SAXParser getSAXParser() {
            if (fSAXParser != null) return fSAXParser;
            // REVISIT:  when schema handles XML 1.1, will need to
            // revisit this (and the practice of not prepending an XML decl to the annotation string
            IntegratedParserConfiguration config = new IntegratedParserConfiguration(fSymbolTable);
            // note that this should never produce errors or require
            // entity resolution, so just a barebones configuration with
            // a couple of feature  set will do fine
            config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
            config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, false);
            fSAXParser = new SAXParser(config);
            return fSAXParser;
        }
    View Full Code Here

    Examples of org.apache.xerces.parsers.IntegratedParserConfiguration

        // annotation support
        synchronized DOMParser getDOMParser() {
            if (fDOMParser != null) return fDOMParser;
            // REVISIT:  when schema handles XML 1.1, will need to
            // revisit this (and the practice of not prepending an XML decl to the annotation string
            IntegratedParserConfiguration config = new IntegratedParserConfiguration(fSymbolTable);
            // note that this should never produce errors or require
            // entity resolution, so just a barebones configuration with
            // a couple of feature  set will do fine
            config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
            config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, false);
            fDOMParser = new DOMParser(config);
            return fDOMParser;
        }
    View Full Code Here

    Examples of org.apache.xerces.parsers.IntegratedParserConfiguration

        synchronized SAXParser getSAXParser() {
            if (fSAXParser != null) return fSAXParser;
            // REVISIT:  when schema handles XML 1.1, will need to
            // revisit this (and the practice of not prepending an XML decl to the annotation string
            IntegratedParserConfiguration config = new IntegratedParserConfiguration(fSymbolTable);
            // note that this should never produce errors or require
            // entity resolution, so just a barebones configuration with
            // a couple of feature  set will do fine
            config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
            config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, false);
            fSAXParser = new SAXParser(config);
            return fSAXParser;
        }
    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.