function TXmlDocManager.GetDestTable(TableName:string): TdestTable;
var
tablenode: IXMLnode;
node: Ixmlnode;
I, j: integer;
begin
node:=XmlDocu.DocumentElement;
node:=node.ChildNodes['Tables'];
for i:=0 to node.ChildNodes.Count-1do
begin
tablenode:=node.ChildNodes;
if tablenode.Attributes['tableName']=TableName then
begin
Result.tablename:=tablenode.AttributeNodes['tableName'].Text;
Result.Description := tablenode.AttributeNodes['description'].Text;
//sourcetable
Result.Source.tableName :=tablenode.ChildNodes['sourceTable'].AttributeNodes['tableName'].Text ;
Result.Source.description :=tablenode.ChildNodes['sourceTable'].AttributeNodes['description'].Text ;
Result.Source.where :=tablenode.ChildNodes['sourceTable'].AttributeNodes['where'].Text ;
//links
for j:=0 to tablenode.ChildNodes['Links'].ChildNodes.Count-1do
begin
setLength(Result.links,length(Result.links)+1);
Result.links[j].TableName :=tablenode.ChildNodes['Links'].childnodes[j].AttributeNodes['tableName'].Text ;
Result.links[j].Description :=tablenode.ChildNodes['Links'].childnodes[j].AttributeNodes['description'].Text ;
Result.links[j].relation :=tablenode.ChildNodes['Links'].childnodes[j].AttributeNodes['relation'].Text ;
end;
break;
end;
end;
procedure TXmlDocManager.SetDestDatabaseConnectionStr(Provider,DestServerName,
DestCatalog, DestUserName, DestPassword: string);
var
node,subnode: IXMLnode;
begin
node := XmlDocu.DocumentElement;
subnode := node.ChildNodes['DestDatabase'];
subnode.SetAttribute('provider', Provider);
subnode.SetAttribute('serverName', DestserverName);
subnode.SetAttribute('catalog', DestCatalog);
subnode.SetAttribute('userName', DestUserName);
subnode.SetAttribute('password', DestPassword);
Changed:=True;
end;
procedure TXmlDocManager.GetDestDatabaseConnectionStr(var Provider,DestServerName,
DestCatalog, DestUserName, DestPassword: string);
var
node,subnode: IXMLnode;
begin
node := XmlDocu.DocumentElement;
subnode := node.ChildNodes['DestDatabase'];
Provider:= subnode.AttributeNodes['provider'].Text;
DestServerName := subnode.AttributeNodes['serverName'].Text;
DestCatalog := subnode.AttributeNodes['catalog'].Text;
DestUserName := subnode.AttributeNodes['userName'].Text;
DestPassword := subnode.AttributeNodes['password'].Text;
end;
end;