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

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

1. XSAnnotationImpl#writeToSAX()

Project: openjdk
Source File: XSAnnotationImpl.java
View license
// private methods
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    } catch (SAXException e) {
    } catch (IOException i) {
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}

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;
}