Hi

I am iterating through below URLS in Javascript and I need to build a heirarchy from this using javascript. Is it possible? I want a generic script and no hardcoding. I have an array of these URLs


urlArray = [];


/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/1. Submittals
/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/1. Submittals/1. Site Work
/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/1. Submittals/2. Piling
/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/1. Submittals/3. Liquids Concrete
/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/1. Submittals/4. Liquids Mechanical
/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/1. Submittals/5. Electrical
/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/1. Submittals/6. Building Trades
/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/1. Submittals/7. Demo
/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/1. Submittals/8. Solids
/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/1. Submittals/9. Final paving and Landscaping
/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/2. RFIs
/sites/xx/Project Documents/3. Submittals, RFIs and FWDs/3. FWDs

so ideally i would build in a div element something like:

1.Submittals
1.Site Work
2.Piling
3.Liquids
......
2. RFIs

3.FWDs



Please help,