I am new to lists and xml in FME and having a bit of trouble. I am trying to use the XMLTemplater to populate an XML tag using a list value.
My XML template looks like this:
<prompt>{fme:get-attribute("prompt")}</prompt>
<output>{fme:get-attribute("output")}</output>
<data>
{
for $testcount in fme:get-list-attribute("itemlist{}")
return <item>{$testcount}</item>
}
</data>
Test count is the output of a list element counter, and itemlist is a list attribute of the items.
My output looks like this:
<prompt>Material</prompt>
<output>Survey Attributes/Material</output>
<data>
</data>
There are no contents being created within the data tag.
I am trying to get it to output like this:
<prompt>Material</prompt>
<output>Survey Attributes/Material</output>
<data>
<item>Concrete</item>
<item>Steel</item>
<item>Timber</item>
</data>
The help guide gives an example of this:
<roads>
{
for $road_id in fme:get-list-attribute("road_ids{}")
return <road id="{$road_id}"/>
}
</roads>
I am just a bit confused what attributes get defined to make these list elements populate in the xml.
In the example, is $road_id a list element counter attribute, or is this something else?
Any help is appreciated.


