Categories:
Audio (13)
Biotech (29)
Bytecode (35)
Database (77)
Framework (7)
Game (7)
General (512)
Graphics (53)
I/O (32)
IDE (2)
JAR Tools (86)
JavaBeans (16)
JDBC (89)
JDK (337)
JSP (20)
Logging (103)
Mail (54)
Messaging (8)
Network (71)
PDF (94)
Report (7)
Scripting (83)
Security (32)
Server (119)
Servlet (17)
SOAP (24)
Testing (50)
Web (19)
XML (301)
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
Â
2017-12-09, 1264👍, 0💬
Popular Posts:
Jaxen, Release 1.1.1, is an open source XPath library written in Java. It is adaptable to many diffe...
Commons Pool provides an Object-pooling API, with three major aspects: 1. A generic object pool inte...
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module. JDK 11 Desktop module compiled ...
What Is ojdbc5.jar for Oracle 11g R1? ojdbc5.jar for Oracle 11g R1 is the JAR files of ojdbc.jar, JD...
JDK 6 tools.jar is the JAR file for JDK 6 tools. It contains Java classes to support different JDK t...