I have a bunch of xml documents where the author chose to represent a set of cartesian points like this:
0&l
Sure there is a generic way:
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:template match="row">
<set>
<xsl:apply-templates select="
col[position() mod 2 = 1 and following-sibling::col]
" />
</set>
</xsl:template>
<xsl:template match="col">
<point x="{text()}" y="{following-sibling::col[1]/text()}" />
</xsl:template>
</xsl:stylesheet>
Output for me:
<set>
<point x="0" y="0" />
<point x="1" y="1" />
</set>