Transform an integer value to a repeated character

前端 未结 3 1062
攒了一身酷
攒了一身酷 2021-01-18 10:00

When my XSL stylesheets encounters this node:


...it should transform it into this node:



        
3条回答
  •  孤独总比滥情好
    2021-01-18 10:24

    A fairly dirty but pragmatic approach would be to make a call on what's the highest number you ever expect to see in attribute, then use

    substring("****...", 1, $repeat)
    

    where you have as many *s in that string as that maximum number you expect. But I hope that there's something better!

提交回复
热议问题