Simplify code for data template using FileTemplateApply?

I have a Dataset of records that contain people’s bio details (headshot, job title, and description). I have an XMLTemplate that inserts those data.

t /@ people 

produces a new Dataset that I can then export

Export["biogen.html", (template /@ people) // Normal]

This works fine, but I would prefer to simplify the process by using FileTemplateApply to both apply the template and write the output. The problem is that I can’t work out how to evaluate FileTemplateApply on more than one record, i.e. it will work on a single association, but if I try to Map it across multiple associations, I end up with multiple files.

What am I doing wrong?

Cheers,
Andy

Hi Andrew,

FileTemplateApply creates a new file every time it is evaluated, if the file already exists, it is deleted and a new file is created. The code above looks very straightforward and easy to understand. It decouples the generation of the data from the processing (export) which is good and more flexible. I can’t think of a way to “simplify” it.

Thanks Rohit, that’s good to know.

Cheers
Andy