I want to do something similar to the following:
<xsl:for-each select="Item">
<xsl:if test="postion()=1 or position()=7>
<ul>
</xsl:if>
<li>An Item</li>
<xsl:if test="position()=2">
</ul>
</xsl>
</xsl:for-each>
</ul>
This will not work however because xslt views the unclosed <ul>
within the if statement as invalid.
Sample input:
<Item>1</Item>
<Item>2</Item>
<Item>3</Item>
<Item>4</Item>
<Item>5</Item>
<Item>6</Item>
<Item>7</Item>
<Item>8</Item>
<Item>9</Item>
<Item>10</Item>
Expected output:
<ul>
<li>An Item<li>
<li>An Item<li>
<li>An Item<li>
<li>An Item<li>
<li>An Item<li>
<li>An Item<li>
</ul>
<ul>
<li>An Item<li>
<li>An Item<li>
<li>An Item<li>
<li>An Item<li>
</ul>
Thanks -Ben