Skip to main content
Question

Read the header of an xml/gml file


so_much_more
Supporter
Forum|alt.badge.img+6

I want to check the header for information in a manual validation step for a xml/gml file. But it does not seem possible to extract the header information using the xmlFlattener for examle, just the dataset.

Is it possible to extract certain keys from the header? I want to check for the encoding tag for validation.

3 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • February 9, 2022

Hi @so_much_more​ 

 

Please, could you share your data?

 

 

Thanks in Advance,

Danilo


nielsgerrits
VIP
Forum|alt.badge.img+54

One way to do this is to read the first line using the Text File reader. (FeatureReader, Max Features to Read = 1)

Then split the text line containing the header based on a space. (AttributeSplitter)

Next find the list index where the list contains "encoding". (ListSearcher, regex, search for encoding).

Extract that element to attribute (ListIndexer) and go from there.


takashi
Influencer
  • February 11, 2022

A possible way is to use StringSearcher with this regular expression.

<\\?.+?\\?>


Reply


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