//write by void<lc@zm.com.cn>
//param1 xnode:the XMLDocument root node,
//param2 tnode: Tree struct 's root node
//description: parse xml file to fill tree struct
void FillTree(_di_IXMLNode xnode,TTreeNode *tnode)
...{

_di_IXMLNodeList nodes=xnode->ChildNodes;
_di_IXMLNode curXnode;
TTreeNode *pt=tnode;
TTreeNode *pt1=tnode;
for(int n=0;n<nodes->Count;n++)
...{
curXnode=nodes->Nodes[n];
if( curXnode->GetHasChildNodes() )
...{
if(curXnode->GetIsTextElement())
pt1=TreeView->Items->AddChild(pt,(curXnode->GetNodeName()+" "+curXnode->GetText()) ) ;
else
...{
if(curXnode->GetNodeName()==WideString("description" )||curXnode->GetNodeName()==(wchar_t*)("title"))
...{
xmlobj *mobj=new xmlobj;
mobj->xmlstr =curXnode->GetXML(); //
pt1=TreeView->Items->AddChildObject(pt,string(curXnode->GetNodeName()+" type="+string(curXnode->GetNodeType())),mobj ) ;
}
else
pt1=TreeView->Items->AddChild(pt,string(curXnode->GetNodeName()+" type="+string(curXnode->GetNodeType()))) ;
}
FillTree(curXnode,pt1);
}
}
}








