Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
SaxClassInfo.java - SAX Implementation Class
How to verify the SAX (Simple API for XML) implementation class information?
✍: FYIcenter
If you want to verify the SAX (Simple API for XML) implementation class information, you can try the following example program:
// Copyright (c) 2017 FYIcenter.com import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParser; public class SaxClassInfo { public static void main(String[] args) throws Exception { SAXParserFactory f = SAXParserFactory.newInstance(); SAXParser p = f.newSAXParser(); System.out.println("SAX class info:"); System.out.println(" Factory: "+f.getClass().getName()); System.out.println(" Parser: "+p.getClass().getName()); } }
Compile and run it with Java SE 8 SDK:
>\fyicenter\jdk-1.8.0\bin\javac SaxClassInfo.java >\fyicenter\jdk-1.8.0\bin\java SaxClassInfo SAX class info: Factory: com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl Parser: com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
Run it again with Apache Xerces 2.11.0 xercesImpl.jar provided:
>\fyicenter\jdk-1.8.0\bin\java -cp .;\fyicenter\xerces-2_11_0\xercesImpl.jar; SaxClassInfo SAX class info: Factory: org.apache.xerces.jaxp.SAXParserFactoryImpl Parser: org.apache.xerces.jaxp.SAXParserImpl
The output tells you that the default implementation of SAX in Java SE 8 JDK is the Apache Xerces 2.7.1 package. And you can override it with Apache Xerces 2.11.0 by specifiying the JAR file to the -cp option.
You can confirm Apache Xerces version numbers as desribed below:
>\fyicenter\jdk-1.8.0\bin\java com.sun.org.apache.xerces.internal.impl.Version Xerces-J 2.7.1 >\fyicenter\jdk-1.8.0\bin\java -cp .;\fyicenter\xerces-2_11_0\xercesImpl.jar org.apache.xerces.impl.Version Xerces-J 2.11.0
⇒ SaxXmlParser.java - SAX XML Parser Example
⇐ Using XML SAX API with Apache Xerces
2017-12-09, 1515🔥, 0💬
Popular Posts:
JRE 8 rt.jar is the JAR file for JRE 8 RT (Runtime) libraries. JRE (Java Runtime) 8 is the runtime e...
pache Derby is an open source relational database implemented entirely in Java and available under t...
JRE 8 deploy.jar is the JAR file for JRE 8 Java Control Panel and other deploy tools. JRE (Java Runt...
JasperReports, the world's most popular open source business intelligence and reporting engine and J...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...