Xslt how to style conditional odd/even rows

前端 未结 3 1503
梦谈多话
梦谈多话 2021-02-08 22:39

I\'ve an html table written using xslt transformation that looks like this


        

        
      
      
      
3条回答
something
This is always displayed
something 2
<num></num>

when applied on this XML document:


  01
  02
  03
  04
  05
  06
  07
  08
  09
  10

produces the wanted result:


   
something
This is always displayed
This is always displayed
something 2
This is always displayed
This is always displayed
something
This is always displayed
This is always displayed
something 2
This is always displayed
This is always displayed
something
This is always displayed
This is always displayed
something 2
This is always displayed

Do note:

  1. We are using the most fine-grained traversal and processing of an XML document -- node by node. After the identity transformation this is the second most important XSLT design pattern.

  2. The rest of the small tricks are not that important.

提交回复
热议问题