473,581 Members | 2,783 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML Tree Structure

Hi Folks,

I would like to take a XML document and write its data into a tree structure
for a custom tree control. The document has two fields with one called task
(a text field) and the other called tree_level (an integer field). Consider
the document to be valid and well-formed. The tree_level is an index
describing where a node will reside in a tree structure. A partial view of
the XML document is as follows:

<task>summary task</task>
<tree_level>0 </tree_level>
<task>task1</task>
<tree_level>1 </tree_level>
<task>task2</task>
<tree_level>2 </tree_level>
<task>task3</task>
<tree_level>2 </tree_level>
<task>task4</task>
<tree_level>1 </tree_level>
<task>task5</task>
<tree_level>0 </tree_level>

The XML source document will pass the data into a XML target document that
might look as follows:

<node1>task1</node1>
<node2>task2
<node3>task3</node3>
<node4>task4</node4>
</node2>
<node5>task5</node5>
<node6>task 6</node6>

I own Stylus Studio but I am not sure if there is a way to code this using
the XML Dom.

Thanks for any guidance.
- Glenn


Aug 28 '06 #1
1 1743
Please substitute the following XML for the initial post. Thanks, Glenn

<task>summary task</task>
<tree_level>0 </tree_level>
<task>task1</task>
<tree_level>1 </tree_level>
<task>task2</task>
<tree_level>2 </tree_level>
<task>task3</task>
<tree_level>2 </tree_level>
<task>task4</task>
<tree_level>1 </tree_level>
<task>task5</task>
<tree_level>1 </tree_level>

The XML source document will pass the data into a XML target document that
might look as follows:

<node1>task1
<node2>task2
<node3>task3</node3>
<node4>task4</node4>
</node2>
<node5>task5</node5>
<node6>task 6</node6>
</node1>
"glenn" wrote:
Hi Folks,

I would like to take a XML document and write its data into a tree structure
for a custom tree control. The document has two fields with one called task
(a text field) and the other called tree_level (an integer field). Consider
the document to be valid and well-formed. The tree_level is an index
describing where a node will reside in a tree structure. A partial view of
the XML document is as follows:

<task>summary task</task>
<tree_level>0 </tree_level>
<task>task1</task>
<tree_level>1 </tree_level>
<task>task2</task>
<tree_level>2 </tree_level>
<task>task3</task>
<tree_level>2 </tree_level>
<task>task4</task>
<tree_level>1 </tree_level>
<task>task5</task>
<tree_level>0 </tree_level>

The XML source document will pass the data into a XML target document that
might look as follows:

<node1>task1</node1>
<node2>task2
<node3>task3</node3>
<node4>task4</node4>
</node2>
<node5>task5</node5>
<node6>task 6</node6>

I own Stylus Studio but I am not sure if there is a way to code this using
the XML Dom.

Thanks for any guidance.
- Glenn

Aug 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
14025
by: Steve Johnson | last post by:
Been banging my head on this for two days now. Hope someone can help! My test program below is in the form of a single JSP, with a Node class build in. (All the coded needed to run is below.) The technical requirements: 1) Store tree data in the database so that it can be extracted as a tree structure. For test purposes,
2
5794
by: ragha | last post by:
Dear friends I am emulating thr tree structure mentioned in the article http://www.15seconds.com/issue/010921.htm I have succesfully created the folder structure for level 2 I need this structure till 5 level is there any easier way to generate this using xsl My xml tree node is
1
1996
by: googleo | last post by:
Hi, in my application I want to handle and store data in a hierarchic data structure. For example: persons who manage houses; houses have various numbers of floors; floors have various numbers of rooms etc. My first concept is to use a tree structure, to ideally save the whole tree to file and load from file.
1
7154
by: Srihari | last post by:
I'm trying to develop a tree structure using javascript. The node values of the tree are generating from a mysql table depending on login. The tree structure contains 3 sub levels. I developed static HTML tree using http://www.treeview.net. now i need to generate this tree dynamically. Can any one has code for this?
4
612
by: Stephan Tobies | last post by:
Hi everyone, I am looking for a good data structure that could be used to represent families of trees with shared sub-trees and copy-on-write semantics. On a very abstract level, I would like to have an API like this: Let Node be a suitably defined data structure. Then the following functions shall be supported:
3
2547
by: _DS | last post by:
Problem with mapping a directory tree to a tree control: It takes a while to recurse subdirs and map them to nodes. This is solved in some books I've seen (MacDonald, Albahari) by reading the subdir only when its node on the tree control is opened. Has anyone pre-packaged this functionality into a control?
1
2732
by: David Hirschfield | last post by:
I've written a tree-like data structure that stores arbitrary python objects. The objective was for the tree structure to allow any number of children per node, and any number of root nodes...and for it to be speedy for trees with thousands of nodes. At its core, the structure is just a list of lists arranged so that if node A has children...
5
3708
by: hankypan1 | last post by:
Hi All, I need a tree data structure for my application. It is the non -cyclic simple tree where i can have any number of children node and each child can recursively become a sub tree like a normal tree. Now the thing is i can popullate my tree at compile time like a global data. Since i know my tree definition at compile time, instead...
8
1790
by: =?ISO-8859-1?Q?m=E9choui?= | last post by:
Problem: - You have tree structure (XML-like) that you don't want to create 100% in memory, because it just takes too long (for instance, you need a http request to request the information from a slow distant site). - But you want to be able to request data from it, such has "give me all nodes that are under a "//foo/bar" tree, and have a...
0
2194
by: mac | last post by:
I found that with memory allocating techniques used nowadays (addresses alignment, eg. on 32bit machines) one can detect loops in a tree structure very fast, without using extra memory. This is due to a possibility of storing extra information in unused bits of the tree pointers (it works for linked lists too). One can say it is dangerous or...
0
7876
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8180
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3832
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1144
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.