Export to XML file does not show sub nodes.

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
Marcel Horsthouse
Newbie
Newbie
Posts: 3
Joined: Wed Mar 08, 2006 12:00 am

Export to XML file does not show sub nodes.

Post by Marcel Horsthouse » Fri Oct 19, 2007 10:57 am

Hello,

When I export a tree to an XML file as follows :

var
tmp : TTreeData;
begin
Tree1.NoOwnerShapes := False;
tmp := TTreeDataXML.Create(Tree1);

tmp.SaveToFile('c:\text.xml');
end;

The XML does not show the sub nodes, alle the nodes are shown on the same level.

How can I export en import a Tree with the subnode information

eg :

Main
--Sub1
----Subsub11
----Subsub12
--Sub 2
----Subsub21
----Subsub22

is exported as

<tree>
-<node>Sub1</node>
-<node>Subsub11</node>
-<node>Subsub12</node>
-<node>Sub 2</node>
-<node>Subsub21</node>
-<node>Subsub22</node>
</tree>

in staid of

<tree>
-<node>
---Title= "Sub1"
---<subnodes>
-----<subnode>Subsub11</subnode>
-----<subnode>Subsub12</subnode>
---</subnodes>
-</node>
-<node>Sub 2
--<subnodes>
----<subnode>Subsub21</subnode>
----<subnode>Subsub22</subnode>
----</subnodes>
--</node>
</tree>

Thanks,

Marcel

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Fri Oct 19, 2007 6:31 pm

Hi,

Which version are you using? The latest shipped with teechart v8 corrected this issue. A tree is now exported as:

Code: Select all

<?xml version="1.0" ?>
<tree>
<node name="TreeNodeShape1" class="TTreeNodeShape">Root 1
	<node name="TreeNodeShape2" class="TTreeNodeShape">Child 1
		<node name="TreeNodeShape5" class="TTreeNodeShape">Child 1</node>
		<node name="TreeNodeShape6" class="TTreeNodeShape">Child 2</node>
	</node>
	<node name="TreeNodeShape3" class="TTreeNodeShape">Child 2</node>
	<node name="TreeNodeShape4" class="TTreeNodeShape">Child 3</node>
</node>
</tree>
Setting the compact property to true, it is exported as

Code: Select all

<?xml version="1.0" ?><tree><node name="TreeNodeShape1" class="TTreeNodeShape">Root 1<node name="TreeNodeShape2" class="TTreeNodeShape">Child 1<node name="TreeNodeShape5" class="TTreeNodeShape">Child 1</node><node name="TreeNodeShape6" class="TTreeNodeShape">Child 2</node></node><node name="TreeNodeShape3" class="TTreeNodeShape">Child 2</node><node name="TreeNodeShape4" class="TTreeNodeShape">Child 3</node></node></tree>
Regards,
tom

Marcel Horsthouse
Newbie
Newbie
Posts: 3
Joined: Wed Mar 08, 2006 12:00 am

Post by Marcel Horsthouse » Sat Oct 20, 2007 10:51 am

Hi Tom,

Thnak you for your reply.

I'm using version 7.

Time for an upgrade I think.

Marcel

Post Reply