JDK-8224556 : Release Note: New Methods for Creating DOM and SAX Factories with Namespace Support
  • Type: Sub-task
  • Component: xml
  • Sub-Component: jaxp
  • Affected Version: 13
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2019-05-21
  • Updated: 2019-08-08
  • Resolved: 2019-07-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13Resolved
Description
New methods have been added for instantiating DOM and SAX factories with Namespace support by default. These methods are prefixed over their existing counterparts with "NS," which stands for NamespaceAware. Below is a list of the new methods:

 - `newDefaultNSInstance()`
 - `newNSInstance()`
 - `newNSInstance(String factoryClassName, ClassLoader classLoader)`

Using these new methods, a parser created through the factory will be NamespaceAware by default. For example, the following statement:

    DocumentBuilder db = DocumentBuilderFactory.newDefaultNSInstance().newDocumentBuilder(); 

is equivalent to:

    DocumentBuilderFactory dbf = DocumentBuilderFactory.newDefaultInstance(); 
    dbf.setNamespaceAware(true); 
    DocumentBuilder db = dbf.newDocumentBuilder(); 

Comments
Review By: Lance Andersen
23-05-2019