Skip to main content
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

sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • February 12, 2020

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


arnold_bijlsma
Enthusiast
Forum|alt.badge.img+14

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.


  • Author
  • February 13, 2020
arnold_bijlsma wrote:

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


  • Author
  • February 13, 2020
sigtill wrote:

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".


sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • February 13, 2020
abjad wrote:

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?

 


  • Author
  • February 13, 2020
sigtill wrote:

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.


  • Author
  • February 13, 2020
sigtill wrote:

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


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • February 13, 2020

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


arnold_bijlsma
Enthusiast
Forum|alt.badge.img+14
abjad wrote:

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!


  • Author
  • February 14, 2020
ebygomm wrote:

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:

 


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • February 14, 2020
abjad wrote:

@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?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings