com.sun.org.apache.xerces.internal.parsers.XML11Configuration

Here are the examples of the java api class com.sun.org.apache.xerces.internal.parsers.XML11Configuration taken from open source projects.

1. SchemaGrammar#getDOMParser()

Project: openjdk
Source File: SchemaGrammar.java
View license
// annotation support
synchronized DOMParser getDOMParser() {
    if (fDOMParser != null) {
        DOMParser parser = (DOMParser) fDOMParser.get();
        if (parser != null) {
            return parser;
        }
    }
    // 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
    XML11Configuration config = new XML11Configuration(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);
    DOMParser parser = new DOMParser(config);
    try {
        parser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.DEFER_NODE_EXPANSION_FEATURE, false);
    } catch (SAXException exc) {
    }
    fDOMParser = new SoftReference(parser);
    return parser;
}

2. SchemaGrammar#getSAXParser()

Project: openjdk
Source File: SchemaGrammar.java
View license
synchronized SAXParser getSAXParser() {
    if (fSAXParser != null) {
        SAXParser parser = (SAXParser) fSAXParser.get();
        if (parser != null) {
            return parser;
        }
    }
    // 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
    XML11Configuration config = new XML11Configuration(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);
    SAXParser parser = new SAXParser(config);
    fSAXParser = new SoftReference(parser);
    return parser;
}

3. XSDHandler#createAnnotationValidator()

Project: openjdk
Source File: XSDHandler.java
View license
private void createAnnotationValidator() {
    fAnnotationValidator = new XML11Configuration();
    fGrammarBucketAdapter = new XSAnnotationGrammarPool();
    fAnnotationValidator.setFeature(VALIDATION, true);
    fAnnotationValidator.setFeature(XMLSCHEMA_VALIDATION, true);
    fAnnotationValidator.setProperty(XMLGRAMMAR_POOL, fGrammarBucketAdapter);
    /** set security manager and XML Security Property Manager **/
    fAnnotationValidator.setProperty(SECURITY_MANAGER, (fSecurityManager != null) ? fSecurityManager : new XMLSecurityManager(true));
    fAnnotationValidator.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
    /** Set error handler. **/
    fAnnotationValidator.setProperty(ERROR_HANDLER, (fErrorHandler != null) ? fErrorHandler : new DefaultErrorHandler());
    /** Set locale. **/
    fAnnotationValidator.setProperty(LOCALE, fLocale);
}

4. StreamValidatorHelper#initialize()

Project: openjdk
Source File: StreamValidatorHelper.java
View license
private XMLParserConfiguration initialize() {
    XML11Configuration config = new XML11Configuration();
    if (fComponentManager.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        config.setProperty(SECURITY_MANAGER, new XMLSecurityManager());
    }
    config.setProperty(ENTITY_RESOLVER, fComponentManager.getProperty(ENTITY_RESOLVER));
    config.setProperty(ERROR_HANDLER, fComponentManager.getProperty(ERROR_HANDLER));
    XMLErrorReporter errorReporter = (XMLErrorReporter) fComponentManager.getProperty(ERROR_REPORTER);
    config.setProperty(ERROR_REPORTER, errorReporter);
    // add message formatters
    if (errorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
        XMLMessageFormatter xmft = new XMLMessageFormatter();
        errorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
        errorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
    }
    config.setProperty(SYMBOL_TABLE, fComponentManager.getProperty(SYMBOL_TABLE));
    config.setProperty(VALIDATION_MANAGER, fComponentManager.getProperty(VALIDATION_MANAGER));
    config.setDocumentHandler(fSchemaValidator);
    config.setDTDHandler(null);
    config.setDTDContentModelHandler(null);
    config.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, fComponentManager.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER));
    config.setProperty(Constants.SECURITY_MANAGER, fComponentManager.getProperty(Constants.SECURITY_MANAGER));
    fConfiguration = new SoftReference(config);
    return config;
}