How to implement if-else statement in XSLT?

后端 未结 5 1275
一整个雨季
一整个雨季 2020-11-28 05:28

I am trying to implement an if -else statement in XSLT but my code just doesn\'t parse. Does anyone have any ideas?

  

        
5条回答
  •  -上瘾入骨i
    2020-11-28 06:06

    If I may offer some suggestions (two years later but hopefully helpful to future readers):

    • Factor out the common h2 element.
    • Factor out the common ooooooooooooo text.
    • Be aware of new XPath 2.0 if/then/else construct if using XSLT 2.0.

    XSLT 1.0 Solution (also works with XSLT 2.0)

    m d ooooooooooooo

    XSLT 2.0 Solution

    ooooooooooooo

提交回复
热议问题