1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/XmlFormatter.java Sun Aug 30 02:28:15 2015 +0200
1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/XmlFormatter.java Sun Sep 06 21:46:03 2015 +0200
1.3 @@ -26,6 +26,7 @@
1.4 import static info.globalcode.sql.dk.formatting.AbstractXmlFormatter.qname;
1.5 import java.sql.Array;
1.6 import java.sql.SQLException;
1.7 +import java.sql.SQLXML;
1.8 import java.util.LinkedHashMap;
1.9 import java.util.List;
1.10 import java.util.Map;
1.11 @@ -174,6 +175,15 @@
1.12 writeColumnValue(String.valueOf(value));
1.13 }
1.14
1.15 + } else if (value instanceof SQLXML) {
1.16 + SQLXML xml = (SQLXML) value;
1.17 + // TODO: parse DOM/SAX and transplant XML, don't escape (optional)
1.18 + try {
1.19 + printTextElement(qname("column"), attributes, xml.getString());
1.20 + } catch (SQLException e) {
1.21 + log.log(Level.SEVERE, "Unable to format XML", e);
1.22 + writeColumnValue(String.valueOf(value));
1.23 + }
1.24 } else {
1.25 printTextElement(qname("column"), attributes, toString(value));
1.26 }