* Tests included DTD.
* @throws Exception exception
*/
@Test
public void test_dtd_valid_xml_three() throws Exception {
Validator validator = getValidator("sw-config-xmlv-dtd-two.xml");
String source = "<!DOCTYPE nn:memo ["
+ "<!ELEMENT nn:memo (nn:to,nn:from,nn:body)>"
+ "<!ATTLIST nn:memo xmlns:nn CDATA #FIXED \"urn:switchyard-quickstart:dtd-example:0.1.0\">"
+ "<!ELEMENT nn:to (#PCDATA)>"
+ "<!ELEMENT nn:from (#PCDATA)>"
+ "<!ELEMENT nn:heading (#PCDATA)>"
+ "<!ELEMENT nn:body (#PCDATA)>"
+ "]>"
+ "<nn:memo xmlns:nn=\"urn:switchyard-quickstart:dtd-example:0.1.0\">"
+ "<nn:to>Garfield</nn:to>"
+ "<nn:from>Odie</nn:from>"
+ "<nn:body>I love lasagna!</nn:body>"
+ "</nn:memo>";
ValidationResult result = validator.validate(new DefaultMessage().setContent(source));
if (!result.isValid()) {
Assert.fail(result.getDetail());
}
Assert.assertNull(result.getDetail());
}