com.sun.org.apache.xerces.internal.parsers.XMLGrammarPreparser Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.parsers.XMLGrammarPreparser. 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: GrammarPreParser.java    From jumbune with GNU Lesser General Public License v3.0 6 votes vote down vote up
public synchronized XMLGrammarPoolImpl loadCache(String schemaURI) {
	grammarPool = new XMLGrammarPoolImpl();
	
	XMLGrammarPreparser preparser = new XMLGrammarPreparser();
	preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
	preparser.setProperty(GRAMMAR_POOL, grammarPool);
	preparser.setFeature("http://xml.org/sax/features/validation", true);
	preparser.setFeature("http://apache.org/xml/features/validation/schema", true);
	// parse the grammar...

	try {
		preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, new XMLInputSource(null,schemaURI, null));
	} catch (XNIException xe) {
		LOGGER.error(xe);
	} catch (IOException ioe) {
		LOGGER.error(ioe);
	}
	return grammarPool;

}
 
Example #2
Source File: PreParseGrammarTest.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws FileNotFoundException, XNIException, IOException {
    File xsdf = new File(System.getProperty("test.src", ".") + "/test.xsd");
    InputStream is = new BufferedInputStream(new FileInputStream(xsdf));
    XMLInputSource xis = new XMLInputSource(null, null, null, is, null);
    XMLGrammarPreparser gp = new XMLGrammarPreparser();
    gp.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
    //The NullPointerException is observed on next call during ant task
    // execution
    Grammar res = gp.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xis);
    System.out.println("Grammar preparsed successfully:" + res);
    return;
}
 
Example #3
Source File: PreParseGrammarTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws FileNotFoundException, XNIException, IOException {
    File xsdf = new File(System.getProperty("test.src", ".") + "/test.xsd");
    InputStream is = new BufferedInputStream(new FileInputStream(xsdf));
    XMLInputSource xis = new XMLInputSource(null, null, null, is, null);
    XMLGrammarPreparser gp = new XMLGrammarPreparser();
    gp.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
    //The NullPointerException is observed on next call during ant task
    // execution
    Grammar res = gp.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xis);
    System.out.println("Grammar preparsed successfully:" + res);
    return;
}
 
Example #4
Source File: PreParseGrammarTest.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws FileNotFoundException, XNIException, IOException {
    File xsdf = new File(System.getProperty("test.src", ".") + "/test.xsd");
    InputStream is = new BufferedInputStream(new FileInputStream(xsdf));
    XMLInputSource xis = new XMLInputSource(null, null, null, is, null);
    XMLGrammarPreparser gp = new XMLGrammarPreparser();
    gp.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
    //The NullPointerException is observed on next call during ant task
    // execution
    Grammar res = gp.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xis);
    System.out.println("Grammar preparsed successfully:" + res);
    return;
}
 
Example #5
Source File: PreParseGrammarTest.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws FileNotFoundException, XNIException, IOException {
    File xsdf = new File(System.getProperty("test.src", ".") + "/test.xsd");
    InputStream is = new BufferedInputStream(new FileInputStream(xsdf));
    XMLInputSource xis = new XMLInputSource(null, null, null, is, null);
    XMLGrammarPreparser gp = new XMLGrammarPreparser();
    gp.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
    //The NullPointerException is observed on next call during ant task
    // execution
    Grammar res = gp.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xis);
    System.out.println("Grammar preparsed successfully:" + res);
    return;
}
 
Example #6
Source File: PreParseGrammarTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws FileNotFoundException, XNIException, IOException {
    File xsdf = new File(System.getProperty("test.src", ".") + "/test.xsd");
    InputStream is = new BufferedInputStream(new FileInputStream(xsdf));
    XMLInputSource xis = new XMLInputSource(null, null, null, is, null);
    XMLGrammarPreparser gp = new XMLGrammarPreparser();
    gp.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
    //The NullPointerException is observed on next call during ant task
    // execution
    Grammar res = gp.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xis);
    System.out.println("Grammar preparsed successfully:" + res);
    return;
}
 
Example #7
Source File: PreParseGrammarTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws FileNotFoundException, XNIException, IOException {
    File xsdf = new File(System.getProperty("test.src", ".") + "/test.xsd");
    InputStream is = new BufferedInputStream(new FileInputStream(xsdf));
    XMLInputSource xis = new XMLInputSource(null, null, null, is, null);
    XMLGrammarPreparser gp = new XMLGrammarPreparser();
    gp.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
    //The NullPointerException is observed on next call during ant task
    // execution
    Grammar res = gp.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xis);
    System.out.println("Grammar preparsed successfully:" + res);
    return;
}
 
Example #8
Source File: PreParseGrammarTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws FileNotFoundException, XNIException, IOException {
    File xsdf = new File(System.getProperty("test.src", ".") + "/test.xsd");
    InputStream is = new BufferedInputStream(new FileInputStream(xsdf));
    XMLInputSource xis = new XMLInputSource(null, null, null, is, null);
    XMLGrammarPreparser gp = new XMLGrammarPreparser();
    gp.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
    //The NullPointerException is observed on next call during ant task
    // execution
    Grammar res = gp.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xis);
    System.out.println("Grammar preparsed successfully:" + res);
    return;
}
 
Example #9
Source File: PreParseGrammarTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws FileNotFoundException, XNIException, IOException {
    File xsdf = new File(System.getProperty("test.src", ".") + "/test.xsd");
    InputStream is = new BufferedInputStream(new FileInputStream(xsdf));
    XMLInputSource xis = new XMLInputSource(null, null, null, is, null);
    XMLGrammarPreparser gp = new XMLGrammarPreparser();
    gp.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
    //The NullPointerException is observed on next call during ant task
    // execution
    Grammar res = gp.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xis);
    System.out.println("Grammar preparsed successfully:" + res);
    return;
}
 
Example #10
Source File: PreParseGrammarTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws FileNotFoundException, XNIException, IOException {
    File xsdf = new File(System.getProperty("test.src", ".") + "/test.xsd");
    InputStream is = new BufferedInputStream(new FileInputStream(xsdf));
    XMLInputSource xis = new XMLInputSource(null, null, null, is, null);
    XMLGrammarPreparser gp = new XMLGrammarPreparser();
    gp.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
    //The NullPointerException is observed on next call during ant task
    // execution
    Grammar res = gp.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xis);
    System.out.println("Grammar preparsed successfully:" + res);
    return;
}
 
Example #11
Source File: PreParseGrammarTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws FileNotFoundException, XNIException, IOException {
    File xsdf = new File(System.getProperty("test.src", ".") + "/test.xsd");
    InputStream is = new BufferedInputStream(new FileInputStream(xsdf));
    XMLInputSource xis = new XMLInputSource(null, null, null, is, null);
    XMLGrammarPreparser gp = new XMLGrammarPreparser();
    gp.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
    //The NullPointerException is observed on next call during ant task
    // execution
    Grammar res = gp.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xis);
    System.out.println("Grammar preparsed successfully:" + res);
    return;
}
 
Example #12
Source File: PreParseGrammarTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws FileNotFoundException, XNIException, IOException {
    File xsdf = new File(System.getProperty("test.src", ".") + "/test.xsd");
    InputStream is = new BufferedInputStream(new FileInputStream(xsdf));
    XMLInputSource xis = new XMLInputSource(null, null, null, is, null);
    XMLGrammarPreparser gp = new XMLGrammarPreparser();
    gp.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
    //The NullPointerException is observed on next call during ant task
    // execution
    Grammar res = gp.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xis);
    System.out.println("Grammar preparsed successfully:" + res);
    return;
}