use of org.w3c.dom.DOMImplementation 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.DOMImplementation 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.DOMImplementation in project robovm by robovm.
the class CreateDocumentType method testCreateDocumentType4.
public void testCreateDocumentType4() throws Throwable {
String publicId = "http://www.example.com/";
String systemId = "myDoc.dtd";
DOMImplementation domImpl;
domImpl = builder.getDOMImplementation();
{
boolean success = false;
try {
domImpl.createDocumentType("", publicId, systemId);
} catch (DOMException ex) {
success = (ex.code == DOMException.NAMESPACE_ERR);
}
assertTrue("throw_NAMESPACE_ERR", success);
}
}
use of org.w3c.dom.DOMImplementation in project robovm by robovm.
the class CreateDocumentType method testCreateDocumentType2.
public void testCreateDocumentType2() throws Throwable {
String publicId = "http://www.localhost.com/";
String systemId = "myDoc.dtd";
String qualifiedName;
Document doc;
DOMImplementation domImpl;
List<String> illegalQNames = new ArrayList<String>();
illegalQNames.add("edi:{");
illegalQNames.add("edi:}");
illegalQNames.add("edi:~");
illegalQNames.add("edi:'");
illegalQNames.add("edi:!");
illegalQNames.add("edi:@");
illegalQNames.add("edi:#");
illegalQNames.add("edi:$");
illegalQNames.add("edi:%");
illegalQNames.add("edi:^");
illegalQNames.add("edi:&");
illegalQNames.add("edi:*");
illegalQNames.add("edi:(");
illegalQNames.add("edi:)");
illegalQNames.add("edi:+");
illegalQNames.add("edi:=");
illegalQNames.add("edi:[");
illegalQNames.add("edi:]");
illegalQNames.add("edi:\\");
illegalQNames.add("edi:/");
illegalQNames.add("edi:;");
illegalQNames.add("edi:`");
illegalQNames.add("edi:<");
illegalQNames.add("edi:>");
illegalQNames.add("edi:,");
illegalQNames.add("edi:a ");
illegalQNames.add("edi:\"");
doc = (Document) load("staffNS", builder);
for (int indexN1009A = 0; indexN1009A < illegalQNames.size(); indexN1009A++) {
qualifiedName = (String) illegalQNames.get(indexN1009A);
domImpl = doc.getImplementation();
{
boolean success = false;
try {
domImpl.createDocumentType(qualifiedName, publicId, systemId);
} catch (DOMException ex) {
success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
}
assertTrue("throw_INVALID_CHARACTER_ERR", success);
}
}
}
use of org.w3c.dom.DOMImplementation 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);
}
Aggregations