Display XML in JTree

R

Rasikow Gnaniyar

i want to display XML file in Jtree view?
this is my xml:

<?xml version="1.0" encoding="UTF-8"?>
<mp_tree>
<mp_node_0 catId="2" category="automobiles" tree="1" inActive="1"
dateAdded="2008-03-11 19:56:21.0" />
< child node of Automobiles>
<mp_node_0 catId="3" category="States" tree="1" inActive="0"
dateAdded="2008-03-11 19:57:55.0" />



</mp_tree>

output should be in tree view:

Automobiles
- Truck
- Cars
States
- blah
- blah
 
R

RedGrittyBrick

Rasikow said:
i want to display XML file in Jtree view?
this is my xml:

<?xml version="1.0" encoding="UTF-8"?>
<mp_tree>
<mp_node_0 catId="2" category="automobiles" tree="1" inActive="1"
dateAdded="2008-03-11 19:56:21.0" />
< child node of Automobiles>
<mp_node_0 catId="3" category="States" tree="1" inActive="0"
dateAdded="2008-03-11 19:57:55.0" />

That is not valid XML. I doubt any XML-parser will read it.
the mp_tree and " child node of Automobiles" tags are unclosed.
</mp_tree>

output should be in tree view:

Automobiles
- Truck

The word "Truck" does not appear in your XML above.
- Cars
States
- blah
- blah

Did you have problems with the code in the references I gave earlier?
What Java have you written so far?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top