Question

Reading GML data comes into FME as strings rather than from xsd file

  • 9 May 2023
  • 1 reply
  • 2 views

Hello,

 

I am trying to load in my gml data, however all attributes are coming into FME as data type strings, when i have even set the parameter obtain data types from xsd schema.

 

I have also tried the xml validator and this thinks that all attributes are strings.

 

Thanks,

 

@Takashi Iijima​ @mark2atsafe​ 


1 reply

Badge +3

Thanks for your question about GML schema. In general, FME reads data types as part of the schema stored within the source and destination feature type definitions. As with most other formats in FME, the reader reads schema as schema features, which are then captured within the feature type definitions, while the data features are typically read as strings. Then when it comes to interpreting a feature at write time, the feature type definition is used to interpret the data feature in terms of the schema. Transformers within a workspace simply try to interpret each attribute as needed for the specific function - so a string '123' can be interpreted as a number in order to do some arithmetic.

 

When you say that all the attributes are coming in as data type strings, are you talking about the data as it shows up in Data Inspector / Logger midstream in your workspace, or are you talking about the source and destination feature types? If all the fields show up as buffer or string in the feature type then that would be a bug. As you can see from the INSPIRE parcels example below, FME does read the different datatypes from the schema and store them in the feature type. Here you can see date, boolean, int, real and buffer field data types.

 

imageNote that in FME 2023.0 you might notice that the AttributeManager has a new data type column. This detects schema from features and lets you control how they are interpreted. I tested this with GML input and it does in fact pick up the schema that you see on the source feature type. So if you need to control or change the data type interpretation within your workspace, you might want to check out FME 2023+.

 

For more on how FME handles data types particularly on readers and writers see: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Desktop/!FeatureTypeProperties/FME-Data-Types.htm

Reply