Hi, Im using an XML templates with a geometry template.
I have a for loop and I have my positions in a list attribute.
Whenever I use the variable for the indices fme:get-attribute("_Positions{$i}.y") I get no results but if I use the same value that is in $i it works, I don't understand why I'm getting no results.
Here's the GEOM template with some extra rows added for testing that value 0 exists.
for $i in (0 to (xs:integer({fme:get-attribute("_element_count")})-1))
return {
<LineCoordinate>
<Seq_No>{$i+1}</Seq_No>
<latitude_position>{fme:get-attribute("_Positions{$i}.y")}</latitude_position>
<longitude_position>{fme:get-attribute("_Positions{$i}.x")}</longitude_position>
<latitude_position>{fme:get-attribute("_Positions{0}.x")}</latitude_position>
<longitude_position>{fme:get-attribute("_Positions{0}.x")}</longitude_position>
</LineCoordinate>
}
Heres the results that prove the list attributes has a value to get
<LineCoordinate>
<Seq_No>1</Seq_No>
<latitude_position/>
<longitude_position/>
<latitude_position>-11912.295936030823</latitude_position>
<longitude_position>-11912.295936030823</longitude_position>
</LineCoordinate>
So when Seq_No is 1 then $i must be 0 so Im expecting the same results here from
fme:get-attribute("_Positions{$i}.y") and
fme:get-attribute("_Positions{0}.y")
Im not sure why the 1st returns no value but the second does.
Can anyone see what I'm missing?