Skip to main content
Solved

Convert multiple XMLs at once


vilemrousi
Contributor
Forum|alt.badge.img+1

Hello,

 

I am struggling with conversion of several thousands of XML files (same scheme, but different attributes) in to single Excel/CSV

The tool works fine for single XML but not for multiple at once,

The XML has nested levels so I am using xml_Id and xml_parent_id to navigate thru and join tohether with featurMerger tool.

This is on the other hand the reason why I am struggling with the batch processing - since when  multiple files are processed at once, the xml_parent_id is the same among files and the so data are ovewriting themself, or they are rejected in the feature merge with multi-reference error.
 

Don’t you know if there os a way how to proceed? To run one by one, for example with Loop in ArcGIS works but it’s soooo slow.

 

Thank you!

 

 

Best answer by s.jager

That’s strange. That ‘Additional attributes to expose’ dialog should be listing a bunch of things, in a FeatureReader and in a regular Reader:

How exactly are you reading your xml’s? Because I’m getting this….

 

And prefixing the fme_basename to create a new ID is easy, just use the AttributeCreator. Or, if you want to be specific, a StringConcatenator. 

View original
Did this help you find an answer to your question?

8 replies

nielsgerrits
VIP
Forum|alt.badge.img+53

Also use filename in the featuremerger if that makes it unique.


s.jager
Influencer
Forum|alt.badge.img+16
  • Influencer
  • August 3, 2024

To expand a bit on what Niels said: Expose the fme_basename attribute, then create new xml_id's and xml_parent_id’s by prefixing the fme_basename. If the filenames are unique, then that should create completely unique ID’s.

Also: I’ve found myself moving away from the FeatureMerger in favor of the FeatureJoiner more and more, because sometimes I do have duplicates and still want them merged with other features, but not necessarily in lists. Might also help.


vilemrousi
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 3, 2024

Hello @nielsgerrits, Hello @s.jager,

thank you for replies! Sorry, to ask, but don´t you know where to find this fme_basename? I was checking the “additional attributes to expose” but it´s empty.

 

@s.jager, for the calculation, do you use “Expression Evaluator” Or another? 

 

 

Thank you


nielsgerrits
VIP
Forum|alt.badge.img+53

It is deep in the featurereaders parameters.  Additional attributes to expose. On mobile so no screenshots or samples, sorry.


s.jager
Influencer
Forum|alt.badge.img+16
  • Influencer
  • Best Answer
  • August 5, 2024

That’s strange. That ‘Additional attributes to expose’ dialog should be listing a bunch of things, in a FeatureReader and in a regular Reader:

How exactly are you reading your xml’s? Because I’m getting this….

 

And prefixing the fme_basename to create a new ID is easy, just use the AttributeCreator. Or, if you want to be specific, a StringConcatenator. 


vilemrousi
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 5, 2024

Hello @s.jager, thank you! 

 

As a reader I´ve used the XSD-driven XML in The Reader, I think nothing special :/


s.jager
Influencer
Forum|alt.badge.img+16
  • Influencer
  • August 5, 2024

Hmmm. I’ve never used the XSD-Driven XML Reader, but when I try that it does leave the ‘Additional attributes to expose’ dialog blank. 

Maybe try the regular XML Reader? That will also allow you to specify an XSD, if you need that.


vilemrousi
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 5, 2024

Hello @s.jager,

with XML input it works fine - I had to make it from scratch but now it seems to work!

 

Thank you for help @s.jager, @nielsgerrits.


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