Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

asked on

Help with sorting data element from xml file

Hi,

 How would you load the xml file below and sort all the ctry data element?

 <Root>
 <Table1>
 <Item>1</Item>
 <Ctry>BEL,USA,CAN<Ctry>
 </Table1>
 <Table1>
 <Item>2</Item>
 <Ctry>BEL,USA,CAN<Ctry>
 </Table1>
 <Table1>
 <Item>3</Item>
 <Ctry>FRA,USA,CAN<Ctry>
 </Table1>
 <Table1>
 <Item>4</Item>
 <Ctry>USA,CAN,FRA,NLD<Ctry>
 </Table1>
 </Root>

 Thanks,

 Victor
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
When the ctry values need to be sorted, then they seem important enough, the have their own element. E.g.
<Ctrys>
    <Ctry>FRA<Ctry>
    <Ctry>USA<Ctry>
    <Ctry>CAN<Ctry>
</Ctrys>

Open in new window

Avatar of Victor  Charles

ASKER

Hi,

Thanks for the code, will try it and get back to you.

Victor
Thank You1
Not a problem Victor, glad to help.