Solved

Microsoft.XMLDOM

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IdTelnet1DataAvailable handler freezes the Application 4 62
proper way to parse url in delphi 2 160
Delphi Form ownership 4 70
Strange behavior when a form is closed 6 49
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

943 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

10 Experts available now in Live!

Get 1:1 Help Now