我需要两个从两个 XML 动态创建树视图:
从第一个 xml 开始,父节点将是项目 A(即节点的文本),子节点将是所有文件夹,直到来自第二个 xml 的电子邮件,并且第二个 xml 的路径在第一个 xml 中。
请帮助我真的卡住了吗?
XML 1:
- <Projects>
- <Project id="PROJ_1">
<Name>Project A</Name>
<emailfile>D:\tree\PEMS-Offline-Application\XMLFiles\PROJ_01_EMAILS.xml</emailfile>
</Project>
- <Project id="PROJ_2">
<Name>Project B</Name>
<emailfile>D:\tree\PEMS-Offline-Application\XMLFiles\PROJ_02_EMAILS.xml</emailfile>
</Project>
- <Project id="PROJ_3">
<Name>Project C</Name>
<emailfile>D:\tree\PEMS-Offline-Application\XMLFiles\PROJ_03_EMAILS.xml</emailfile>
</Project>
</Projects>
XML 2:
- <root>
- <Project id="PROJ_1">
- <folder id="F1.1">
- <incoming id="incoming">
- <emails>
- <email ID="01.1">
<subject>God Is Great</subject>
<to>a.mundra@adapt.com</to>
<cc>a.dhiwan@adapt.com</cc>
<emaildate>20/04/2013</emaildate>
<filepath>C:\currentProject\PEMS-Offline-Application\XMLFiles\PROJ_01_EMAILS.xml</filepath>
</email>
- <email ID="01.2">
<subject>God</subject>
<to>a1.mundra@adapt.com</to>
<cc>a2.dhiwan@adapt.com</cc>
<emaildate>20/05/2013</emaildate>
<filepath>C:\currentProject\PEMS-Offline-Application\XMLFiles\PROJ_01_EMAILS.xml</filepath>
</email>
</emails>
</incoming>
- <outgoing id="outgoing">
- <emails>
<email ID="01.1" />
<subject>God Is Great</subject>
\
<to />
<cc />
<emaildate />
<filepath />
<email ID="01.2" />
<subject>God</subject>
\
<to />
<cc />
<emaildate />
<filepath />
<email ID="01.2" />
<subject>hi</subject>
\
<to />
<cc />
<emaildate />
<filepath />
</emails>
</outgoing>
</folder>
- <folder id="F1.2">
- <incoming id="incoming">
- <emails>
- <email ID="01.1">
<subject>God Is Great</subject>
<to>a.mundra@adapt.com</to>
<cc>a.dhiwan@adapt.com</cc>
<emaildate>20/04/2013</emaildate>
<filepath>C:\currentProject\PEMS-Offline-Application\XMLFiles\PROJ_01_EMAILS.xml</filepath>
</email>
- <email ID="01.2">
<subject>God</subject>
<to>a1.mundra@adapt.com</to>
<cc>a2.dhiwan@adapt.com</cc>
<emaildate>20/05/2013</emaildate>
<filepath>C:\currentProject\PEMS-Offline-Application\XMLFiles\PROJ_01_EMAILS.xml</filepath>
</email>
</emails>
</incoming>
- <outgoing id="outgoing">
- <emails>
<email ID="01.1" />
<subject>God Is Great</subject>
\
<to />
<cc />
<emaildate />
<filepath />
<email ID="01.2" />
<subject>God</subject>
\
<to />
<cc />
<emaildate />
<filepath />
<email ID="01.2" />
<subject>hi</subject>
\
<to />
<cc />
<emaildate />
<filepath />
</emails>
</outgoing>
</folder>
- <folder id="F1.3">
- <incoming id="incoming">
- <emails>
- <email ID="01.1">
<subject>God Is Great</subject>
<to>a.mundra@adapt.com</to>
<cc>a.dhiwan@adapt.com</cc>
<emaildate>20/04/2013</emaildate>
<filepath>C:\currentProject\PEMS-Offline-Application\XMLFiles\PROJ_01_EMAILS.xml</filepath>
</email>
- <email ID="01.2">
<subject>God</subject>
<to>a1.mundra@adapt.com</to>
<cc>a2.dhiwan@adapt.com</cc>
<emaildate>20/05/2013</emaildate>
<filepath>C:\currentProject\PEMS-Offline-Application\XMLFiles\PROJ_01_EMAILS.xml</filepath>
</email>
</emails>
</incoming>
- <outgoing id="outgoing">
- <emails>
<email ID="01.1" />
<subject>God Is Great</subject>
\
<to />
<cc />
<emaildate />
<filepath />
<email ID="01.2" />
<subject>God</subject>
\
<to />
<cc />
<emaildate />
<filepath />
<email ID="01.2" />
<subject>hi</subject>
\
<to />
<cc />
<emaildate />
<filepath />
</emails>
</outgoing>
</folder>
</Project>
</root>