How to use an incremented counter to provide a unique id in XSLT?

后端 未结 4 2074
故里飘歌
故里飘歌 2021-01-20 01:40

I am using XSLT to convert a very large XML document into (X)HTML. For some of the tags I am converting them to a

. I would like to be able to create
4条回答
  •  独厮守ぢ
    2021-01-20 02:42

    You can add callouts to static methods on Java classes to your transforms... it works but there are some downsides like 1) Now your transform is tied to some Java code and is harder to test/debug in external tools like Oxygen (although there are some ways to mitigate this) 2) You have to maintain state as statics or perhaps thread locals, which can introduce all kinds of problems (synchronization issues, questions about resetting if you are doing this multiple times, Etc)

提交回复
热议问题