use of org.w3c.dom.DocumentType in project robovm by robovm.
the class NodeGetOwnerDocument method testGetOwnerDocument2.
public void testGetOwnerDocument2() throws Throwable {
Document doc;
Document newDoc;
Element newElem;
Document ownerDocDoc;
Document ownerDocElem;
DOMImplementation domImpl;
DocumentType docType;
String nullNS = null;
doc = (Document) load("staff", builder);
domImpl = doc.getImplementation();
docType = domImpl.createDocumentType("mydoc", nullNS, nullNS);
newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "mydoc", docType);
ownerDocDoc = newDoc.getOwnerDocument();
assertNull("nodegetownerdocument02_1", ownerDocDoc);
newElem = newDoc.createElementNS("http://www.w3.org/DOM/Test", "myelem");
ownerDocElem = newElem.getOwnerDocument();
assertNotNull("nodegetownerdocument02_2", ownerDocElem);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class NodeHasAttributes method testHasAttributes4.
public void testHasAttributes4() throws Throwable {
Document doc;
Document newDoc;
DocumentType docType = null;
DOMImplementation domImpl;
Element element;
Element elementTest;
Element elementDoc;
Attr attribute;
NodeList elementList;
boolean hasAttributes;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "test", docType);
element = newDoc.createElementNS("http://www.w3.org/DOM/Test", "dom:elem");
attribute = newDoc.createAttribute("attr");
element.setAttributeNode(attribute);
elementDoc = newDoc.getDocumentElement();
elementDoc.appendChild(element);
elementList = newDoc.getElementsByTagNameNS("http://www.w3.org/DOM/Test", "elem");
elementTest = (Element) elementList.item(0);
hasAttributes = elementTest.hasAttributes();
assertTrue("nodehasattributes04", hasAttributes);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class SystemId method testGetSystemId.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void testGetSystemId() throws Throwable {
Document doc;
DocumentType docType;
String systemId;
doc = (Document) load("staffNS", builder);
docType = doc.getDoctype();
systemId = docType.getSystemId();
assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, systemId);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class OwnerDocument method testGetOwnerDocument.
/**
* Runs the test case.
* @throws Throwable Any uncaught exception causes test to fail
*/
public void testGetOwnerDocument() throws Throwable {
Document doc;
DocumentType ownerDocument;
doc = (Document) load("staff", builder);
ownerDocument = (DocumentType) doc.getOwnerDocument();
assertNull("throw_Null", ownerDocument);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class PublicId method testGetPublicId.
/**
* Runs the test case.
* @throws Throwable Any uncaught exception causes test to fail
*/
public void testGetPublicId() throws Throwable {
Document doc;
DocumentType docType;
String publicId;
doc = (Document) load("staffNS", builder);
docType = doc.getDoctype();
publicId = docType.getPublicId();
assertEquals("throw_Equals", "STAFF", publicId);
}
Aggregations