Question

Transform multiple metadata .xml files to excel


Through the ArcGIS Pro ArcPy, I have used the "ExportXMLWorkspaceDocument_management" method to loop through multiple geodatabases and export the metadata of individual feature classes. now I would like to transform those into more readable excel files. The xml files are structured according to ISO19139 standard. Any tip would be appreciated, even an entirely different workflow.


11 replies

Badge +21

Hi @moshka - can you provide a sample XML? Have you tried the regular XML-reader in FME and does that work?

Badge +3

Instead of going down the XML route, you could use the Schema (Any Format) Reader, and get lots of information about your feature classes in your geodatabases as well. Maybe it doesn't give you the metadata that you're after, in which case this kite doesn't fly. At the same time it might give you a much easier route to what you're after than getting lost in the intricacies of XML.

Instead of going down the XML route, you could use the Schema (Any Format) Reader, and get lots of information about your feature classes in your geodatabases as well. Maybe it doesn't give you the metadata that you're after, in which case this kite doesn't fly. At the same time it might give you a much easier route to what you're after than getting lost in the intricacies of XML.

Thanks, I will try that

Hi @moshka - can you provide a sample XML? Have you tried the regular XML-reader in FME and does that work?

Thanks @sigtill , I am afraid I can't publish the data, but I could generate an xml for another open dataset and post it. I have tried the reader but I get this in the log: "Unable to recognize the source dataset as an ADAC file, UniversalReader -- readSchema resulted in 0 schema features being returned".

Badge +21

Thanks @sigtill , I am afraid I can't publish the data, but I could generate an xml for another open dataset and post it. I have tried the reader but I get this in the log: "Unable to recognize the source dataset as an ADAC file, UniversalReader -- readSchema resulted in 0 schema features being returned".

Hi @moshka Are you using the ADAC READER? or the XML reader? There are different

 

 

Or the XML Reader?

 

Hi @moshka - can you provide a sample XML? Have you tried the regular XML-reader in FME and does that work?

Hi @sigtill, the error resulted from using the "Schema (Any Format) Reader", then I tried the XML (Extensible Markup Language) and also got an error that I should add "Elements to Match" parameter". I am not sure what that means. I have attached the latter error log log.txt. I probably need to read some documentation about such process, but I don't seem to find such resources, and don't know how to proceed.

Hi @moshka - can you provide a sample XML? Have you tried the regular XML-reader in FME and does that work?

Hey @sigtill, I was able to parse the needed metadata element from the XML as a feature type. now used the attributeExposer and can see that most of the useful info is in a XmlDoc subtype/tag. If I could parse that and write to and excel it would solve my issues

Userlevel 1
Badge +10

Not the answer to your question, but might be useful in the future - you can read metadata by setting the geodatabase parameter Feature Read mode to 'Metadata'. This returns the xml

Badge +3

Thanks @sigtill , I am afraid I can't publish the data, but I could generate an xml for another open dataset and post it. I have tried the reader but I get this in the log: "Unable to recognize the source dataset as an ADAC file, UniversalReader -- readSchema resulted in 0 schema features being returned".

@moshka: You're so close!!! When using the Schema (Any Format) Reader, you still need to specify the type of your input data, which should be File Geodb (or File Geodb Open API for those without ArcGIS). It must somehow have picked ADAC (or was it ACAD?) instead!

Not the answer to your question, but might be useful in the future - you can read metadata by setting the geodatabase parameter Feature Read mode to 'Metadata'. This returns the xml

@ebygomm, thanks for your comment, I have just tried that, but I seem to stagnate at the same point, and that is the geodb_metadata_string element. when I used the the xml reader, the same part was mapped to an xmlDoc tag. it also includes a binary for the thumbnail. I need to be able to decompose this xml bit into a table and extract the thumbnail as well, but I can't find out how to do that. I have attached an image of the last bit of that string:

 

Userlevel 1
Badge +10

@ebygomm, thanks for your comment, I have just tried that, but I seem to stagnate at the same point, and that is the geodb_metadata_string element. when I used the the xml reader, the same part was mapped to an xmlDoc tag. it also includes a binary for the thumbnail. I need to be able to decompose this xml bit into a table and extract the thumbnail as well, but I can't find out how to do that. I have attached an image of the last bit of that string:

 

Have you looked at the xml flattener?

Reply