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

2016-01-29 14:13 45 1 收藏

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

【 tulaoshi.com - Delphi 】

 
使用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(Se

来源:https://www.tulaoshi.com/n/20160129/1492784.html

延伸阅读
标签: PS PS基础
想赋予你的扫街作品更多的情绪?后期可以让照片更加精彩。这次,我们通过两种不同的后期手法,打造两张风格不尽相同、却抒发着同样的怀旧情绪的扫街作品,快来看看我们是怎么做的吧。 修改前 修改后 手法一 制造颗粒 重回黑白时代 通过在photoshop中简单的5步后期,为街拍增添怀旧颗粒感,制作一张仿 佛是用ISO1600的胶片拍出的经典黑白老...
标签: flash教程
第一种方法,遮罩法。 遇到复杂的曲线时,遮罩就只能用刷子每一帧每一帧地画,每画完一帧,后一帧按F6,接着上一帧开始画!方法比较直观,而且显现的曲线就是和引导线的一样,但是显得有点繁锁! 第二种方法,AS法。 我这里写得AS比较简单!优点是去除了繁锁的画遮罩过程,犹其当引导线出现交叉时,更显方便,可能曲线放大很多时看会显出不平...
标签: 孕前
两种方法可以预防乳房变形 游川指出,怀孕后女性乳房内的荷尔蒙、脂肪和乳腺组织都会增加,从而使乳房明显变大。但女性生产完后,体内荷尔蒙量降低,脂肪和乳腺组织都快速减少,已经被撑大的乳房皮表自然就松垮下来了。所以,无论是否进行母乳喂养,女性的乳房都会有所下垂,因此可以预防。而对于已tuLaoShi.com经轻微下垂的乳房,可以进行局...
Excel怎么求和 求和 鼠标选中C1单元格,然后在C1单元格中输入“=A1+B1”,输入完毕后安下键盘上回车键即可求出结果。 批量求和 1、第一步骤使用单个求和将“A1和B1相加,结果在C1中”,也就是上面的单个求和步骤; 2、将鼠标移动到c1单元格的右下角,但鼠标变成黑色十字架形状后单击鼠标左键按住不放,拖动到C12单元格中后放开鼠标。 ...
标签: 皮肤护理
问答 图钉提问: 问题描述:我女朋友5天前在左臂接种了麻风疫苗,昨天下午在左臂接种了乙肝疫苗加强针,之前的乙肝五项检查她显示抗体弱.昨天晚上睡觉的时候她开始有点低烧,37度左右,今天早上她还是有点低烧,但是温度比昨天低了.这样的症状有什么负面效应么?谢谢解答啊,越详细越好啊,谢谢谢谢! 图老师解答: 你好,你朋友出现的发热是正常的,有...

经验教程

688

收藏

27
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部