ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Export XML Workspace Document

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Creates a readable XML document of the geodatabase contents.

The XML Workspace Document is useful for sharing geodatabase schemas or copying geodatabase schemas from one type to another.

  • Learn more about copying a schema using XML workspaces
  • Learn more about Geodatabase XML

Usage

  • The output can be created as an XML file or as a compressed ZIP file that contains the XML file. To create an XML file, give the output file name a .xml extension. To create a compressed ZIP file, give the output file name a .zip or .z extension.

  • Caution:
    The output XML workspace document can be very large when you copy both the data and the schema. Generally, this alternative is not recommended for copying geodatabase data. Alternatives for making a geodatabase copy include the use of the Copy tool or the Clip tool to extract subsets of the data. In addition, tools in the Package toolset provides tools to consolidate, package, and share layers, map documents, address locators, and geoprocessing results.
  • If the input is a geodatabase or a feature dataset, all data elements contained within that workspace are exported. If you only want to export a subset of data elements to an XML file, you will need to copy them to a new geodatabase to be exported.

  • If you export a feature class in a network, topology, relationship class, or terrain, all the feature classes participating in the network, topology, relationship class, or terrain are also exported.

  • The tool messages will include the list of data element names that were exported.

Syntax

ExportXMLWorkspaceDocument_management (in_data, out_file, {export_type}, {storage_type}, {export_metadata})
ParameterExplanationData Type
in_data

The input datasets to be exported and represented in an XML workspace document. The input data can be a geodatabase, feature dataset, feature class, table, raster, or raster catalog.

Feature Class; Feature Dataset; Raster Dataset; Table; Workspace
out_file

The XML workspace document file to be created. This can be an XML file (.xml) or a compressed ZIP file (.zip or .z).

File
export_type
(Optional)

Determines if the output XML workspace document will contain all of the data from the input (table and feature class records, including geometry) or only the schema.

  • DATA —Export both the schema and the data. This is the default.
  • SCHEMA_ONLY —Export the schema only.
String
storage_type
(Optional)

Determines how feature geometry is stored when data is exported from a feature class.

  • BINARY —Store geometry in a compressed base64 binary format. This binary format will produce a smaller XML workspace document. Use this option when the XML workspace document will be read by a custom program that uses ArcObjects. This is the default.
  • NORMALIZED —The geometry will be stored in an uncompressed format, resulting in a larger file. Use this option when the XML workspace document will be read by a custom program that does not use ArcObjects.
String
export_metadata
(Optional)

Determines if metadata will be exported.

  • METADATA —If the input contains metadata, it will be exported. This is the default.
  • NO_METADATA —Do not export metadata.
Boolean

Code sample

ExportXMLWorkspaceDocument example 1 (Python window)

The following Python window script demonstrates how to use the ExportXMLWorkspaceDocument tool in immediate mode.

import arcpy 
arcpy.ExportXMLWorkspaceDocument_management("c:/data/StJohns.gdb", "c:/data/StJohns.xml","SCHEMA_ONLY", "BINARY", "METADATA")
ExportXMLWorkspaceDocument example 2 (stand-alone script)

The following Python script demonstrates how to use the ExportXMLWorkspaceDocument tool in a stand-alone script.

# Name: ExportXMLWorkspaceDocument.py
# Description: Exports the contents of my geodatabase to an XML workspace document. 

# Import system modules
import arcpy

# Set local variables
in_data = "c:/data/StJohns.gdb"
out_file = "c:/data/StJohns.xml"
export_option = "SCHEMA_ONLY"
storage_type = "BINARY"
export_metadata = "METADATA"

# Execute ExportXMLWorkspaceDocument
arcpy.ExportXMLWorkspaceDocument_management(in_data, out_file, export_option, storage_type, export_metadata)

Environments

  • Current Workspace
  • Scratch Workspace

Licensing information

  • ArcGIS for Desktop Basic: No
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal