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:
DomClassInfo.java - DOM Implementation Class
How to verify the DOM (Document Object Model) implementation class information?
✍: FYIcenter
If you want to verify the DOM (Document Object Model) implementation class information,
you can try the following example program:
// Copyright (c) 2017 FYIcenter.com import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Text; public class DomClassInfo { public static void main(String[] args) throws Exception { DocumentBuilderFactory f = DocumentBuilderFactory.newInstance(); DocumentBuilder b = f.newDocumentBuilder(); Document d = b.newDocument(); Element e = d.createElement("Msg"); Text t = d.createTextNode("Hello World!"); e.appendChild(t); d.appendChild(e); System.out.println("DOM class info:"); System.out.println(" Factory: "+f.getClass().getName()); System.out.println(" Builder: "+b.getClass().getName()); System.out.println(" Document: "+d.getClass().getName()); System.out.println(" Element: "+e.getClass().getName()); System.out.println(" TextNode: "+t.getClass().getName()); } }
Compile and test it:
>\fyicenter\jdk-1.8.0\bin\javac DomClassInfo.java >\fyicenter\jdk-1.8.0\bin\java DomClassInfo DOM class info: Factory: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl Builder: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl Document: com.sun.org.apache.xerces.internal.dom.DocumentImpl Element: com.sun.org.apache.xerces.internal.dom.ElementImpl TextNode: com.sun.org.apache.xerces.internal.dom.TextImpl
The output tells you that the default implementation of DOM in Java SE 8 JDK is the Apache Xerces package.
⇒ Version of Apache Xerces Used in Java SE 8
⇐ Using XML DOM API with Apache Xerces
2017-09-08, 1573🔥, 0💬
Popular Posts:
The goal of the Geronimo project is to produce a server runtime framework that pulls together the be...
XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with ...
A stream buffer is a stream-based representation of an XML infoset in Java. Stream buffers are desig...
What Is javamail-1_2.zip? javamail-1_2.zip is the binary package of JavaMail API 1.2 in ZIP format. ...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...