-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
tiger
-
generic
-
generic
-
Verified
Name: eaR10174 Date: 09/04/2003
The method DOMImplementation.hasFeature() returns false in case when the feature is
either "XML" or "Core" and the version is "3.0" (see test.java below). According to the
DOM Level 3 specification
A DOM implementation must not return true to the
DOMImplementation.hasFeature(feature, version) method of the DOMImplementation
interface for that feature unless the implementation conforms to that module. The
version number for all features used in DOM Level 3.0 is "3.0".
the method should return true.
The bug appears in jdk1.5.0beta-b17.
------------------------------------test.java-----------------------------
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.DOMImplementation;
public class test {
public static void main(String argv[]) {
new test().run();
}
public void run() {
try {
DOMImplementation domImpl = DocumentBuilderFactory.newInstance()
.newDocumentBuilder()
.getDOMImplementation();
System.out.println(domImpl.hasFeature("XML", "3.0"));
System.out.println(domImpl.hasFeature("Core", "3.0"));
} catch (Exception e) {
e.printStackTrace();
return;
}
}
}
--------------------------------------------------------------------------
% java -showversion test
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b17)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b17, mixed mode)
false
false
--------------------------------------------------------------------------
======================================================================
The method DOMImplementation.hasFeature() returns false in case when the feature is
either "XML" or "Core" and the version is "3.0" (see test.java below). According to the
DOM Level 3 specification
A DOM implementation must not return true to the
DOMImplementation.hasFeature(feature, version) method of the DOMImplementation
interface for that feature unless the implementation conforms to that module. The
version number for all features used in DOM Level 3.0 is "3.0".
the method should return true.
The bug appears in jdk1.5.0beta-b17.
------------------------------------test.java-----------------------------
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.DOMImplementation;
public class test {
public static void main(String argv[]) {
new test().run();
}
public void run() {
try {
DOMImplementation domImpl = DocumentBuilderFactory.newInstance()
.newDocumentBuilder()
.getDOMImplementation();
System.out.println(domImpl.hasFeature("XML", "3.0"));
System.out.println(domImpl.hasFeature("Core", "3.0"));
} catch (Exception e) {
e.printStackTrace();
return;
}
}
}
--------------------------------------------------------------------------
% java -showversion test
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b17)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b17, mixed mode)
false
false
--------------------------------------------------------------------------
======================================================================