Solved

Microsoft.XMLDOM

Posted on 2002-07-07
4
753 Views
Last Modified: 2007-12-19
How can i use Microsoft.XMLDOM in Delphi?
is this posible?
0
Comment
Question by:Free4all
  • 2
4 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 50 total points
ID: 7135391
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
 
LVL 44

Expert Comment

by:bruintje
ID: 7135403
0
 
LVL 5

Expert Comment

by:Hamlet081299
ID: 7136424
In Delphi6 there is a TXMLDocument component.  By default this uses XML DOM.
0
 

Author Comment

by:Free4all
ID: 7137269
Thanks

Best Regards
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question