none
sort the node data alphabetical order using xslt1.0

    Question

  •     My Input xml Looka like below :
         <?xml version="1.0" encoding="utf-8" ?>
            <countries>
             <country>
                <state>Ontario</state>
                <country1>CANADA</country1>
              </country>
              <country>
                <state>Swindon</state>
              </country>
              <country>
                <state>CAMDEN</state>
              </country>
              <country>
                <state>NJ</state>
                <country1>America</country1>
              </country>
              <country>
               <state>NJ</state>
                <country1>America</country1>
               </country>
              <country>
                <state>NY</state>
                <country1>America</country1>
               </country>
              <country>
                 <state>DE</state>
                <country1>America</country1>
              </country>
              <country>
                <state>Queenland</state>
                <country1>Australia</country1>
              </country>
              <country>
                <state>APstate</state>
              </country>
              <country>
                <state>ANstate</state>
              </country>
            </countries>


    My output looks like as below :


        A
        America
          - DE
          - NJ
          - NY
        ANstate
        APstate
        Australia
          -Queenland
        C
        CAMDEN
        CANADA
          -Ontario
        S
        Swindon

        I would like to disply state and country names in alphabetical order.
        If there are any county1 node assosiated with state I need to display all
        states with in the counry name.however if there is no state that starts with
        a certain alphabet like say "X" then it shouldn't show an empty .
        I'm pretty sure this is possible with xslt but have no idea how to go about doing it.
        So you gurus out there, pleeeeeeease help me.I am using visaul stuido2010 xml editor and xslt1.0..
        I have no way to change the xslt version..I got struck here..
    Thursday, July 25, 2013 4:35 PM