I believe I solved this problem. Although it took some time, the answer turned out to be fairly simple so I thought I'd share for those who are interested.These XML's are in FGDC standard. The code will allow you to edit the XML so that when you import the XML as metadata into a FC, it will change the format in the ArcCatalogue metadata editor, Time Period tab(9.3) from a range of dates to multiple dates. You can also change it to single dates, but you will need to export a FC's metadata that contains single dates to see how the tabs are set up and then you can edit the code accordingly.If you want to be ambitious, you can set python code to create a whole XML document that populates metadata which you can upload into feature classes. Great for batch processing metadata!The code that worked for me is as follows:
# Set workspace location for XML files
folderPath = "Z:\ESRI\Figure_Sourcing\Figures\Metadata\IOR_Run_Metadata_2009"
# Loop through each file and search for files with .xml extension
for filename in glob.glob(os.path.join(folderPath, "*.xml")):
fullpath = os.path.join(folderPath, filename)
# Split file name from the directory path
if os.path.isfile(fullpath):
basename, filename2 = os.path.split(fullpath)
# Set variable to XML files
root = ElementTree(file=r"Z:\ESRI\Figure_Sourcing\Figures\Metadata\IOR_Run_Metadata_2009\\" + filename2)
# Set variable for iterator
iter = root.getiterator()
#Iterate through the tags in each XML file
for element in iter:
if element.tag == "timeinfo":
tree = root.find(".//timeinfo")
# Clear all tags below the "timeinfo" tag
tree.clear()
# Append new Element
element.append(ET.Element("mdattim"))
# Create SubElements to the parent tag
child1 = ET.SubElement(tree, "sngdate")
child2 = ET.SubElement(child1, "caldate")
child3 = ET.SubElement(child1, "time")
# Set text values for tags
child2.text = "08-24-2009"
child3.text = "unknown"