ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS 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
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Import XML Workspace Document

Available with Standard or Advanced license.

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

Summary

Imports the contents of an XML workspace document into an existing geodatabase.

Learn more about copying a schema using XML workspaces

Learn more about Geodatabase XML

Usage

  • The Target Geodatabase parameter value must already exist and can be a personal, file, or enterprise geodatabase. To create an empty geodatabase, use the Create File GDB or Create Personal GDB tool.

  • If you are importing into a file or enterprise geodatabase and want to use a configuration keyword, you can choose one from the Configuration Keyword drop-down list on the tool dialog box. In a Python script, you will need to know the name of the configuration keyword to use.

  • If Overwrite the outputs of geoprocessing operations option on the Geoprocessing Options dialog box is unchecked and a data element from the input XML workspace document has the same name as a data element in the Target Geodatabase parameter value, the data element will be imported with a new unique name. If this option is checked, existing datasets will be overwritten. For more information about overwriting tool output, see Using geoprocessing options to control tool execution.

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

Syntax

arcpy.management.ImportXMLWorkspaceDocument(target_geodatabase, in_file, {import_type}, {config_keyword})
ParameterExplanationData Type
target_geodatabase

The existing geodatabase where the contents of the XML workspace document will be imported.

Workspace
in_file

The input XML workspace document file containing geodatabase contents to be imported. The file can be an .xml file or a compressed .zip or .z file containing the .xml file.

File
import_type
(Optional)

Specifies whether both data (feature class and table records, including geometry) and schema will be imported, or only the schema will be imported.

  • DATA —Data and schema will be imported. This is the default.
  • SCHEMA_ONLY —Only the schema will be imported.
String
config_keyword
(Optional)

The geodatabase configuration keyword to be applied if the Target Geodatabase parameter value is an enterprise or file geodatabase.

String

Derived Output

NameExplanationData Type
out_geodatabase

The updated geodatabase.

Workspace

Code sample

ImportXMLWorkspaceDocument example 1 (Python window)

The following Python window script demonstrates how to use the ImportXMLWorkspaceDocument function in immediate mode.

import arcpy
arcpy.ImportXMLWorkspaceDocument_management("C:/Data/Target.gdb", 
                                            "C:/Data/StJohnsData.xml", 
                                            "SCHEMA_ONLY", "DEFAULTS")
ImportXMLWorkspaceDocument example 2 (stand-alone script)

The following Python script demonstrates how to use the ImportXMLWorkspaceDocument function in a stand-alone script.

# Name: ImportXMLWorkspaceDocument.py
# Description: Import the contents of an XML workspace document into a target 
#              geodatabase. 

# Import system modules
import arcpy

# Set local variables
target_gdb = "c:/data/Target.gdb"
in_file = "c:/data/StJohnsData.xml"
import_type = "SCHEMA_ONLY"
config_keyword = "DEFAULTS"

# Execute ImportXMLWorkspaceDocument
arcpy.ImportXMLWorkspaceDocument_management(target_gdb, in_file, import_type, 
                                            config_keyword)

Environments

  • Current Workspace
  • Scratch Workspace

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics

  • An overview of the Distributed Geodatabase toolset
  • Working with geodatabase replicas

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal