hc_documentcreatedocumentfragmentpublic final class hc_documentcreatedocumentfragment extends org.w3c.domts.DOMTestCase The "createDocumentFragment()" method creates an empty
DocumentFragment object.
Retrieve the entire DOM document and invoke its
"createDocumentFragment()" method. The content, name,
type and value of the newly created object are output. |
Constructors Summary |
---|
public hc_documentcreatedocumentfragment(org.w3c.domts.DOMTestDocumentBuilderFactory factory)Constructor.
super(factory);
//
// check if loaded documents are supported for content type
//
String contentType = getContentType();
preload(contentType, "hc_staff", true);
|
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_documentcreatedocumentfragment";
| public static void | main(java.lang.String[] args)Runs this test from the command line.
DOMTestCase.doMain(hc_documentcreatedocumentfragment.class, args);
| public void | runTest()Runs the test case.
Document doc;
DocumentFragment newDocFragment;
NodeList children;
int length;
String newDocFragmentName;
int newDocFragmentType;
String newDocFragmentValue;
doc = (Document) load("hc_staff", true);
newDocFragment = doc.createDocumentFragment();
children = newDocFragment.getChildNodes();
length = (int) children.getLength();
assertEquals("length", 0, length);
newDocFragmentName = newDocFragment.getNodeName();
assertEquals("strong", "#document-fragment", newDocFragmentName);
newDocFragmentType = (int) newDocFragment.getNodeType();
assertEquals("type", 11, newDocFragmentType);
newDocFragmentValue = newDocFragment.getNodeValue();
assertNull("value", newDocFragmentValue);
|
|