Solved

Microsoft.XMLDOM

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now