documentcreateprocessinginstructionpublic final class documentcreateprocessinginstruction extends org.w3c.domts.DOMTestCase The "createProcessingInstruction(target,data)" method
creates a new ProcessingInstruction node with the
specified name and data string.
Retrieve the entire DOM document and invoke its
"createProcessingInstruction(target,data)" method.
It should create a new PI node with the specified target
and data. The target, data and type are retrieved and
output. |
Constructors Summary |
---|
public documentcreateprocessinginstruction(org.w3c.domts.DOMTestDocumentBuilderFactory factory)Constructor.
super(factory);
//
// check if loaded documents are supported for content type
//
String contentType = getContentType();
preload(contentType, "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/documentcreateprocessinginstruction";
| public static void | main(java.lang.String[] args)Runs this test from the command line.
DOMTestCase.doMain(documentcreateprocessinginstruction.class, args);
| public void | runTest()Runs the test case.
Document doc;
ProcessingInstruction newPINode;
String piValue;
String piName;
int piType;
doc = (Document) load("staff", true);
newPINode = doc.createProcessingInstruction("TESTPI", "This is a new PI node");
assertNotNull("createdPINotNull", newPINode);
piName = newPINode.getNodeName();
assertEquals("name", "TESTPI", piName);
piValue = newPINode.getNodeValue();
assertEquals("value", "This is a new PI node", piValue);
piType = (int) newPINode.getNodeType();
assertEquals("type", 7, piType);
|
|