// "It is an error for a fragment identifier
// (beginning with a # character)
// to be part of a system identifier."
try {
new DocType("test", "http://www.example.com/index.html#test");
fail("Allowed system ID with fragment identifier");
}
catch (IllegalDataException success) {
// successfully detected bad system ID
assertNotNull(success.getMessage());
}
try {
new DocType("test", "http://www.example.com/index.html#");
fail("Allowed # in system ID");
}
catch (IllegalDataException success) {
// successfully detected bad system ID
assertNotNull(success.getMessage());
}
try {
new DocType("test", "http://www.example.com/\u00A9.html#");
fail("Allowed non-ASCII character in system ID");
}
catch (IllegalDataException success) {
// successfully detected bad system ID
assertNotNull(success.getMessage());
}
try {
new DocType("test", "http://www.example.com/\u0007.html#");
fail("Allowed C0 control character in system ID");
}
catch (IllegalDataException success) {
// successfully detected bad system ID
assertNotNull(success.getMessage());
}
try {
new DocType("test", "test\" and ' in the same ID");
fail("Allowed both \" and ' in system ID");
}
catch (IllegalDataException success) {
// successfully detected bad system ID
assertNotNull(success.getMessage());