Skip to main content
Solved

XML has no Schema when reading with FeatureReader


fionasin
Contributor
Forum|alt.badge.img+7

 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.

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

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+54
  • 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+7
  • Author
  • Contributor
  • March 6, 2024
nielsgerrits wrote:

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+54

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.


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