Delphi与XML文档
同步程序案例
procedure TGetOrderThread.PostDB(webnr:WideString);
var
Err: String;
SetWebnr:WideString;
xmlDoc: IXMLDocument;
root: IXMLNode;
rowc: IXMLNode;//记录数
rows: IXMLNodeList;//主记录列表
row: IXMLNode;
drows: IXMLNodeList;//明细列表
drow: IXMLNode;
i,j,slhj,jlhj:integer;
djhj:real;
begin
//同步数据
xmlDoc := TXMLDocument.Create(nil);
try
xmlDoc.XML.Text:=Webnr;
xmlDoc.Active:=true;
root:=xmlDoc.DocumentElement;
rowc:=root.ChildNodes.FindNode('RowC');
if (rowc.NodeValue>0) and DBconn then
begin
rows:=root.ChildNodes.FindNode('RowS').ChildNodes;
//showmessage('记录数:'+rowc.NodeValue);
for i:=0 to rows.Count-1 do
begin
ADOConn.BeginTrans;
try
row:=rows.Nodes[i];
drows:=row.ChildNodes.FindNode('Drows').ChildNodes;
//showmessage(row.ChildValues['billno']+
// ' 明细记录数:'+inttostr(drows.Count));//显示订单号
if SHelper.Active then SHelper.Close;
SHelper.SQL.Text:=Format(selectStr,[row.ChildValues['billno']]);
SHelper.Open;
jlhj:=0;
slhj:=0;
djhj:=0;
&nb
相关文档:
wsdl.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<definitions name="MobilePhoneService"
targetNamespace="www.mobilephoneservice.com/MobilePhoneService-interface"
xmlns="http://schemas.xmlsoap.org/wsdl/"
  ......
......
声明
/// <summary>
/// XML文档
/// </summary>
XmlDocument xmldoc;
&n ......
数据通常是以 XML 格式提供给 Web 应用程序的。但是,XML 数据本质上是分层的,因此您可能希望能够在基于列表的控件中使用 XML 数据,如 GridView 或 DropDownList 控件。此演练演示如何将 XML 数据视为表格数据库表中的数据进行处理。
通过此演练,您将学会如何执行以下任务:
·使用数据源控件读取 XM ......
<?
/**
* xml2array() will convert the given XML text to an array in the XML structure.
* Link: http://www.bin-co.com/php/scripts/xml2array/
* Arguments : $contents - The XML text
* $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the ......