Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Max calculation with non-standard XML [Thread Next] Re: Max calculation with non-standard XMLTo: NULL Date: 6/15/2007 2:27:00 AM On Jun 14, 5:44 pm, Martin Honnen <mahotr...@yahoo.de> wrote: > m0nkeymafia wrote: > > Can anyone help me find the maximum value of all Cells in all Rows in > > position X. > > One way with XSLT 1.0 to find a maximum is by using xsl:sort to sort > your nodes in descending order and then to output only the first > element/value the sort produces, that way you have the maximum. > > -- > > Martin Honnen --- MVP XML > http://JavaScript.FAQTs.com/ Thanks But how can I do this on my XML? I have it like this <Report> <Row>...<Cell>...Many cells here...</Cell>....</Row> <Row>...<Cell>...Many cells here...</Cell>....</Row> <Row>...<Cell>...Many cells here...</Cell>....</Row> </Report> So I would want the MAX Nth Cell out of all rows? How do I create a collection of those Cells to sort through? I currently get all the Cell data like so: <xsl:for-each select="Row"> <xsl:for-each select="Cell"> <xsl:if test="position() = $graphCol"> So I go through each row and check the position of the <Cell> matches the column I want to plot Thanks for any help its driving me mad! | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
