Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 772
  • Last Modified:

Microsoft.XMLDOM

How can i use Microsoft.XMLDOM in Delphi?
is this posible?
0
Free4all
Asked:
Free4all
  • 2
1 Solution
 
bruintjeCommented:
Hi Free4all,

you can try something like

var
  oXMLDoc, oRoot, oNode, oChild, oPI, oXMLCDATASection: OleVariant;
begin
  try
    oXMLDoc := VarNull;
    oXMLDoc := CreateOleObject('Microsoft.XMLDOM');
    oRoot := oXMLDoc.CreateElement('ROWSET');
    oXMLDoc.AppendChild(oRoot);
    oNode := oXMLDoc.CreateElement('ROW');
    oXMLDoc.DocumentElement.AppendChild(oNode);
    oChild := oXMLDoc.CreateNode('element', 'name', 'test');
    oNode.AppendChild(oChild);
    oPI := oXMLDoc.CreateProcessingInstruction('xml', 'version="1.0"');
    // <?xml version="1.0" encoding="iso-8859-1"?>
    oXMLDoc.InsertBefore(oPI, oXMLDoc.ChildNodes.Item[0]);
  finally
    oXMLDoc := VarNull;
    oRoot   := VarNull;
    oNode   := VarNull;
    oChild  := VarNull;
    oPI     := VarNull;
  end;
end;


HAGD:O)Bruintje
0
 
Hamlet081299Commented:
In Delphi6 there is a TXMLDocument component.  By default this uses XML DOM.
0
 
Free4allAuthor Commented:
Thanks

Best Regards
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now