Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I don't know if it is a bug or my lack of python skills, but I keep getting 'ERROR 000816 The tool is not valid' in my python script when I call ExportMetadata_conversion

Initially, I was attempting this on an sde database, but then I tried to take a step back just match the example in the documentation and use a file geodb:

import arcpy
from arcpy import env
env.workspace = "C:/data"
#set local variables
dir = arcpy.GetInstallInfo("desktop")["InstallDir"]
translator = dir + "Metadata/Translator/ESRI_ISO2ISO19139.xml"
arcpy.ExportMetadata_conversion ("data.gdb/roads", translator, 
    "roads_19139.xml")

But I received the same error.

Is anyone successfully calling this method? If so, does your code match the documentation?

share|improve this question
    
I used the code sample you posted above and just substituted my data. It ran fine and generated the output xml file. I'm running ArcInfo 10 on XP. –  Zachary Sep 22 '10 at 13:47
    
Did you ever resolve the above issue with ESRI? I'm getting the same error! Thanks, Frank –  user5139 Dec 13 '11 at 16:37
    
I ended up using @Kenton Williams answer. No resolution with Esri apart from a bug ID, which I don't have (this was logged at my previous employer and I didn't keep the ID). –  Jay Cummins Dec 13 '11 at 18:51
add comment

2 Answers 2

up vote 3 down vote accepted

I've had better success using the XSLTransform_conversion operation in my Python geoprocessing scripts. There are a few ESRI-supplied XSL files in the C:\Program Files\ArcGIS\ArcToolBox\Stylesheets directory (on a 32-bit machine). Here's an example of the line using the XSL transform I used in a python script I published to ArcGIS Server:

results = gp.XSLTransform_conversion(inputFC, xslFile, outputFileName)

This returns a formatted file. I chose to have HTML as an output, but it will output XML if you want.

share|improve this answer
add comment

Python Errors in IDLE, but Works in ArcCatalog???

You need to use GacUtil to register the DLL's properly for Metadata so that ArcPy can use them. All instructions are in the ArcGIS forum post link above.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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