Skip to main content

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!

 

 

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


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.


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


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


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. 


Hello @s.jager, thank you! 

 

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


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.


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.


Reply