I
iware_ext
Hi,
I've the following xml
<A>
<B>
<C>111</C>
<C>222</C>
<C>333</C>
</B>
<B>
<C>444</C>
<C>555</C>
<C>666</C>
</B>
</A>
The number of A is known but not the number of B. The number of B is
equal in each A.
The xml format is fixed and can't be changed.
I'd like to have the following result
1 111-444
2 222-555
3 333-666
For this I'm using the following script
<xsl:template match="/">
<xsl:for-each select="/A/B[1]/C">
<xsl:value-of select="position()"/> <xsl:value-of
select="/A/B[1]/C[position()]"/>-<xsl:value-of
select="/A/B[2]/C[position()]"/>
</xsl:for-each>
</xsl:template>
But the result given is
1 111-444
2 111-444
3 111-444
As if the position isn't working inside A[1]/B[position()]
Any idea?
Thanks for your help
Michel
I've the following xml
<A>
<B>
<C>111</C>
<C>222</C>
<C>333</C>
</B>
<B>
<C>444</C>
<C>555</C>
<C>666</C>
</B>
</A>
The number of A is known but not the number of B. The number of B is
equal in each A.
The xml format is fixed and can't be changed.
I'd like to have the following result
1 111-444
2 222-555
3 333-666
For this I'm using the following script
<xsl:template match="/">
<xsl:for-each select="/A/B[1]/C">
<xsl:value-of select="position()"/> <xsl:value-of
select="/A/B[1]/C[position()]"/>-<xsl:value-of
select="/A/B[2]/C[position()]"/>
</xsl:for-each>
</xsl:template>
But the result given is
1 111-444
2 111-444
3 111-444
As if the position isn't working inside A[1]/B[position()]
Any idea?
Thanks for your help
Michel