Hi,
Me again!!
I am loooping over an element within my xml document using xslt, and need to be able to find the min and the max values of a node within the document.
this is the basic structure of the document
Now I am looping over this information like:
Now I have tried using an if statement with the test position()=last() to test for the last element in my document and therefore give me the smallest value, and I have used position()=1 to test for the first element, but when trying to use the variables I am setting within these if statements later the parser says that they aren't available, so i tried the above solution. this seems to be looking at the same node within the document, and not the last element within the whole document.
It is at this point that i run out of tallent
Does anyone know how i can find the smallest ypos and the largest ypos which will then allow me to position an element on the page once the loop has finsihed?
TIA
Tony
Me again!!
I am loooping over an element within my xml document using xslt, and need to be able to find the min and the max values of a node within the document.
this is the basic structure of the document
Code:
<Root>
<Table>
<ypos>6</ypos>
<xpos>100</xpos>
</Table>
<Table>
<ypos>7</ypos>
<xpos>101</xpos>
</Table>
</Root>
Now I am looping over this information like:
Code:
<xsl:for-each select="//Table">
<xsl:sort select="xpos" data-type="number"/>
<xsl:if test="position()=1">
<xsl:value-of select="ypos" /><br />
<xsl:value-of select="ypos[position()=last()]" /><br />
<xsl:value-of select="ypos[position()]" /><br />
</xsl:if>
</xsl:for-each>
<!-- position element on the page here using css-->
Now I have tried using an if statement with the test position()=last() to test for the last element in my document and therefore give me the smallest value, and I have used position()=1 to test for the first element, but when trying to use the variables I am setting within these if statements later the parser says that they aren't available, so i tried the above solution. this seems to be looking at the same node within the document, and not the last element within the whole document.
It is at this point that i run out of tallent
Does anyone know how i can find the smallest ypos and the largest ypos which will then allow me to position an element on the page once the loop has finsihed?
TIA
Tony