Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I view the contents of an IXMLDOMElementPtr when building an XML file?

Tags:

c++

dom

xml

I'm using IXMLDOM in MSXML 6 to build an XML file in a C++ MFC application. Is there a way to see the contents of the xml document while it is in memory?

For example, an XPATH query is failing about halfway through creating the file. How would I view the entire contents of the xml doc?

Thanks!

like image 475
Steve Duitsman Avatar asked Oct 28 '25 17:10

Steve Duitsman


1 Answers

IXMLDOMElement derives from IXMLDOMNode, and IXMLDOMNode has an xml property that you can use to get the textual representation of the XML in memory.

IXMLDOMElementPtr spElement = ...;
_bstr_t xmlContents = spElement->xml();

If you're looking for a way to see the contents of the XML in the debugger without changing existing code to add this call, that may be possible, but I'm not exactly sure where to look.

like image 138
Matt Dillard Avatar answered Oct 31 '25 07:10

Matt Dillard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!