use of org.w3c.dom.DOMImplementation in project robovm by robovm.
the class DOMImplementationCreateDocument method testCreateDocument7.
public void testCreateDocument7() throws Throwable {
Document doc;
DOMImplementation domImpl;
String namespaceURI = "http://www.w3.org/DOMTest/level2";
DocumentType docType = null;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
{
boolean success = false;
try {
domImpl.createDocument(namespaceURI, ":", docType);
} catch (DOMException ex) {
success = (ex.code == DOMException.NAMESPACE_ERR);
}
assertTrue("domimplementationcreatedocument07", success);
}
}
use of org.w3c.dom.DOMImplementation in project robovm by robovm.
the class DOMImplementationCreateDocument method testCreateDocument4.
public void testCreateDocument4() throws Throwable {
Document doc;
DOMImplementation domImpl;
String namespaceURI = null;
String qualifiedName = "dom:root";
DocumentType docType = null;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
{
boolean success = false;
try {
domImpl.createDocument(namespaceURI, qualifiedName, docType);
} catch (DOMException ex) {
success = (ex.code == DOMException.NAMESPACE_ERR);
}
assertTrue("domimplementationcreatedocument04", success);
}
}
use of org.w3c.dom.DOMImplementation in project robovm by robovm.
the class DocumentTypePublicId method testGetPublicId.
/**
* Runs the test case.
* @throws Throwable Any uncaught exception causes test to fail
*/
public void testGetPublicId() throws Throwable {
Document doc;
DocumentType docType;
DOMImplementation domImpl;
String publicId;
String nullNS = null;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
docType = domImpl.createDocumentType("l2:root", "PUB", nullNS);
publicId = docType.getPublicId();
assertEquals("documenttypepublicid01", "PUB", publicId);
}
use of org.w3c.dom.DOMImplementation in project robovm by robovm.
the class DocumentTypeSystemId method testGetSystemId.
/**
* Runs the test case.
* @throws Throwable Any uncaught exception causes test to fail
*/
public void testGetSystemId() throws Throwable {
Document doc;
DocumentType docType;
DOMImplementation domImpl;
String publicId;
String systemId;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
docType = domImpl.createDocumentType("l2:root", "PUB", "SYS");
publicId = docType.getPublicId();
systemId = docType.getSystemId();
assertEquals("documenttypepublicid01", "PUB", publicId);
assertEquals("documenttypesystemid01", "SYS", systemId);
}
use of org.w3c.dom.DOMImplementation in project robovm by robovm.
the class XPathExpressionImpl method getDummyDocument.
private static Document getDummyDocument() {
try {
if (dbf == null) {
dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setValidating(false);
}
db = dbf.newDocumentBuilder();
DOMImplementation dim = db.getDOMImplementation();
d = dim.createDocument("http://java.sun.com/jaxp/xpath", "dummyroot", null);
return d;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
Aggregations