1

Is it possible to only export only some feature classes when exporting a workspace to an XML document?

I know that when I am in ArcCatalog, I can right click my database --> Export XML Workspace Document. Then a GUI shows up and I can check-mark which features I want to include or exclude in my export.

What is the Arcpy equivalent of this manual export?

I found arcpy.ExportXMLWorkspaceDocument_management(...) function but the in_data parameter only seems to let me enter one feature class. It does not accept an array ["feature1", "feature2"].

I found this question using ArcObjects: How to export only some feature classes to xml using ArcObjects? But I am not familiar with ArcObjects and am hoping to write this script in Python.

1

I do this as a two step process, i.e. export the layers to another geodatabase and then create the xml of the minimised content from that. I know it is long winded, but it is a work around.

  • 1
    In the tool help resources.arcgis.com/en/help/main/10.2/index.html#//… it says to do it this way, can you include this link and/or add a quote from the help document to support your answer then I can be comfortable upvoting it. Thanks. – Michael Stimson Oct 8 '18 at 22:51
  • Ahh I see, so this function will not do subsets. How is it that this is possible using the ArcCatalog GUI? Do you happen to know what function ArcCatalog is calling when I do the manual export? – siushi Oct 9 '18 at 9:34
  • No it wont do subsets, I've tried lists and tuples, relative paths and absolute paths and have concluded you can export only one element be it geodatabase, feature class or feature dataset. If you supply a geodatabase or feature dataset all the feature classes contained will be exported. Internally the XML export will be calling the function shown in your code sample IGdbXmlExport resources.arcgis.com/en/help/arcobjects-net/componenthelp/…, similar to edndoc.esri.com/arcobjects/9.2/NET/… – Michael Stimson Oct 10 '18 at 0:45
  • Thanks for the answer and additional resources! – siushi Oct 11 '18 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.