Geodatabase extensible markup language (XML) represents Esri's open mechanism for information interchange between geodatabases and other external systems. Esri openly publishes and maintains the complete geodatabase schema and content as an XML specification and provides example implementations to illustrate how you can share data updates between heterogeneous systems.
XML interchange of geospatial information to and from the geodatabase is greatly simplified using the geodatabase XML specification. External applications can receive XML data streams including:
- Exchange and sharing of full (as well as portions of) geodatabase schemas
- Exchange of complete lossless datasets
- Interchange of simple feature sets (much like shapefile interchange)
- Exchange of change-only (delta) record sets using XML streams to pass updates and changes among geodatabases and other external data structures
Geodatabase XML is the primary interchange mechanism for data sharing among ArcGIS users as well as external users.
To access a white paper on the geodatabase XML schema, see XML Schema of the Geodatabase.
There are three types of XML documents that can be created in ArcGIS: a Workspace document, a RecordSet document, and a Data Changes document.
The geodatabase XML workspace document
XML workspace documents hold all of the contents of a geodatabase or any subset of the content. XML workspace documents include all of the schema information and optionally the data as well.
XML workspace documents are used to share schema information, to exchange feature datasets and all of their contents, and to exchange datasets and all associated data elements that have relationships to a dataset selected for export.
The schema, relationship, and behavior information exported as part of the WorkspaceDefinition section includes all simple and custom features data, participation in networks and topologies, network connectivity and topology rules, simple and composite relationships, and any other information associated with the geodatabase datasets. Therefore, all behavior associated with the geodatabase is preserved and can be re-created when the XML document is imported.
The XML workspace document contains two elements: WorkspaceDefinition and WorkspaceData.
Using the WorkspaceDefinition and WorkspaceData, workspace documents contain the schema of a geodatabase and, optionally, data from its tables. Having the definition separated from the actual data offers a few benefits. A software agent can read only the definition section of the document to discover what it contains, and by making the data section optional, a workspace document can be used to transfer only schema information.
In the case of tables and feature classes, the name of the data element in the definition section corresponds to the name of the table data in the data section. Other datasets, such as topologies, geometric networks, or feature datasets, appear only in the definition section (no data is exported for them).
The geodatabase RecordSet document
The geodatabase RecordSet document is used to export the rows from a single feature class or table as simple features or attribute records.
Exporting to a RecordSet document is analogous to exporting to a shapefile. The rows are exported as records, and no additional geodatabase-related information is written to the output file.
For example, topologies and other feature dataset information is not exported. Relationships to features in other tables is not exported.
The geodatabase XML Data Changes document
As part of geodatabase transaction and version management, you may want to share and work with change-only record sets. The XML Data Changes document is used to share changes or updates among geodatabases and between the geodatabase and external systems. It does this by only distributing changes that can be tracked in the geodatabase using versioning.
The ArcGIS disconnected editing framework allows you to check data out of a database into a separate geodatabase, then edit the data without having a live connection to the parent database. Once the editing is done, it is possible to export only the changes (not all the data) to an XML file. This file can be used to subsequently check in the changes to the parent database.
This is also a key part of geodatabase replication.
The primary information of a Data Changes document is an UpdateGram in which only changes are delivered as part of the XML document.
Using geodatabase XML in ArcGIS Desktop and Geoprocessing
ArcGIS Desktop and the geoprocessing framework in ArcGIS contain a number of functions to import and export geographic data. Some typical tasks that you can perform in ArcGIS with Geodatabase XML include the following:
- Share geodatabases using XML.
- Copy whole geodatabases or subsets such as feature datasets and all related information sets.
- Copy individual tables or rasters.
- Synchronize the contents across multiple geodatabase replicas.
For example, using ArcCatalog or the Catalog window in ArcMap, you can right-click a geodatabase or feature dataset in the catalog tree and create an XML Workspace Document. The XML Workspace Document can be used to share a geodatabase schema or to copy the contents, rules, objects, and behaviors to another geodatabase.
Using geoprocessing in ArcGIS, you can perform a number of operations to synchronize and share changes across geodatabases.