Hi everybody. Trying to "stamp" (term I made up - makes sense?) metadata in feature classes within file geodatabase utilizing arcpy functionality in Pro - looping through an entire gdb, so many fcs.
I am cannibalizing pieces from this script: . esri forum metadata post. Note that I am NOT interested in the Thumbnail portion, just basic workflow to update Item Description via: 1) pull xml from feature classes within gdb 2) update a handful of xml elements (abstract, purpose, credits, etc.) in xml 3) update xml in gdb. I am utilizing xmltree and pandas dataframes in Python scripts for the workflow FYI.
My dumbed-down pseudocode is as follows:
fcs = 'path/to/feature_class'
# below line yields - 'C:\Program Files\ArcGIS\Pro'
dir = arcpy.GetInstallInfo('desktop')['InstallDir']
# but exact copy of.xslt is NOT here - can be found in desktop folder
copy_xslt = r'{0}'.format(os.path.join(dir,'Metadata\Stylesheets\gpTools\exact copy of.xslt'))
# temporary XML file
xml_file = arcpy.CreateScratchName('.xml',workspace=arcpy.env.scratchFolder)
xml_file = 'name.xml'
XSLTransform_conversion(fcs, copy_xslt, xml_file,'')
arcpy.MetadataImporter_conversion(xml_file, fcs)The main thing confusing me is that
dir = arcpy.GetInstallInfo('desktop')['InstallDir']YIELDS: C:\Program Files\ArcGIS\Pro\Resources\Metadata\Stylesheets but does NOT have the "exact copy of.xslt". If I go 'C:\Program Files (x86)\ArcGIS\Desktop10.6\Metadata\Stylesheets' then it exists. However the online documentation indicates that the Pro file ...Stylesheets subdirectory should have that file. Any idea why I don't have it and should I be concerned? I will basically just hardcode the file path the xslt file while running scripts via Pro.