add replace-vars to substitute  in text and attributes