<speakword color="#888888" background-color="#008000" >
  <i>
     <b>Hello,Fanciex!</b> 
  </i>  
</speakword>
我要從這個XML串中提取出各個元素如用(dom)應如何做?給出完整例子加100分。

解决方案 »

  1.   

    d6中有个控件叫做xmldocument,可以方便地进行处理.你可以参考一下这个控件的帮助.
      

  2.   

    我参考xmldocument编了一个但run时老提示:Invalid variant type conversion 错误。
    xmldocument1.xml为:
    -------------------------------------------
    <speakword color="88ff99" background-color="0088000" b="true" i="true" >
    "Hello,Fanciex!"</speakword>
    ----------------------------------
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, xmldom, XMLIntf, StdCtrls, msxmldom, XMLDoc;type
      TForm1 = class(TForm)
        XMLDocument1: TXMLDocument;
        Edit1: TEdit;
        Edit2: TEdit;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
    edit1.Text:=xmldocument1.DocumentElement['speakword'];
    end;end.
    --------------------
      

  3.   

    I will add  FEN!!!!!PLS HELP ME UP!!!ERERY UP 5'  !!!!