Skip to main content
Solved

XML has no Schema when reading with FeatureReader

  • March 6, 2024
  • 3 replies
  • 156 views

fionasin
Contributor
Forum|alt.badge.img+10

 Hi, 

I am having an issue with feature readers and XML. I have a process which downloads an XML file from an ftp site, and the file name changes daily.  Upon download, I am trying to trigger a second process which reads the downloaded xml, so I can then split it into separate records (hence why reading in as text will not work, as I need the xml fragments). I use a path reader, to get the file name, but when I put ‘Path_Windows’ as the dataset, i get this error: 

error message

 

 

If I choose to ignore the message, and run to the featurereader, It reads in the correct amount of records (59), but the schema is blank. 

Blank Schema

 

Log Error message

 

 

 

Now, i know for a fact that my xml does in fact, have a schema, because if I hard code the file name in the feature reader, it works perfectly fine. (see below)

 

 

 

FeatureReader with hard coded file name
Successfully read

 

The parameters are identical on both. 

 

FeatureReader Parameters

 

 

I am at a total loss as to why when I want to put in a dynamic file name, the whole process falls over. If I was just writing the xml out, I would read it in as a txt file as a work around, but because I need to process the xml a certain way, i need those xml fragments in order to get my desired output. 

 

 

I am in no way an xml expert, so any help would be appreciated!

 

 

 

 

FME(R) 2021.2.6.0 (20220727 - Build 21821 - WIN32)

 

 

 

 

 

 

 

 

Best answer by nielsgerrits

This is because, if you use a dynamic filename, the schema is unknown. You can use an AttributeExposer to expose the unexposed attributes. You can simply choose import, import from feature cache.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+62
  • Best Answer
  • March 6, 2024

This is because, if you use a dynamic filename, the schema is unknown. You can use an AttributeExposer to expose the unexposed attributes. You can simply choose import, import from feature cache.


fionasin
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • March 6, 2024

This is because, if you use a dynamic filename, the schema is unknown. You can use an AttributeExposer to expose the unexposed attributes. You can simply choose import, import from feature cache.

 

Thank you so much! I exposed the xml_fragment from the cache, and this has worked perfectly :) 

 


nielsgerrits
VIP
Forum|alt.badge.img+62

Cheers :)

In my opinion, FME works best with 2 screens. One for the workflow, one for the results. Then the log is not hidden behind the visual preview window and when you select a feature, you can see the unexposed attributes in the Feature Information window.

You can configure this via Tools, FME Options, Data Inspection, Inspect with Data Inspector when Visual Preview window closed.