HI @james_c_452 ,
In order to get the <> to display you need to put a <backSlash\\> before closing the tag.
For the conditionally exposing attributes, I'm actually not sure what the best approach would be here... perhaps two output ports or does the transformer need to have a single output port? Alternatively, I wonder if the SchemaScanner could be used here because it can remove empty attributes from schema definitions (although this may require you to write and read the data back in). You could use a SchemaScanner in the custom transformer and dynamically write out an FFS file with that schema definition. Then use a FeatureReader to bring that file back in (attributes will be present on features but not exposed.
Python might also be an option as well.
HI @james_c_452 ,
In order to get the <> to display you need to put a <backSlash\\> before closing the tag.
For the conditionally exposing attributes, I'm actually not sure what the best approach would be here... perhaps two output ports or does the transformer need to have a single output port? Alternatively, I wonder if the SchemaScanner could be used here because it can remove empty attributes from schema definitions (although this may require you to write and read the data back in). You could use a SchemaScanner in the custom transformer and dynamically write out an FFS file with that schema definition. Then use a FeatureReader to bring that file back in (attributes will be present on features but not exposed.
Python might also be an option as well.
Thanks for the answer Chris.
I would prefer the transformer to have one output port. Its a 3D nearest neighbour one I've had for a while but thought I should put up for others to use. I've made it so that it looks similar to the existing 2D one.
The problem comes when you wish to find more than one neighbour. In this case it stores the new attributes in a list, but on output it has the <missing> individual attributes. If I make it so that it doesn't output the attributes then they won't be there for the case of the single neighbour. Though perhaps a way around it is to just make everything go to a list.
Sounds like there isn't a simple solution then, I thought there might be because I am self taught. Potentially I could use the schema scanner, though that might have to go on a future release if I edit it
Unfortunately I don't know any python. Though I suspect that will still have the same issue for the output. The attributes aren't there but they are writen with the output port settings. So I imaging removing them again will still have the same problem.
If anyone else has an easy solution that would be great to hear