Solved

Extract a list of attributes using XMLFragmenter

  • 19 September 2018
  • 4 replies
  • 12 views

Badge +1

I have an XML extract using a Soap interface that has a section with lists of user defined attributes. I have a schema for these but I am having trouble extracting the contents. I expect to be able to rename the fields based on the order after extraction.

For example in the IDENTIFICATION path there are UserFields{1} to {5} that I want to extract and label like this

1 Manufacturer No Alphanumeric 40 2 Manufacture_Date No Date 11 3 Model_Number No Alphanumeric 40 4 Make No Alphanumeric 40 5 Serial_Number No Alphanumeric 40
icon

Best answer by takashi 19 September 2018, 09:12

View original

4 replies

Userlevel 2
Badge +17

Hi @kimo, if the order of list elements is fixed, you can rename the individual list elements to desired attribute names with the AttributeRenamer.

Badge +1

Thanks. I have painfully exposed each list item in the XMLFragmenter and renamed them in AttributeManager (20 total). [I see a long standing Idea to allow importing attributes to be exposed has not been implemented. (minor grumble)]. Not much chance of generalising this workflow with parameters and variables.

But now the values have not been preserved.... I added a BulkAttributeRenamer to strip off the prefix but that did not help either. Before the AttributeManager is OK. I will try an AttributeRenamer, but surely it is the same function underneath?

Userlevel 2
Badge +17

Thanks. I have painfully exposed each list item in the XMLFragmenter and renamed them in AttributeManager (20 total). [I see a long standing Idea to allow importing attributes to be exposed has not been implemented. (minor grumble)]. Not much chance of generalising this workflow with parameters and variables.

But now the values have not been preserved.... I added a BulkAttributeRenamer to strip off the prefix but that did not help either. Before the AttributeManager is OK. I will try an AttributeRenamer, but surely it is the same function underneath?

Check if the exposed list names are correct using the Logger or FME Data Inspector.

 

 

Badge +1

I did get the attributes I wanted using an AttributeRenamer. The data returned has all the interesting attributes in user_fields which is returned as a variable length list depending on the asset. So I will need a test filter to split the Renamers based on the attribute type. In Esri terms the attributes have been implemented as sub-classes where the schema varies for each asset type, but the master asset table or layer only has common attributes such as id, type and dates. This is better than trying to expose the attributes in the XMLFragmenter because it does not even have an import button and the numbers vary. Perhaps I can generalise the Renamer further with a SchemaMapper? However this interface is so slow the alternative of a direct database connection now looks more attractive so that is what I have switched to. Unfortunately the field names are imbedded in the application logic, not the database schema.

Reply