This transformation:
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:
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.
The rest of the small tricks are not that important.