Sean B. Durkin
Sean B. Durkin

Reputation: 12729

Obtain IXMLDOMDocument2 from IXMLDocument

I am using Delphi 2010 with only the stock standard VCL libraries. The target system is win32.

If I have a reference to an IXMLDocument, how can I obtain an IXMLDOMDocument2 interface to the underlying object that IXMLDocument wraps?

Upvotes: 1

Views: 837

Answers (1)

Ondrej Kelle
Ondrej Kelle

Reputation: 37221

function GetXMLDOMDocument2(const XMLDocument: IXMLDocument): IXMLDOMDocument2;
begin
  Result := (XMLDocument.DOMDocument as IXMLDOMNodeRef).GetXMLDOMNode as IXMLDOMDocument2;
end;

Upvotes: 7

Related Questions