Errors in loading xml file with inline reference to a dtd 
Author Message
 Errors in loading xml file with inline reference to a dtd

All,

    I have read so many user groups replies.  I have not yet seen one that
solve my problem.  I am retrieving a error with loading my xml using the
function loadxml.  I am using embedded Visual C++ and msxmlm.dll.  I have
seen some user groups responses saying I have to use an url when using
loadxml.  But in my case, I cannot use url.  I have to use a path locate on
the pocketpc.  I have also tried testing it by using paths on the desktop,
also, either way it should work.  However, I am having problems with
loadxml.  I am receiving an system error that I can find in the knowledge
base.  I receive this system error from IXMLDOMParseErrorPtr, -2146697211.
Below is the code I am using.  Any help is greatly appreciatated.  I have
tried using by schema and dtd.  And I receive the same error.

IObjectSafety* pSafety;
    DWORD dwSupport, dwEnabled;
    VARIANT_BOOL  isSuccessful;
    HRESULT hr;
    IXMLDOMNodePtr nextSibling;
    BSTR nodeName;
    CString strNodeName;

    hr=m_plDomDocument.CreateInstance(__uuidof(DOMDocument));
 if(FAILED(hr)) {
  cdaEXCEPT(C18_CREATE_INSTANCE, __FILE__, __LINE__, E_LOG + E_DEBUG +
E_SHUTDOWN);
  return;
 }
    hr= m_plDomDocument->QueryInterface(IID_IObjectSafety, (void**)
&pSafety);
 if(FAILED(hr)) {
  cdaEXCEPT(C18_QUERY_INTERFACE, __FILE__, __LINE__, E_LOG + E_DEBUG +
E_SHUTDOWN);
  return;
 }

 pSafety->GetInterfaceSafetyOptions(IID_IObjectSafety, &dwSupport,
&dwEnabled);
    pSafety->SetInterfaceSafetyOptions(IID_IObjectSafety, dwSupport, 0);
// m_DPMLFile="D:\\projects\\CDA\\DPML Files\\PFZ_Pregabalintestschxsd.xml";
 m_DPMLFile="D:\\projects\\CDA\\DPML Files\\PFZ_Pregabalintestdtd.xml";
 m_plDomDocument->put_validateOnParse(VARIANT_TRUE);
 m_plDomDocument->put_resolveExternals(VARIANT_TRUE);
 m_plDomDocument->put_preserveWhiteSpace(VARIANT_TRUE);

    HRESULT testhr=m_plDomDocument->load(m_DPMLFile, &isSuccessful);

    if (!isSuccessful) {
  IXMLDOMParseErrorPtr errPtr;
  m_plDomDocument->get_parseError(&errPtr);
  long myerror;
  errPtr->get_errorCode(&myerror);
  BSTR myreason;
  errPtr->get_reason(&myreason);
  long mynum;
  BSTR mysource;
  errPtr->get_srcText(&mysource);
  errPtr->get_line(&mynum);
  CString strReason=myreason;
  AfxMessageBox(strReason);

  cdaEXCEPT(C18_DPML_LOAD, __FILE__, __LINE__, E_LOG + E_DEBUG +
E_SHUTDOWN);
  return;
 }



Sat, 05 Mar 2005 04:40:05 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. DOCTYPE Node - External DTD Reference

2. Error loading a XML doc from IStream

3. GAC, references, XML file

4. Including a reference to a binary file in XML

5. adding stylesheet reference to given XML file with my C++ EXE

6. adding stylesheet reference to given XML file with my C++ EXE

7. Loading partial xml file

8. Loading xml file question

9. Announce: Save and load your MFC app files as XML

10. XML file i/o system error

11. creating xml schema programmatically from an an xml file without using ADO.NET

12. VC++ and XML, I want to retrieve an XML file from URL

 

 
Powered by phpBB® Forum Software