use of org.w3c.dom.DocumentType in project robovm by robovm.
the class DocumentTypeInternalSubset method testGetInternalSubset.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void testGetInternalSubset() throws Throwable {
Document doc;
DocumentType docType;
DOMImplementation domImpl;
String internal;
String nullNS = null;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
docType = domImpl.createDocumentType("l2:root", nullNS, nullNS);
internal = docType.getInternalSubset();
assertNull("internalSubsetNull", internal);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class ImportNode method testImportNode15.
public void testImportNode15() throws Throwable {
Document doc;
Document aNewDoc;
Text text;
Node aNode;
Document ownerDocument;
DocumentType docType;
String system;
String value;
doc = (Document) load("staffNS", builder);
aNewDoc = (Document) load("staffNS", builder);
text = aNewDoc.createTextNode("this is text data");
aNode = doc.importNode(text, false);
ownerDocument = aNode.getOwnerDocument();
assertNotNull("ownerDocumentNotNull", ownerDocument);
docType = ownerDocument.getDoctype();
system = docType.getSystemId();
assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
value = aNode.getNodeValue();
assertEquals("nodeValue", "this is text data", value);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class ImportNode method testImportNode14.
// Assumes validation
// public void testImportNode11() throws Throwable {
// Document doc;
// Document aNewDoc;
// EntityReference entRef;
// Node aNode;
// String name;
// Node child;
// String childValue;
// doc = (Document) load("staff", builder);
// aNewDoc = (Document) load("staff", builder);
// entRef = aNewDoc.createEntityReference("ent3");
// assertNotNull("createdEntRefNotNull", entRef);
// aNode = doc.importNode(entRef, true);
// name = aNode.getNodeName();
// assertEquals("entityName", "ent3", name);
// child = aNode.getFirstChild();
// assertNotNull("child", child);
// childValue = child.getNodeValue();
// assertEquals("childValue", "Texas", childValue);
// }
// Assumes validation.
// public void testImportNode12() throws Throwable {
// Document doc;
// Document aNewDoc;
// DocumentType doc1Type;
// NamedNodeMap entityList;
// Entity entity2;
// Entity entity1;
// Document ownerDocument;
// DocumentType docType;
// String system;
// String entityName;
// Node child;
// String childName;
// doc = (Document) load("staffNS", builder);
// aNewDoc = (Document) load("staffNS", builder);
// doc1Type = aNewDoc.getDoctype();
// entityList = doc1Type.getEntities();
// assertNotNull("entitiesNotNull", entityList);
// entity2 = (Entity) entityList.getNamedItem("ent4");
// entity1 = (Entity) doc.importNode(entity2, true);
// ownerDocument = entity1.getOwnerDocument();
// docType = ownerDocument.getDoctype();
// system = docType.getSystemId();
// assertURIEquals("systemId", null, null, null, "staffNS.dtd", null,
// null, null, null, system);
// entityName = entity1.getNodeName();
// assertEquals("entityName", "ent4", entityName);
// child = entity1.getFirstChild();
// assertNotNull("notnull", child);
// childName = child.getNodeName();
// assertEquals("childName", "entElement1", childName);
// }
// Assumes validation
// public void testImportNode13() throws Throwable {
// Document doc;
// Document aNewDoc;
// DocumentType doc1Type;
// NamedNodeMap notationList;
// Notation notation;
// Notation aNode;
// Document ownerDocument;
// DocumentType docType;
// String system;
// String publicVal;
// doc = (Document) load("staffNS", builder);
// aNewDoc = (Document) load("staffNS", builder);
// doc1Type = aNewDoc.getDoctype();
// notationList = doc1Type.getNotations();
// assertNotNull("notationsNotNull", notationList);
// notation = (Notation) notationList.getNamedItem("notation1");
// aNode = (Notation) doc.importNode(notation, false);
// ownerDocument = aNode.getOwnerDocument();
// docType = ownerDocument.getDoctype();
// system = docType.getSystemId();
// assertURIEquals("systemId", null, null, null, "staffNS.dtd", null,
// null, null, null, system);
// publicVal = aNode.getPublicId();
// assertEquals("publicId", "notation1File", publicVal);
// system = aNode.getSystemId();
// assertNull("notationSystemId", system);
// }
public void testImportNode14() throws Throwable {
Document doc;
Document aNewDoc;
ProcessingInstruction pi;
ProcessingInstruction aNode;
Document ownerDocument;
DocumentType docType;
String system;
String target;
String data;
doc = (Document) load("staffNS", builder);
aNewDoc = (Document) load("staffNS", builder);
pi = aNewDoc.createProcessingInstruction("target1", "data1");
aNode = (ProcessingInstruction) doc.importNode(pi, false);
ownerDocument = aNode.getOwnerDocument();
assertNotNull("ownerDocumentNotNull", ownerDocument);
docType = ownerDocument.getDoctype();
system = docType.getSystemId();
assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
target = aNode.getTarget();
assertEquals("piTarget", "target1", target);
data = aNode.getData();
assertEquals("piData", "data1", data);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class ImportNode method testImportNode3.
public void testImportNode3() throws Throwable {
Document doc;
Document aNewDoc;
Comment comment;
Node aNode;
Document ownerDocument;
DocumentType docType;
String system;
String value;
doc = (Document) load("staffNS", builder);
aNewDoc = (Document) load("staffNS", builder);
comment = aNewDoc.createComment("this is a comment");
aNode = doc.importNode(comment, false);
ownerDocument = aNode.getOwnerDocument();
assertNotNull("ownerDocumentNotNull", ownerDocument);
docType = ownerDocument.getDoctype();
system = docType.getSystemId();
assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
value = aNode.getNodeValue();
assertEquals("nodeValue", "this is a comment", value);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class ImportNode method testImportNode5.
public void testImportNode5() throws Throwable {
Document doc;
Document aNewDoc;
Element element;
Node aNode;
boolean hasChild;
Document ownerDocument;
DocumentType docType;
String system;
String name;
NodeList addresses;
doc = (Document) load("staffNS", builder);
aNewDoc = (Document) load("staffNS", builder);
addresses = aNewDoc.getElementsByTagName("emp:address");
element = (Element) addresses.item(0);
assertNotNull("empAddressNotNull", element);
aNode = doc.importNode(element, false);
hasChild = aNode.hasChildNodes();
assertFalse("hasChild", hasChild);
ownerDocument = aNode.getOwnerDocument();
docType = ownerDocument.getDoctype();
system = docType.getSystemId();
assertURIEquals("dtdSystemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
name = aNode.getNodeName();
assertEquals("nodeName", "emp:address", name);
}
Aggregations