I've been working a bit more on this, trying to get the Document type
working with Postgres XML data. I now have code that can extract a Document
from a postgres XML field.
Based on what I have done so far, I do have a couple of questions
concerning the optimal implementation within the context of geotools.

Postgres supports XML Documents and XML fragments. My code currently
supports both, but this requires parsing into a DocumentFragment rather
than a Document.
Many other databases (Oracle, DB2, etc.) only appear to support XML
Documents (not fragments).
Based on the conversation above, would it be better only support XML
Documents (Perhaps requiring a valid schema)?

Since a binding is not defined for the Document, DescribeFeatureType
quietly throws a NPE when given a Document type, and GetFeatureType still
displays the content as a string.


For full XML Support, it seems the following will be required

1. Modify SQLDialect Type Mapping to support the XML type, and map to
Document
2. SQL XML to Document Converter for each database:

   - Java Default: java.sql.SQLXML
   - PostGIS: org.postgresql.util.PGobject
   - Oracle: oracle.xdb.XMLType
   - DB2: com.ibm.db2.jcc.DB2Xml
   - ...

3. GML Type Mapping and Parser for Document

   - Add mapping to buildTypeMappingProfile() in org.geotools.xs.XS.java?


I do not have access to any databases other than PostGIS and Oracle. The
list of databases that we support and which support XML data types is:

   - PostGIS
   - Oracle
   - DB2SQL
   - SpatialLite
   - SQLServer
   - Teradata

Would it be better to write converter code and test cases for all the
databases, but only test Oracle and PostGIS (Such that we ostensibly
support the XML type for all of these databases) or only write the
converter code for Oracle and PostGIS(Such that all code written is
actually tested)

Andrea - You raised a concern about inserting XML data into other output
formats, such as shapefiles, etc. For now, would it be be acceptable to
only support insertion of XML into formats that already have native support
for this type, and insert plain text in all other cases?

Torben
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to