tags:

views:

251

answers:

1

I've loaded an XML into a MSXML DOM node hierarchy, manipulated some of the nodes, and now I'd like to create an XML as a string from the node hierarchy. I know MSXML exposes a save functionality through IXMLDOMDocument.save(), however it is: 1) non-standard (i.e. not specified by W3C), and 2) apparently only writing to files (e.g. not to streams).

Now, being non-standard is not really a deal breaker for me, but no stream output is. Do anyone know how to solve this, or do I have to write my own method? Thanks!

+1  A: 

Where the documentation states "or a custom object that supports persistence" it means an implementation of IStream.

BTW, I can't find any standards defining how a DOM should be saved so I doubt there is any need to worry about using a the "non-standard" save method.

AnthonyWJones
Thanks Anthony! As it turns out, I'm better at asking questions at SO than reading the documentation... And I guess your right about the DOM standard. Haven't read the W3C spec exhaustively, but MSXML should support the entire standard, and since I haven't found a standard supporting implementation among the MSXML methods, I guess there is no such method defined by the DOM standard. Quite unfortunate, if you ask me.
conciliator
@conciliator: Are you trying to write portable C++ code?
AnthonyWJones
@Anthony: nah, I'm just in the mood for being compliant... BTW, man do I suck at reading manuals! IXMLDOMDocument.XML contains everything I need... :)
conciliator