I have one implementation in Xerces C++ 2.8 where in I have this code:
>
>                         try
>                         {
>                         //const XMLCh* const bufID = NULL;
>                         const XMLCh *const bufId = _T("SPVoice");
>                         //static const TCHAR* bufID = "SPVoice";
>                         CT2CA pszConvertedAnsiString (m_XMLFileName);
>                         std::string strStd (pszConvertedAnsiString);
>
>                         const char* pStr = strStd.c_str();
>                         //char* TCHAR = StringToChar(m_XMLFileName);
>
> TRACE_INFO("CSPVXMLParserWrapper::CreateDOMTree() converted
> StringToChar");
>
>                         MemBufInputSource* memBufIS = new
> MemBufInputSource(
>                                  (const XMLByte *)pStr
>                                 ,strlen(pStr)
>                                 , bufId
>                                 , false
>                                 );
>
> TRACE_INFO("CSPVXMLParserWrapper::CreateDOMTree() formed
> MemBufInputSourceObject Successfully");
>
>                         m_pDOMParser->setDoNamespaces(false);
>                         TRACE_INFO("Entering
> CSPVXMLParserWrapper::CreateDOMTree() SetDoNamespace set to false");
>
>                         Wrapper4InputSource wrap(memBufIS, false);
>
>                         m_pDOMParser->parse(*memBufIS);
>                         }
>                         catch (...)
>                         {
>                         cstrTraceMsg.Format(_T("ERROR: Internal Error
> - Unexpected exception during parsing: %s "), m_XMLFileName);
>
>                         TRACE_ERROR(CLString(cstrTraceMsg),ERR_FAILURE);
>                         sifRetCode = ERR_FAILURE;
>                         m_strErrorString = _T("Generic Exception
> During Parsing the input XML File.Please check if the XML input
> conforms to the schema");
>
>                         }
>
> At the m_pDOMParser->parse(*memBufIS); The control goes into the catch
> block.
> Can you point out any probs in the code? Without the
> Wrapper4InputSource wrap(memBufIS, false);, this code was working in
> Xerces 2.2 of C++

Reply via email to