use of org.w3c.dom.DocumentType in project robovm by robovm.
the class DOMImplementationCreateDocumentType method testCreateDocumentType2.
public void testCreateDocumentType2() throws Throwable {
Document doc;
DOMImplementation domImpl;
DocumentType newDocType;
Document ownerDocument;
String publicId = "http://www.w3.org/DOM/Test/dom2.dtd";
String systemId = "dom2.dtd";
String qualifiedName;
List<String> qualifiedNames = new ArrayList<String>();
qualifiedNames.add("_:_");
qualifiedNames.add("_:h0");
qualifiedNames.add("_:test");
qualifiedNames.add("_:_.");
qualifiedNames.add("_:a-");
qualifiedNames.add("l_:_");
qualifiedNames.add("ns:_0");
qualifiedNames.add("ns:a0");
qualifiedNames.add("ns0:test");
qualifiedNames.add("ns:EEE.");
qualifiedNames.add("ns:_-");
qualifiedNames.add("a.b:c");
qualifiedNames.add("a-b:c.j");
qualifiedNames.add("a-b:c");
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
for (int indexN10077 = 0; indexN10077 < qualifiedNames.size(); indexN10077++) {
qualifiedName = (String) qualifiedNames.get(indexN10077);
newDocType = domImpl.createDocumentType(qualifiedName, publicId, systemId);
assertNotNull("domimplementationcreatedocumenttype02_newDocType", newDocType);
ownerDocument = newDocType.getOwnerDocument();
assertNull("domimplementationcreatedocumenttype02_ownerDocument", ownerDocument);
}
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class DOMImplementationCreateDocumentType method testCreateDocumentType4.
public void testCreateDocumentType4() throws Throwable {
Document doc;
DOMImplementation domImpl;
DocumentType newDocType;
Document ownerDocument;
String publicId = "http://www.w3.org/DOM/Test/dom2.dtd";
String systemId = "dom2.dtd";
String qualifiedName;
List<String> qualifiedNames = new ArrayList<String>();
qualifiedNames.add("_:_");
qualifiedNames.add("_:h0");
qualifiedNames.add("_:test");
qualifiedNames.add("_:_.");
qualifiedNames.add("_:a-");
qualifiedNames.add("l_:_");
qualifiedNames.add("ns:_0");
qualifiedNames.add("ns:a0");
qualifiedNames.add("ns0:test");
qualifiedNames.add("ns:EEE.");
qualifiedNames.add("ns:_-");
qualifiedNames.add("a.b:c");
qualifiedNames.add("a-b:c.j");
qualifiedNames.add("a-b:c");
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
for (int indexN10077 = 0; indexN10077 < qualifiedNames.size(); indexN10077++) {
qualifiedName = (String) qualifiedNames.get(indexN10077);
newDocType = domImpl.createDocumentType(qualifiedName, publicId, systemId);
assertNotNull("domimplementationcreatedocumenttype02_newDocType", newDocType);
ownerDocument = newDocType.getOwnerDocument();
assertNull("domimplementationcreatedocumenttype02_ownerDocument", ownerDocument);
}
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class DocumentCreateAttributeNS method testCreateAttributeNS6.
public void testCreateAttributeNS6() throws Throwable {
Document doc;
Document newDoc;
DocumentType docType = null;
DOMImplementation domImpl;
String namespaceURI = "http://www.w3.org/XML/1998 /namespace";
String qualifiedName = "xml:root";
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "dom:doc", docType);
{
boolean success = false;
try {
newDoc.createAttributeNS(namespaceURI, qualifiedName);
} catch (DOMException ex) {
success = (ex.code == DOMException.NAMESPACE_ERR);
}
assertTrue("documentcreateattributeNS06", success);
}
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class DocumentCreateAttributeNS method testCreateAttributeNS5.
public void testCreateAttributeNS5() throws Throwable {
Document doc;
Document newDoc;
DocumentType docType = null;
DOMImplementation domImpl;
String namespaceURI = null;
String qualifiedName = "abc:def";
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "dom:doc", docType);
{
boolean success = false;
try {
newDoc.createAttributeNS(namespaceURI, qualifiedName);
} catch (DOMException ex) {
success = (ex.code == DOMException.NAMESPACE_ERR);
}
assertTrue("documentcreateattributeNS05", success);
}
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class HCNotationsSetNamedItemNS method testNotationsSetNamedItemNS.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void testNotationsSetNamedItemNS() throws Throwable {
Document doc;
NamedNodeMap notations;
DocumentType docType;
Element elem;
doc = (Document) load("hc_staff", builder);
docType = doc.getDoctype();
if (!(("text/html".equals(getContentType())))) {
assertNotNull("docTypeNotNull", docType);
notations = docType.getNotations();
assertNotNull("notationsNotNull", notations);
elem = doc.createElementNS("http://www.w3.org/1999/xhtml", "br");
try {
notations.setNamedItemNS(elem);
fail("throw_HIER_OR_NO_MOD_ERR");
} catch (DOMException ex) {
switch(ex.code) {
case 3:
break;
case 7:
break;
default:
throw ex;
}
}
}
}
Aggregations