Question

Read the header of an xml/gml file

  • 9 February 2022
  • 3 replies
  • 7 views

Badge

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

Userlevel 4
Badge +30

Hi @so_much_more​ 

 

Please, could you share your data?

 

 

Thanks in Advance,

Danilo

Userlevel 6
Badge +32

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.

Userlevel 2
Badge +17

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

<\\?.+?\\?>

Reply