In XSLT how do I increment a global variable from a different scope?

后端 未结 8 1107
礼貌的吻别
礼貌的吻别 2020-11-29 04:41

I am processing an XML file where I want to keep count of the number of nodes, so that I can use it as an ID as I write new nodes.

At the moment I have a global vari

8条回答
  •  情歌与酒
    2020-11-29 05:15

    Depending on your XSLT processor, you may be able to introduce scripted functions into your XLST. For example, the Microsoft XML library supports the inclusion of javascript. See http://msdn.microsoft.com/en-us/library/aa970889(VS.85).aspx for an example. This tactic obviously won't work if you're planning to deploy/execute XSLT on public client browsers; it has to be done by a specific XSLT processor.

提交回复
热议问题