add file attribute to the text element