-
Sub-task
-
Resolution: Delivered
-
P4
-
13
-
Verified
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();
- `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();