How to determine why the call to IXMLDOMDocument :: load () fails?

I am trying to debug what seems like an XML parsing problem in my code. I allocated it for the following code snippet:

HRESULT
CXmlDocument::Load(IStream* Stream)
{
    CComVariant xmlSource(static_cast<IUnknown*>(Stream));
    VARIANT_BOOL isSuccessful;
  * HRESULT hr = m_pXmlDoc->load(xmlSource, &isSuccessful);
    return (hr == S_FALSE) ? E_FAIL : hr;
}

Note. m_pXmlDochas type CComPtr<IXMLDOMDocument>.

It seems that the call IXMLDOMDocument::load()(marked as *) does not work - IOW, it returns S_FALSE.

I cannot log in load()to determine why it is failing because it is a COM call.

The MSDN page for this method does not seem to provide much understanding.

I have a few guesses:

  • XML is not correct.
  • XML file is too large (approximately 120 MB)
  • This is a memory problem (process size reaches 2 GB during a crash)
    • . , , WinXP, AFAIK, 2 ).

, ?

+5
2

DOM XML.

CComPtr<IXMLDOMParseError> pError;
CComBSTR sReason, sSource;
long nLine = 0, nColumn = 0;

m_pXmlDoc->get_parseError(&pError);
if(pError)
{
    pError->get_reason(&sReason);
    pError->get_srcText(&sSource);
    pError->get_line(&nLine);
    pError->get_linepos(&nColumn);
}

sReason . sSource XML. nLine nColumn , (iirc, , /).

+9

XML Proload() , , . .

, documentElement - null, load() .

0

All Articles