import com.sun.org.apache.xerces.internal.dom.DOMImplementationImpl;
public static Document newDocument( String pName ) {
return DOMImplementationImpl.getDOMImplementation().createDocument(
null,
pName,
DOMImplementationImpl.getDOMImplementation().createDocumentType( pName, null, null ) );
}
I have encounter with below warnings in netbeans
warning: com.sun.org.apache.xerces.internal.dom.DOMImplementationImpl is Sun proprietary API and may be removed in a future release
return DOMImplementationImpl.getDOMImplementation().createDocument(
warning: com.sun.org.apache.xerces.internal.dom.DOMImplementationImpl is Sun proprietary API and may be removed in a future release DOMImplementationImpl.getDOMImplementation().createDocumentType( pName, null, null ) );
Don’t refer to a concrete DOMImplementation. Instead, use:
Alternatively, use a rather less factory-heavy XML API, like JDOM 🙂 (I’ve always found the Java W3C DOM API to be a complete pain to work with.)
Yet another alternative would be to use a concrete DOMImplementation, but make it an external one rather than relying on an implementation built into the JDK. This could still be Apache Xerces, just from a jar file.