My XML file is structured as follows:
<WORLD>
<COUNTRY COUNTRYID="INDIA">
<STATE STATEID="ANDHRAPRADESH">
<CITY>HYDERABAD</CITY>
<CITY>VIZAG</CITY>
<CITY>KURNOOL</CITY>
</STATE>
<STATE STATEID="TAMILNADU">
<CITY>CHENNAI</CITY>
<CITY>COIMBATORE</CITY>
<CITY>SALEM</CITY>
</STATE>
<STATE STATEID="KARNATAKA">
<CITY>BANGALORE</CITY>
<CITY>MYSORE</CITY>
<CITY>BALLARI</CITY>
</STATE>
</COUNTRY>
<COUNTRY COUNTRYID="AUSTRALIA">
<STATE STATEID="NEW SOUTH WALES">
<CITY>PERTH</CITY>
<CITY>BRIABANE</CITY>
<CITY>HOBART</CITY>
</STATE>
</COUNTRY>
</WORLD>
I am looking to create an expandable/collapsible tree structure using XSL and possibly some javascript, complete with plus and minus signs.
> WORLD | |
> INDIA
> |
> |
> ANDHRAPRADESH
> |
> |
> HYDERABAD
> VIZAG
> KURNOOL
> KARNATAKA
> |
> |
> BANGALORE
> BALLARI
> AUSTRALIA
> |
> |
> NEW SOUTH WALES
> |
> |
> PERTH
> BRIABANE
Is it possible to achieve this using just XSL, along with the potential addition of some javascript or pure CSS?
The sample XML I have provided is from a general form of the problem mentioned. My goal is to create a similar interactive tree structure like the one demonstrated here, but solely through XSL transformation of my XML document. Any suggestions?
Note: I do not have much experience with XSL or javascript, however, I do have some familiarity with Python. If there is a Python library or solution that can help, please advise.