Solved

Microsoft.XMLDOM

Posted on 2002-07-07
4
751 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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