• 网络学院
  • IT资讯
  • 操作系统
  • 网络技术
  • 软件应用
  • 办公软件
  • 编程技术
  • 网站架设
  • 数据库类
  • 平面设计
  • 多媒体类
  • 游戏资讯
  • 教学论文
  • 认证考试
delphi学习:两种方法使用xml文档
  站点:
  • 首 页
  • 最新软件
  • 文章教程
  • 国内软件
  • 国外软件
  • 绿色软件
  • 源码下载
  • 字体下载
delphi学习:两种方法使用xml文档
软件发布 delphi学习:两种方法使用xml文档
网络软件 系统工具 应用软件 联络聊天 图形图像 多媒体类 行业软件 游戏娱乐 编程开发 安全相关 教育教学 数码软件 绿软下载
热门软件: QQ 瑞星 pplive e话通 木马克星 千千静听 office2000 五笔字根 Photoshop 视频分割
返回文章教程首页 >> 文章首页 >> 编程技术 >> Delphi教程 >> delphi学习:两种方法使用xml文档

delphi学习:两种方法使用xml文档

添加时间: 2006-2-28 7:22:02  作者: Delphi教程  阅读次数:89   来源: http://www.d9soft.com

       

  使用xml broker, 是delphi 内置的。例: 
  unit ShowXML; 
  interface 
  uses Classes HTTPApp Db DbClient Midas 
  XMLBrokr WebComp MidItems; 
  type 
  TCustomShowXMLButton = class(TXMLButton IScriptComponent) 
  protected 
  XMLMethodName: string; 
  { IScriptComponent } 
  procedure AddElements(AddIntf: IAddScriptElements); 
  function GetSubComponents: TObject; 
  { IWebContent implementation } 
  function ImplContent(Options: TWebContentOptions; 
  ParentLayout: TLayout): string; override; 
  end; 
  TShowXMLButton = class(TCustomShowXMLButton) 
  public 
  constructor Create(AOwner: TComponent); override; 
  published 
  property Custom; 
  property Style; 
  property StyleRule; 
  property Caption; 
  property XMLBroker; 
  property XMLUseParent; 
  end; 
  TShowDeltaButton = class(TCustomShowXMLButton) 
  public 
  constructor Create(AOwner: TComponent); override; 
  published 
  property Custom; 
  property Style; 
  property StyleRule; 
  property Caption; 
  property XMLBroker; 
  property XMLUseParent; 
  end; 
  implementation 
  uses sysutils MidProd; 
  resourcestring 
  sShowXML = 'Show XML'; 
  sShowDelta = 'Show Delta'; 
  procedure TCustomShowXMLButton.AddElements( 
  AddIntf: IAddScriptElements); 
  begin 

  AddIntf.AddIncludeFile('xmlshow.js'); 
  end; 
  function TCustomShowXMLButton.GetSubComponents: TObject; 
  begin 
  Result := nil; 
  end; 
  function TCustomShowXMLButton.ImplContent(Options: TWebContentOptions; 
  ParentLayout: TLayout): string; 
  var 
  Attrs: string; 
  Intf: ILayoutWebContent; 
  FormVarName: string; 
  RowSetVarName: string; 
  begin 
  AddQuotedAttrib(Attrs 'NAME' Name); 
  AddQuotedAttrib(Attrs 'STYLE' Style); 
  AddQuotedAttrib(Attrs 'CLASS' StyleRule); 
  AddQuotedAttrib(Attrs 'VALUE' Self.Caption); 
  AddCustomAttrib(Attrs Custom); 
  if Assigned(XMLData.XMLBroker) then 
  begin 
  FormVarName := XMLData.XMLBroker.SubmitFormVarName; 
  RowSetVarName := XMLData.XMLBroker.RowSetVarName(nil); // Row row set var name 
  end; 
  if not (coNoScript in Options.Flags) then 
  Result := 
  Format(''#13#10 
  [Attrs RowSetVarName XMLMethodName sXMLReadyVar]) 
  else 
  Result := 
  Format(''#13#10 
  [Attrs]); 
  if Assigned(ParentLayout) and ParentLayout.GetInterface(ILayoutWebContent Intf) then 
  Result := Intf.LayoutButton(Result GetLayoutAttributes); 
  end; 
  { TShowXMLButton } 
  constructor TShowXMLButton.Create(AOwner: TComponent); 
  begin 
  inherited; 
  DefaultCaption := sShowXML; 
  XMLMethodName := 'root'; 

  end; 
  { TShowDeltaButton } 
  constructor TShowDeltaButton.Create(AOwner: TComponent); 
  begin 
  inherited; 
  DefaultCaption := sShowDelta; 
  XMLMethodName := 'getDelta()'; 
  end; 
  另一种方法使用msxml.dll 如下: 
  .... 
  .... 
  procedure TDHEDForm.OpenBtnClick(Sender: TObject); 
  var 
  pVIn : OleVariant; 
  Prompt : OleVariant; 
  begin 
  pVIn := ''; 
  Prompt := True; 
  DHtmlEdit1.LoadDocument(pVIn Prompt); 
  end; 
  procedure TDHEDForm.SaveBtnClick(Sender: TObject); 
  var 
  vo vb : OleVariant; 
  begin 
  vo := DHTMLEdit1.CurrentDocumentPath; 
  if (vo <> '') then 
  begin 
  vb := false; 
  end 
  else 
  begin 
  vo := ''; 
  vb := true; 
  end; 
  DHTMLEdit1.SaveDocument(vo vb); 
  end; 
  procedure TDHEDForm.SaveAsClick(Sender: TObject); 
  var 
  vo vb : OleVariant; 
  begin 
  vo := ''; 
  vb := true; 
  DHTMLEdit1.SaveDocument(vo vb); 
  end; 
  ...
  //本文为转贴,作者不详,仅供大家参考

 

 

上下文章:

 

上一篇文章: 开发基于DCOM的局域网聊天室(一) 下一篇文章: Delphi与Word之间的融合技术

相关文章:

  • vista隐蔽的注册表垃圾清理方法
  • Vista系统的官方优化指南文档下载
  • 使用搜狗音乐盒下载歌曲,快带飚的体验
  • 教你如何使用Procmail 过滤mail病毒
  • 在局域网中配置Vlan的基本方法

相关软件:

  • 21互联学习通 1.0
  • 全国计算机等级考试模拟软件(2006年全年使用)二级Visual Basic V9.0
  • 学习方法宝典 2006 新春贺年版
  • All AHM Triton Tools 2002 Borland Delphi V7.0
  • 佐尔表达式控件 For DELPHI 7.0 V3.1.12
  • iWeboffice2003文档控件 V3.0 JSP版

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • ASP源码
  • PHP源码
  • Net源码
  • JSP 源码

编程技术分类导航

  • ASP & ASP.NET教程
  • PHP教程
  • JSP教程
  • C/C++教程
  • VB & VB.NET教程
  • VC教程
  • Delphi教程
  • BCB教程
  • VFP教程
  • PB教程
  • JAVA教程
  • XML教程
  • C#教程
  • CGI教程

本类经典文章推荐

  • Delphi的两个实用技巧(1)播放Flash
  • Delphi的两个实用技巧(2)巧用Wind...
  • delphi实例编程之--制作可随处拖放...
  • 关于VisiBroker For Delphi的使用...
  • 关于VisiBroker For Delphi的使用...
  • 关于VisiBroker For Delphi的使用...
  • 在线播放器DIY
  • Delphi让你发送Flash电子邮件
  • 在窗口标题区添加按钮
  • 用Delphi 6编程实现自动标注汉语拼...

Delphi教程阅读排行

  • Delphi7从入门到精通之历数Delphi...
  • Delphi的两个实用技巧(1)播放Flash
  • Delphi7从入门到精通之认识Delphi...
  • delphi实例编程之--制作可随处拖放...
  • Delphi控件,我们也可以(1)
  • Delphi的两个实用技巧(2)巧用Wind...
  • 在线播放器DIY
  • Delphi控件,我们也可以(2)
  • Spcomm串口控件的例程
  • 用Delphi + DirectX开发简单RPG游...

编程技术阅读总排行

  • VB入门教程之一
  • Java连接数据库实例
  • 第二章 PowerBuilder 入门之创建新...
  • VC++之List Box/Check List Box控...
  • 第一章 什么是PowerBuilder
  • VC++ List Ctrl控件
  • VC++ Combo Box/Combo Box Ex控件
  • 学C++不得不看的一篇文章
  • VB入门教程之二
  • VC++之Button控件

广告位置

字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 回到顶部

关于我们 | 版权声明 | 免责条款 | 广告联系 | 软件发布 | 下载帮助 | 下载排行 | 网站地图 | 特别鸣谢 | 友情连接

copyright; 2005-2008 D9soft.com 第九软件网 版权所有