use of org.w3c.dom.DocumentType in project robovm by robovm.
the class CreateDocument method testCreateDocument2.
public void testCreateDocument2() throws Throwable {
String namespaceURI = null;
String qualifiedName = "k:local";
Document doc;
DocumentType docType = null;
DOMImplementation domImpl;
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("throw_NAMESPACE_ERR", success);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class CreateDocument method testCreateDocument6.
public void testCreateDocument6() throws Throwable {
String namespaceURI = "http://ecommerce.org/schema";
String qualifiedName = "xml:local";
Document doc;
DocumentType docType = null;
DOMImplementation domImpl;
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("throw_NAMESPACE_ERR", success);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class CreateDocument method testCreateDocument8.
public void testCreateDocument8() throws Throwable {
String namespaceURI = "http://www.example.org/schema";
DocumentType docType = null;
DOMImplementation domImpl;
domImpl = builder.getDOMImplementation();
// Our exception priorities differ from the spec
try {
domImpl.createDocument(namespaceURI, "", docType);
fail();
} catch (DOMException ex) {
}
// END android-changed
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class CreateDocumentType method testCreateDocumentType3.
public void testCreateDocumentType3() throws Throwable {
String qualifiedName = "prefix:myDoc";
String publicId = "http://www.localhost.com";
String systemId = "myDoc.dtd";
Document doc;
DOMImplementation domImpl;
DocumentType newType = null;
String nodeName;
String nodeValue;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
newType = domImpl.createDocumentType(qualifiedName, publicId, systemId);
nodeName = newType.getNodeName();
assertEquals("nodeName", "prefix:myDoc", nodeName);
nodeValue = newType.getNodeValue();
assertNull("nodeValue", nodeValue);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class DOMImplementationCreateDocument method testCreateDocument3.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void testCreateDocument3() throws Throwable {
Document doc;
DOMImplementation domImpl;
Document newDoc;
DocumentType docType = null;
String namespaceURI = "http://www.w3.org/DOMTest/L2";
String qualifiedName;
List<String> qualifiedNames = new ArrayList<String>();
qualifiedNames.add("_:_");
qualifiedNames.add("_:h0");
qualifiedNames.add("_:test");
qualifiedNames.add("l_:_");
qualifiedNames.add("ns:_0");
qualifiedNames.add("ns:a0");
qualifiedNames.add("ns0:test");
qualifiedNames.add("a.b:c");
qualifiedNames.add("a-b:c");
qualifiedNames.add("a-b:c");
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
for (int indexN1006B = 0; indexN1006B < qualifiedNames.size(); indexN1006B++) {
qualifiedName = (String) qualifiedNames.get(indexN1006B);
newDoc = domImpl.createDocument(namespaceURI, qualifiedName, docType);
assertNotNull("domimplementationcreatedocument03", newDoc);
}
}
Aggregations