473,324 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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 1729
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
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.) ...
2
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...
1
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...
1
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...
4
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...
3
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...
1
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...
5
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...
8
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.