XSLT : Looping from 1 to 60

后端 未结 5 1204
刺人心
刺人心 2020-12-05 09:34

What is the best way to loop in XSLT from 1 to 60? I research in net, there are some templates to do this, is there any other way for example like a built-in function?

5条回答
  •  北海茫月
    2020-12-05 10:04

    In XSLT 2.0,

    ...
    

    But I guess that you must be using XSLT 1.0, otherwise you wouldn't be asking.

    In XSLT 1.0 you should use recursion: a template that calls itself with a counter that's incremented on each call, and the recursion terminates when the required value is reached.

    Alternatively there's a workaround in XSLT 1.0: provided your source document contains at least 60 nodes, you can do

    ...
    

提交回复
热议问题