Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: XML Categories.

  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Thanked 0 Times in 0 Posts

    XML Categories.

    Hello, i have this kind of file in xml:

      <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.
    <drop mobId="18001"/>
       <itemId="2397" min="1" max="1" chance="12"/>
       <itemId="2402" min="1" max="1" chance="19"/>
       <itemId="2406" min="1" max="1" chance="8"/>
       <itemId="1864" min="1" max="1"  chance="166667"/>
       <itemId="1866" min="1" max="1" chance="62500"/>
    <drop mobId="18003"/>
      <itemId="17" min="30" max="90"  chance="21739"/>
      <itemId="1868" min="1" max="1" chance="27522"/>
      <itemId="1786" min="1" max="1" chance="9174"/>
    Anyone know how to do it? Any clue is welcome.

    Thanks a lot.
    Last edited by dEvilKinG; 08-17-2012 at 03:30 AM.

  2. #2
    Master Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Behind the Wall
    Thanked 567 Times in 560 Posts
    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.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  3. #3
    New to the CF scene
    Join Date
    Aug 2012
    Thanked 0 Times in 0 Posts
    Edit: Thank you, i done everything i wanted..
    Last edited by dEvilKinG; 08-18-2012 at 05:21 AM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts