I need to convert the following xml with xslt
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>0</item>
<item>6</item>
into the following html
<div>
<i>1</i>
<i>2</i>
</div>
<div>
<i>3</i>
<i>6</i>
</div>
In other words to remove nodes with 0 value and to wrap every 2 nodes with one div
I would do it like this:
then with the input being
you get the result
If you also want to transform
item
toi
elements simply add the templatein the stylesheet.