@Test
public void testDOMParse() throws SQLException {
ResultSet rs = getRS();
assertTrue(rs.next());
SQLXML xml = rs.getSQLXML(1);
DOMSource source = xml.getSource(DOMSource.class);
Node doc = source.getNode();
Node root = doc.getFirstChild();
assertEquals("a", root.getNodeName());
Node first = root.getFirstChild();
assertEquals("b", first.getNodeName());
assertEquals("1", first.getTextContent());
Node last = root.getLastChild();
assertEquals("b", last.getNodeName());
assertEquals("2", last.getTextContent());
assertTrue(rs.next());
try {
xml = rs.getSQLXML(1);
source = xml.getSource(DOMSource.class);
fail("Can't retrieve a fragment.");
}
catch (SQLException sqle) {
// Ok
}