• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Convert XML to Tree structure GUI chart

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
XML file
<?xml version=1.0?>
<COMPANY name="Syntax SoftTech Pvt. Ltd">
<LOCATION name="Banglore">
<UNIT name="Software Development">
<DEPARTMENT name="Programming">
<DESIGNATION name="Project Leader" />
<DESIGNATION name="Team Leader" />
<DESIGNATION name="Senior Software Er." />
<DESIGNATION name="Software Er." /><DESIGNATION name="Trainee" />
</DEPARTMENT>
<DEPARTMENT name="Quality Assurance">
<DESIGNATION name="Testing Leader" />
<DESIGNATION name="Software Tester" />
<DESIGNATION name="Trainee" />
</DEPARTMENT>
</UNIT>
</LOCATION>
<LOCATION name="New Jersey">
<UNIT name="Marketing">
<DEPARTMENT name="Software Marketing">
<DESIGNATION name="Team Leader" />
<DESIGNATION name="Marketing Trainee" /></DEPARTMENT>
</UNIT>
</LOCATION>
</COMPANY>

Now this should be converted in HTML in a Vertical tree structure with minimize - maximize capability.
Also the names designation names should be hyperlink.
Like:
-Syntax Soft-Tech Pvt. Ltd.
|
|- Banglore
|
|-Software Development
| |
| |-Programming
| ||
| ||-Project Leader
| ||
| ||-Team Leader
| ||
| ||-Senior Software Er.
| ||
| ||-Software Er.
| ||
| ||-Trainee
| |
| |+ Quality Assurance
|
|+ New Jersey

Where "-" is an maximized and "+" is minimized
I know this can be done in applet or swings easily, but I
want that the averagec response time should be very quick.
Please suggest me if there is some other way out.
 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The effect that you are after can only be acheived in HTML if you are prepared to used JavaScript.
I suggest that you take a look at www.dynamicdrive.com for free JavaScript functions that will do this for you.
Try Folding Menu for example.
Once you have the JavaScript it is a relatively simple task to create an XSL stylesheet that will transform into the appropriate HTML to create the folder structures.
HTH
[ February 27, 2003: Message edited by: Andy Bowes ]
 
Pashi Soni
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Andy,
I have used this in my other applications, but the problem is the data in XML is too large. Almost 2000 Rows of database. So I want a way in which the average response time in displaying this huge data in tree format should be minimum.
<B>You Said:
Once you have the JavaScript it is a relatively simple task to create an XSL stylesheet that will transform into the appropriate HTML to create the folder structures.
</B>
How shall we create an XSL with Javascript to transform it into HTML with folder structure.
Thank you for you help.
 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This works in IE:

Brian
 
Pashi Soni
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is good with IE, but what if I want it to work on other Browsers ?
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pashi Soni:

How shall we create an XSL with Javascript to transform it into HTML with folder structure.
Thank you for you help.


http://manudea.duemetri.net/manudea/xtree/default.asp HTH
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic