Export to XML file does not show sub nodes.
Posted: 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
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