use of org.apache.axiom.om.OMDocType in project webservices-axiom by apache.
the class DialectTest method testDTD.
/**
* Tests that Axiom is able to read a DOCTYPE declaration. Since accessing the information in
* the DOCTYPE declaration is not standardized by the StAX specification, this will fail if the
* StAX dialect is not detected correctly.
*
* @throws Exception
*/
@Test
public void testDTD() throws Exception {
OMDocument document = OMXMLBuilderFactory.createOMBuilder(new StringReader("<!DOCTYPE root><root/>")).getDocument();
OMDocType dtd = (OMDocType) document.getFirstOMChild();
assertEquals("root", dtd.getRootName());
}
Aggregations