com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDLoader Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDLoader. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XMLGrammarCachingConfiguration.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 * <strong>REVISIT:</strong>
 * Grammar pool will be updated when the new validation engine is
 * implemented.
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
Example #2
Source File: XMLGrammarCachingConfiguration.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 * <strong>REVISIT:</strong>
 * Grammar pool will be updated when the new validation engine is
 * implemented.
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
Example #3
Source File: XMLGrammarCachingConfiguration.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 * <strong>REVISIT:</strong>
 * Grammar pool will be updated when the new validation engine is
 * implemented.
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
Example #4
Source File: XMLGrammarCachingConfiguration.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 * <strong>REVISIT:</strong>
 * Grammar pool will be updated when the new validation engine is
 * implemented.
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
Example #5
Source File: XMLGrammarCachingConfiguration.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 * <strong>REVISIT:</strong>
 * Grammar pool will be updated when the new validation engine is
 * implemented.
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
Example #6
Source File: XMLGrammarCachingConfiguration.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 * <strong>REVISIT:</strong>
 * Grammar pool will be updated when the new validation engine is
 * implemented.
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
Example #7
Source File: XMLGrammarCachingConfiguration.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 * <strong>REVISIT:</strong>
 * Grammar pool will be updated when the new validation engine is
 * implemented.
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
Example #8
Source File: XMLGrammarCachingConfiguration.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 * <strong>REVISIT:</strong>
 * Grammar pool will be updated when the new validation engine is
 * implemented.
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
Example #9
Source File: XMLGrammarCachingConfiguration.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 * <strong>REVISIT:</strong>
 * Grammar pool will be updated when the new validation engine is
 * implemented.
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
Example #10
Source File: XMLGrammarCachingConfiguration.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 * <strong>REVISIT:</strong>
 * Grammar pool will be updated when the new validation engine is
 * implemented.
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
Example #11
Source File: XMLGrammarCachingConfiguration.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 * <strong>REVISIT:</strong>
 * Grammar pool will be updated when the new validation engine is
 * implemented.
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
Example #12
Source File: DOMNormalizer.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
private void processDTD(String xmlVersion, String schemaLocation) {

        String rootName = null;
        String publicId = null;
        String systemId = schemaLocation;
        String baseSystemId = fDocument.getDocumentURI();
        String internalSubset = null;

        DocumentType docType = fDocument.getDoctype();
        if (docType != null) {
            rootName = docType.getName();
            publicId = docType.getPublicId();
            if (systemId == null || systemId.length() == 0) {
                systemId = docType.getSystemId();
            }
            internalSubset = docType.getInternalSubset();
        }
        // If the DOM doesn't have a DocumentType node we may still
        // be able to fetch a DTD if the application provided a URI
        else {
            Element elem = fDocument.getDocumentElement();
            if (elem == null) return;
            rootName = elem.getNodeName();
            if (systemId == null || systemId.length() == 0) return;
        }

        XMLDTDLoader loader = null;
        try {
            fValidationHandler.doctypeDecl(rootName, publicId, systemId, null);
            loader = CoreDOMImplementationImpl.singleton.getDTDLoader(xmlVersion);
            loader.setFeature(DOMConfigurationImpl.XERCES_VALIDATION, true);
            loader.setEntityResolver(fConfiguration.getEntityResolver());
            loader.setErrorHandler(fConfiguration.getErrorHandler());
            loader.loadGrammarWithContext((XMLDTDValidator) fValidationHandler, rootName,
                    publicId, systemId, baseSystemId, internalSubset);
        }
        // REVISIT: Should probably report this exception to the error handler.
        catch (IOException e) {
        }
        finally {
            if (loader != null) {
                CoreDOMImplementationImpl.singleton.releaseDTDLoader(xmlVersion, loader);
            }
        }
    }
 
Example #13
Source File: CoreDOMImplementationImpl.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
XMLDTDLoaderHolder(XMLDTDLoader loader) {
    this.loader = loader;
}