求delphi操作xml文件的例子、技术资料!谢了![email protected]
解决方案 »
- delphi7 中的combox怎么能设置成只能选择不能输入的?
- 发布delphi程序(build with runtime package)要带哪些文件?
- 為您提供專業的畢業設計指導、修改服務
- 救命啊!!!为什么执行命令行程序一调试就失败
- 谁知道怎么一个象网吧管理系统那样的锁定屏幕和键盘的窗体,要用什么api函数么?
- activeX 問題 : 網頁中的 javascript 如何調用 ActiveX 中的函數.
- 大家说说TreeView控件各个方法的区别!!!谢谢
- 求英文版深圳宝安地地图
- 为什么我的EXE文件只有300K,而运行的时候竟然要12M的内存?太夸张了吧
- 求助-关于socket的问题!
- 关于access数据库备份的一个简单问题?
- 严重提问,急急急急
var
xmlNode,xmlchildNode: IXMLNode;
icol,irow,cx,cy:integer;
iWidth:integer;
i:integer;
begin
XMLDocument1.Active :=true;
XMLDocument1.LoadFromStream(wsXMLHeader,xetUnknown);
if XMLDocument1.IsEmptyDoc then exit;
xmlNode:=XMLDocument1.DocumentElement;
if xmlNode=nil then exit;
if xmlNode.NodeName<>'dust' then exit;
xmlNode:=xmlNode.ChildNodes.First;
while xmlNode<>nil do
begin
if xmlNode.NodeName='colcount' then
begin
Grid.ColCount :=strtoint(xmlNode.NodeValue);
for i:=0 to Grid.ColCount -1 do
FColFieldList.Add('none');
end;
if xmlNode.NodeName='rowcount' then
Grid.RowCount:=strtoint(xmlNode.NodeValue);
if xmlNode.NodeName='fixedcol' then
Grid.FixedCols:=strtoint(xmlNode.NodeValue);
if xmlNode.NodeName='fixedrow' then
Grid.FixedRows:=strtoint(xmlNode.NodeValue);
if xmlNode.NodeName='defaultwidth' then
Grid.DefaultColWidth:=strtoint(xmlNode.NodeValue); if xmlNode.NodeName='colwidth' then
begin
icol:=strtoint(xmlNode.Attributes['col']);
iWidth:=strtoint(xmlNode.Attributes['width']);
Grid.ColWidths[icol]:=iWidth;
end;
if xmlNode.NodeName='item' then
begin
if xmlNode.HasChildNodes then
begin
xmlchildNode:=xmlNode.ChildNodes.First;
while xmlChildNode<>nil do
begin
if xmlChildNode.NodeName='cells' then
begin
icol:=strtoint(xmlChildNode.Attributes['col']);
irow:=strtoint(xmlChildNode.Attributes['row']);
Grid.Cells[icol,irow]:=xmlChildNode.Attributes['caption'];
cx:=strtoint(xmlChildNode.Attributes['colx']);
cy:=strtoint(xmlChildNode.Attributes['rowy']);
if not ((cx=0) and (cy=0)) then
Grid.MergeCells(iCol,iRow,cx,cy);
end;
if xmlChildNode.NodeName='fields' then
begin
i:= strtoint(xmlChildNode.Attributes['col']);
if (i>=0) and (i<FcolFieldList.Count) then
FColFieldList.Strings[i]:=xmlChildNode.Attributes['name'];
end;
xmlChildNode:=xmlChildNode.NextSibling;
end;
end;
end;
xmlNode:=xmlNode.NextSibling;
end;end;这是我的一个读取xml文档对TMS的表格进行设置的例子
C:\Program Files\Borland\Delphi7\Demos\DbClx\mybasexplorer
http://www.delphibbs.com/delphibbs/DispQ.asp?LID=1819735