I want to display an XML schema in the form of a tree which I should be able to expand, collapse and drag-n-drop on to external droppable. For example :
<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
<xs:element name="catalog">
<xs:complexType>
<xs:sequence>
<xs:element name="cd">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="artist" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
<xs:element name="company" type="xs:string"/>
<xs:element name="price" type="xs:float"/>
<xs:element name="year" type="xs:short"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
I need to display treenodes as :
-catalog
-cd
title(string)
artist(string)
.
.
.
year(short)
All that are marked with "-" are expandable and collapsible and contain the child elements. How do I achieve this in javascript/jquery? Are there any plugins in jquery related to this?
Thank you all.