hc_documentgetimplementationpublic final class hc_documentgetimplementation extends org.w3c.domts.DOMTestCase Retrieve the entire DOM document and invoke its
"getImplementation()" method. If contentType="text/html",
DOMImplementation.hasFeature("HTML","1.0") should be true.
Otherwise, DOMImplementation.hasFeature("XML", "1.0")
should be true. |
Constructors Summary |
---|
public hc_documentgetimplementation(org.w3c.domts.DOMTestDocumentBuilderFactory factory)Constructor.
super(factory);
//
// check if loaded documents are supported for content type
//
String contentType = getContentType();
preload(contentType, "hc_staff", false);
|
Methods Summary |
---|
public java.lang.String | getTargetURI()Gets URI that identifies the test.
return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetimplementation";
| public static void | main(java.lang.String[] args)Runs this test from the command line.
DOMTestCase.doMain(hc_documentgetimplementation.class, args);
| public void | runTest()Runs the test case.
Document doc;
DOMImplementation docImpl;
boolean xmlstate;
boolean htmlstate;
doc = (Document) load("hc_staff", false);
docImpl = doc.getImplementation();
xmlstate = docImpl.hasFeature("XML", "1.0");
htmlstate = docImpl.hasFeature("HTML", "1.0");
if (("text/html".equals(getContentType()))) {
assertTrue("supports_HTML_1.0", htmlstate);
} else {
assertTrue("supports_XML_1.0", xmlstate);
}
|
|