Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-17-2012, 02:25 AM   PM User | #1
dEvilKinG
New to the CF scene

 
Join Date: Aug 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
dEvilKinG is an unknown quantity at this point
XML Categories.

Hello, i have this kind of file in xml:

Code:
  <drop mobId="18001" itemId="2397" min="1" max="1" category="1" chance="12"/>
  <drop mobId="18001" itemId="2402" min="1" max="1" category="1" chance="19"/>
  <drop mobId="18001" itemId="2406" min="1" max="1" category="1" chance="8"/>
  <drop mobId="18001" itemId="1864" min="1" max="1" category="2" chance="166667"/>
  <drop mobId="18001" itemId="1866" min="1" max="1" category="2" chance="62500"/>
  <drop mobId="18001" itemId="1878" min="1" max="1" category="2" chance="37037"/>
  <drop mobId="18001" itemId="1885" min="1" max="1" category="2" chance="7092"/>
  <drop mobId="18001" itemId="1889" min="1" max="1" category="2" chance="5435"/>
  <drop mobId="18001" itemId="4069" min="1" max="1" category="2" chance="2102"/>
  <drop mobId="18001" itemId="4070" min="1" max="1" category="2" chance="3192"/>
  <drop mobId="18001" itemId="4071" min="1" max="1" category="2" chance="1615"/>
  <drop mobId="18001" itemId="4197" min="1" max="1" category="2" chance="8"/>
  <drop mobId="18003" itemId="17" min="30" max="90" category="1" chance="21739"/>
  <drop mobId="18003" itemId="1868" min="1" max="1" category="2" chance="27522"/>
  <drop mobId="18003" itemId="1786" min="1" max="1" category="3" chance="9174"/>
  <drop mobId="18003" itemId="1873" min="1" max="1" category="4" chance="6423"/>
  <drop mobId="18003" itemId="462" min="1" max="1" category="5" chance="61224"/>
  <drop mobId="18003" itemId="426" min="1" max="1" category="6" chance="36585"/>
  <drop mobId="18007" itemId="1895" min="1" max="1" category="1" chance="230769"/>
  <drop mobId="18007" itemId="4988" min="1" max="1" category="2" chance="5349"/>
  <drop mobId="18007" itemId="4043" min="1" max="1" category="3" chance="25209"/>
  <drop mobId="18007" itemId="4042" min="1" max="1" category="4" chance="14778"/>
  <drop mobId="18007" itemId="4040" min="1" max="1" category="5" chance="14151"/>
  <drop mobId="18007" itemId="4401" min="1" max="1" category="6" chance="1617"/>
  <drop mobId="18007" itemId="8740" min="1" max="1" category="7" chance="870"/>
  <drop mobId="18007" itemId="8730" min="1" max="1" category="8" chance="621"/>
  <drop mobId="18007" itemId="5489" min="1" max="1" category="9" chance="17442"/>
  <drop mobId="18007" itemId="5485" min="1" max="1" category="10" chance="10950"/>
  <drop mobId="18007" itemId="5486" min="1" max="1" category="11" chance="7713"/>
  <drop mobId="18007" itemId="5305" min="1" max="1" category="12" chance="249"/>
And i want it to be sorted by mobid first and then by category. Like this.
Code:
<drop mobId="18001"/>
  <category="1"/>
   <itemId="2397" min="1" max="1" chance="12"/>
   <itemId="2402" min="1" max="1" chance="19"/>
   <itemId="2406" min="1" max="1" chance="8"/>
  <category="2"/>
   <itemId="1864" min="1" max="1"  chance="166667"/>
   <itemId="1866" min="1" max="1" chance="62500"/>
</drop>

<drop mobId="18003"/>
 <category="1"/>
  <itemId="17" min="30" max="90"  chance="21739"/>
 <category="2"/>
  <itemId="1868" min="1" max="1" chance="27522"/>
 <category="3"/>
  <itemId="1786" min="1" max="1" chance="9174"/>
</drop>
Anyone know how to do it? Any clue is welcome.

Thanks a lot.

Last edited by dEvilKinG; 08-17-2012 at 02:30 AM..
dEvilKinG is offline   Reply With Quote
Old 08-17-2012, 06:57 AM   PM User | #2
Dormilich
Senior Coder

 
Dormilich's Avatar
 
Join Date: Jan 2010
Location: Behind the Wall
Posts: 2,881
Thanks: 9
Thanked 291 Times in 287 Posts
Dormilich is on a distinguished road
looks like Muenchian Sort can accomplish that, though I haven’t used it in ages.

well, it also depends on which language you want to sort in.
__________________
please post your code wrapped in [CODE] [/CODE] tags
Dormilich is offline   Reply With Quote
Old 08-17-2012, 09:53 PM   PM User | #3
dEvilKinG
New to the CF scene

 
Join Date: Aug 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
dEvilKinG is an unknown quantity at this point
Edit: Thank you, i done everything i wanted..

Last edited by dEvilKinG; 08-18-2012 at 04:21 AM..
dEvilKinG is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:32 AM.


Advertisement
Log in to turn off these ads.