Question

Where does MSXML IXMLDOMDocument::save save? I mean when it's called with a file name argument.

CComPtr< IXMLDOMDocument > doc;
p->get_doc( &doc );
doc->save( CComVariant( L"C:\\pathto\\mydoc.xml" ) );

Where will "C:\pathto\mydoc.xml" be?

Consider that the XMLDOMDocument is out of process, in this case located on a different physical machine. Will it save it to "C:..." of the calling machine, or the server hosting the COM object?

Was it helpful?

Solution

It will be at the location you give it on your local system. The save function interprets its argument as a path and file name if you give it a string, so that's the file that the object saves its contents into. The file doesn't need to exist beforehand, but the directories should.

In addition to strings, the save function can also accept certain other types of arguments, including "an ASP Response object, an XML document object, or a custom object that supports persistence." See the documentation for details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top