U
utterberg
If I have an xml that looks something like this:
<section>
<item>
<label>label one</label>
<data>123</label>
</item>
<item>
<label>label two</label>
<data>456</label>
</item>
<item>
<label>label three</label>
<data>789</label>
</item>
... and so on...
</section>
Then I would like to have a table that looks like this:
label one 123 label two 456
label three 789 label four 908
....and so on
How do I solve this? If it were html I would do like this:
<template match="/">
<table border="1">
<xsl:apply-templates select="section/item" />
</table>
</template>
<xsl:template match="item">
<xsl:if test="(position() mod 2) = 1">
<xsl:text disable-output-escaping="yes"><tr></xsl:text>
</xsl:if>
<td>
<xsl:value-of select="label"/>
</td>
<td>
<xsl:value-of select="data"/>
</td>
<xsl:if test="(position() mod 2) = 0">
<xsl:text disable-output-escaping="yes"></tr></xsl:text>
</xsl:if>
</xsl:template>
But since I'm now working with wordml the "<" and ">" doesn't
work. Any ideas how to manage this in wordml?
Thanks in advance!
..christer
<section>
<item>
<label>label one</label>
<data>123</label>
</item>
<item>
<label>label two</label>
<data>456</label>
</item>
<item>
<label>label three</label>
<data>789</label>
</item>
... and so on...
</section>
Then I would like to have a table that looks like this:
label one 123 label two 456
label three 789 label four 908
....and so on
How do I solve this? If it were html I would do like this:
<template match="/">
<table border="1">
<xsl:apply-templates select="section/item" />
</table>
</template>
<xsl:template match="item">
<xsl:if test="(position() mod 2) = 1">
<xsl:text disable-output-escaping="yes"><tr></xsl:text>
</xsl:if>
<td>
<xsl:value-of select="label"/>
</td>
<td>
<xsl:value-of select="data"/>
</td>
<xsl:if test="(position() mod 2) = 0">
<xsl:text disable-output-escaping="yes"></tr></xsl:text>
</xsl:if>
</xsl:template>
But since I'm now working with wordml the "<" and ">" doesn't
work. Any ideas how to manage this in wordml?
Thanks in advance!
..christer