-
Bug
-
Resolution: Fixed
-
P4
-
1.4.1
-
1.1.1
-
sparc
-
solaris_7
-
Verified
Name: inR10064 Date: 10/31/2000
Invocation of the createDocumentType(String qualifiedName, String publicId,
String systemId) defined in interface org.w3c.dom.DOMImplementation with arguments
implementation.createDocumentType("root::root", "t1", null);
doesn't throw DOMException with the NAMESPACE_ERR error code as it sould do
(See test.java below), because the qualified name "root::root" is malformed.
Definition of the method in p. 1.2 "Fundamental Interfaces" of DOM Level 2 Core
(http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490) says:
" Exceptions
DOMException ....
NAMESPACE_ERR: Raised if the qualifiedName is malformed. "
This bug presents in builds jaxp-1.1ea-b8, jaxp-1.1fcs-b9 and jaxp-1.1ea2-b10 and
affects the new test in TCK JAXP 1.1
api/org_w3c_dom/DOMImplementation/CreateDocumentTypeTests.html#createDocumentTypeTest003
------------------------------------test.java-----------------------------
import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
import org.w3c.dom.DOMImplementation;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import java.io.ByteArrayInputStream;
import org.w3c.dom.DOMException;
public class test {
public static void main(String argv[]) {
try {
DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance()
.newDocumentBuilder();
Document document = documentBuilder.newDocument();
DOMImplementation implementation = document.getImplementation();
DocumentType dt = implementation.createDocumentType("root::root", "t1", null);
System.out.println("DocumentType name: " + dt.getName());
} catch (DOMException e) {
if (e.code == DOMException.NAMESPACE_ERR) {
System.out.println("OKEY");
} else {
System.out.println("Unexpected error code " + e.code);
}
} catch (Exception e) {
System.out.println("Unexpected " + e + " was thrown");
}
}
}
---------------------------------------------------------------------------
---------------------------------------------------------------------------
% java -showversion test
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, interpreted mode)
DocumentType name: root::root
---------------------------------------------------------------------------
======================================================================