[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[xsl] Extracting highest values within a range
Subject: [xsl] Extracting highest values within a range From: "Kevin Bird" <kevin.bird@xxxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 14 Jan 2005 16:39:15 -0000 |
Hi Consider the following column based structure. <wrapper> <column1> <name>Result1</name> <name>Result2</name> <name>Result3</name> <name>Result4</name> <name>Result5</name> <name>Result6</name> </column1> <column2> <amount>1000</amount> <amount>200</amount> <amount>3000</amount> <amount>40</amount> <amount>50</amount> <amount>11</amount> </column2> <column3> <amount>44</amount> <amount>800</amount> <amount>66</amount> <amount>120</amount> <amount>90</amount> <amount>101</amount> </column3> <column4> <amount>1000</amount> <amount>200</amount> <amount>3000</amount> <amount>40</amount> <amount>50</amount> <amount>11</amount> </column4> <column5> <amount>1000</amount> <amount>200</amount> <amount>3000</amount> <amount>40</amount> <amount>50</amount> <amount>11</amount> </column5> </wrapper> I need to compare a range of results and output the highest <amount> for each <column>. The range will be defined by matching the text value of <name> nodes in <column1>. So given the following parameters... <params> <resultstocompare> <start>Result1</start> <end>Result3</end> </resultstocompare> <resultstocompare> <start>Result5</start> <end>Result6</end> </resultstocompare> </params> ... I would get the following result. <wrapper> <column1> <name>Result1 - Result3</name> <name>Result4</name> <name>Result5 - Result6</name> </column1> <column2> <amount>3000</amount> <amount>40</amount> <amount>50</amount> </column2> <column3> <amount>800</amount> <amount>120</amount> <amount>101</amount> </column3> <column4> <amount>3000</amount> <amount>40</amount> <amount>50</amount> </column4> <column5> <amount>3000</amount> <amount>40</amount> <amount>50</amount> </column5> </wrapper> Note that 'Result4' hasn't been used in any comparison and passes through 'as-is'. Any suggestions would be greatly appreciated. -- Kevin
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Trying to Achieve inside/, W. Eliot Kimber | Thread | Re: [xsl] Extracting highest values, David Carlisle |
Re: [xsl] text() handling, Jon Gorman | Date | [xsl] XSLTdoc version 1.1, Iwan Birrer |
Month |