I am receiving a directory of XML files with the same schema. I am able to correctly import a single file by explicitly stating the XML Child Element Name needed to identify the correct grouping of data that will eventually correspond to a table. That works for a single file but how to work through the entire directory? I have attempt to use the Dynamic Input, with XML Child Element Name explicitly stated in the configuration, fed by a Directory tool, but I get a message that the schema has changed. I do not believe the schema is actually different but the Dynamic Input isn't capturing the correct child element after the first file. Do I need to somehow append the Child Element Name to the file name? Thinking something similar to an excel file name/ sheet name. Is this something the Dynamic Input tool cannot handle and I would be better served using a batch macro?
Solved! Go to Solution.
I have attempted to use the batch macro attached below as an alternative to the dynamic input tool . Appending after my directory tools well. Unfortunately I am unable to attach a copy of the xml data. The child element that I am targeting is the name of a table not a single field. The batch macro runs without error but no data is returned instead showing the following message:
Looks like the macro is exiting without moving on to the second file?
Did you connect anything after the batch macro? If it doesn't have anywhere to send the data (like a browse tool), it will just stop.
Yes! That was the piece that I was missing. It makes sense that the batch macro needs an output to write to. I'm still not sure why the dynamic input approach did not work but the batch macro was quite simple