[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Alternatives to "Stopping" a for-each

Subject: Alternatives to "Stopping" a for-each
From: <trond.huso@xxxxxx>
Date: Thu, 14 Feb 2013 13:10:02 +0000
 Alternatives to "Stopping" a for-each
I have to create the following list based on xml-structure below. It is a list
of ranked horses, and where the last number (if there are more than one
number) is the winning horse.

Rangering: 1. avd: 7-11-6-12 (str. 4), 2. avd: 9 (str. 1), 3. avd: 8, 4. avd:
4-8 (str. 5), 5. avd: 6 (str. 10).

The example uses the bold part of the text.

So the idea is that I am sorting the ranking, looping the structure. When I
hit the winning horse, I shall stop the loop.
Now I know that you cannot stop a for-each in xslt, so what is the best way to
this then?



<Start>
                            <StartNo>1</StartNo>
                            <Horse>
                                <RegNo>N-04-0514</RegNo>
                                <Name>Rise Stjerna</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>8279</LicenseNo>
                                <FirstName>Kristine</FirstName>
                                <LastName>Kvasnes</LastName>
                            </Driver>
                            <Distance>2140</Distance>
                            <Scratched>false</Scratched>
                            <Ranking>9</Ranking>
                        </Start>
                        <Start>
                            <StartNo>2</StartNo>
                            <Horse>
                                <RegNo>N-07-0133</RegNo>
                                <Name>Bovis Rambo</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>79</LicenseNo>
                                <FirstName>Thor</FirstName>
                                <LastName>Borg</LastName>
                            </Driver>
                            <Distance>2140</Distance>
                            <Scratched>false</Scratched>
                            <Ranking>6</Ranking>
                        </Start>
                        <Start>
                            <StartNo>3</StartNo>
                            <Horse>
                                <RegNo>N-02-0165 </RegNo>
                                <Name>Edne Kongen</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>2014063</LicenseNo>
                                <FirstName>Oda</FirstName>
                                <LastName>Verdal</LastName>
                            </Driver>
                            <Distance>2140</Distance>
                            <Scratched>false</Scratched>
                            <Ranking>11</Ranking>
                        </Start>
                        <Start>
                            <StartNo>4</StartNo>
                            <Horse>
                                <RegNo>S-08-0191</RegNo>
                                <Name>Jfrvsx Kristina</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>17044</LicenseNo>
                                <FirstName>Xystein</FirstName>
                                <LastName>Tjomsland</LastName>
                            </Driver>
                            <Distance>2160</Distance>
                            <Scratched>true</Scratched>
                            <Ranking>0</Ranking>
                        </Start>
                        <Start>
                            <StartNo>5</StartNo>
                            <Horse>
                                <RegNo>N-07-0107</RegNo>
                                <Name>Magnums Amadeus</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>5697</LicenseNo>
                                <FirstName>Arild</FirstName>
                                <LastName>Beres</LastName>
                            </Driver>
                            <Distance>2160</Distance>
                            <Scratched>false</Scratched>
                            <Ranking>5</Ranking>
                        </Start>
                        <Start>
                            <StartNo>6</StartNo>
                            <Horse>
                                <RegNo>578001020080549</RegNo>
                                <Name>Willblesen</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>30399</LicenseNo>
                                <FirstName>Rudolf</FirstName>
                                <LastName>Roland</LastName>
                            </Driver>
                            <Distance>2160</Distance>
                            <Scratched>false</Scratched>
                            <Ranking>3</Ranking>
                        </Start>
                        <Start>
                            <StartNo>7</StartNo>
                            <Horse>
                                <RegNo>N-05-0660</RegNo>
                                <Name>Lill Ronja</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>1537</LicenseNo>
                                <FirstName>Eirik</FirstName>
                                <LastName>Hxitomt</LastName>
                            </Driver>
                            <Distance>2160</Distance>
                            <Scratched>false</Scratched>
                            <Ranking>1</Ranking>
                        </Start>
                        <Start>
                            <StartNo>8</StartNo>
                            <Horse>
                                <RegNo>N-04-0365</RegNo>
                                <Name>Per Even</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>65285</LicenseNo>
                                <FirstName>Vidar</FirstName>
                                <LastName>Tjomsland</LastName>
                            </Driver>
                            <Distance>2160</Distance>
                            <Scratched>false</Scratched>
                            <Ranking>7</Ranking>
                        </Start>
                        <Start>
                            <StartNo>9</StartNo>
                            <Horse>
                                <RegNo>N-05-0179</RegNo>
                                <Name>Es Glimten</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>5040</LicenseNo>
                                <FirstName>Johan Herbjxrn</FirstName>
                                <LastName>Undem</LastName>
                            </Driver>
                            <Distance>2160</Distance>
                            <Scratched>false</Scratched>
                            <Ranking>10</Ranking>
                        </Start>
                        <Start>
                            <StartNo>10</StartNo>
                            <Horse>
                                <RegNo>N-06-0047</RegNo>
                                <Name>Pola Linus</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>2127</LicenseNo>
                                <FirstName>Kristian</FirstName>
                                <LastName>Malmin</LastName>
                            </Driver>
                            <Distance>2180</Distance>
                            <Scratched>false</Scratched>
                            <Ranking>8</Ranking>
                        </Start>
                        <Start>
                            <StartNo>11</StartNo>
                            <Horse>
                                <RegNo>N-03-0261</RegNo>
                                <Name>Odintroll</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>8345</LicenseNo>
                                <FirstName>Ole Johan</FirstName>
                                <LastName>Xstre</LastName>
                            </Driver>
                            <Distance>2180</Distance>
                            <Scratched>false</Scratched>
                            <Ranking>2</Ranking>
                        </Start>
                        <Start>
                            <StartNo>12</StartNo>
                            <Horse>
                                <RegNo>N-07-0209</RegNo>
                                <Name>Tallas</Name>
                            </Horse>
                            <Driver>
                                <LicenseNo>5740</LicenseNo>
                                <FirstName>Jan Rune</FirstName>
                                <LastName>Gaustad</LastName>
                            </Driver>
                            <Distance>2180</Distance>
                            <Scratched>false</Scratched>
                            <Ranking>4</Ranking>
                        </Start>


Best regards,

Trond Husx
System Developer
www.ntb.no

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.