根节点有xmlns属性,为什么下面的user子节点中出现xmlns="" ??
代码是:procedure TForm1.btn1Click(Sender: TObject);
var
RootInt, NodeInt: IXMLNode;
XMLDocument1: TXMLDocument;
begin
XMLDocument1 := TXMLDocument.Create(self);
XMLDocument1.Active := False;
XMLDocument1.XML.Text := '';
XMLDocument1.Active := True;
XMLDocument1.Version := '1.0';
XMLDocument1.Encoding := 'GB2312';
XMLDocument1.Options := [doNodeAutoIndent];
RootInt := XMLDocument1.AddChild('test');
RootInt.Attributes['xmlns'] := 'x-schema:s_test.xml';
NodeInt := RootInt.AddChild('user');
ShowMessage(XMLDocument1.XML.Text);end;谢谢各位大虾!!
代码是:procedure TForm1.btn1Click(Sender: TObject);
var
RootInt, NodeInt: IXMLNode;
XMLDocument1: TXMLDocument;
begin
XMLDocument1 := TXMLDocument.Create(self);
XMLDocument1.Active := False;
XMLDocument1.XML.Text := '';
XMLDocument1.Active := True;
XMLDocument1.Version := '1.0';
XMLDocument1.Encoding := 'GB2312';
XMLDocument1.Options := [doNodeAutoIndent];
RootInt := XMLDocument1.AddChild('test');
RootInt.Attributes['xmlns'] := 'x-schema:s_test.xml';
NodeInt := RootInt.AddChild('user');
ShowMessage(XMLDocument1.XML.Text);end;谢谢各位大虾!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货