You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Orswanic <or...@hotmail.com> on 2002/07/02 11:31:03 UTC

I have some problems.

    Hi, I am a Chinese coder, I meet some problems in using the Xerces-C++.
    I used xerces-c1_7_0-win32 and programmed codes like there for some aims in test: 

//...
//*****************************************
#include <xercesc/dom/DOM.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/dom/DOMString.hpp>

#include <iostream>
using namespace std; 

int main(int argc, char* argv[])
{
 try
 {
  XMLPlatformUtils::Initialize();
 }
 catch(const XMLException& toCatch)
 {
  cerr << "Some errors ocurred at runtime. " << endl;
  return 1;
 }
 //------------------------------------------

 XMLCh xc_1 = '姜'; 
 int n_1 = static_cast<int>(xc_1); 
 const char* pc_1 = "姜"; 
 unsigned char uc_0 = pc_1[0]; 
 unsigned char uc_1 = pc_1[1]; 
 int n_2 = 0; 
 n_2 = static_cast<int>(uc_0 << 8) + static_cast<int>(uc_1); 
 cout << "现在开始输出: " << endl; 
 cout << "n_1 = "; 
 cout << n_1 << endl; 
 cout << "n_2 = "; 
 cout << n_2 << endl; 
 DOMString dstr_1(pc_1); 
 //cout << "DOMString的长度为: "; 
 //cout << dstr_1.length() << endl; 

 XMLPlatformUtils::Terminate(); 
 return(0); 
}
//*****************************************

  A exception ocurred on running, the content of exception is:
  "0x120167f0" reference "0x00000000" and this memory can't be "read".
  I am sorry for my poor English. I can't express my problem clearly, but I wish you may get it and give me the answer.

Re: I have some problems.

Posted by Tinny Ng <tn...@ca.ibm.com>.
See http://xml.apache.org/xerces-c/faq-parse.html#faq-6

Tinny
  ----- Original Message ----- 
  From: Orswanic 
  To: xerces-c-dev@xml.apache.org 
  Sent: Tuesday, July 02, 2002 5:31 AM
  Subject: I have some problems.


      Hi, I am a Chinese coder, I meet some problems in using the Xerces-C++.
      I used xerces-c1_7_0-win32 and programmed codes like there for some aims in test: 

  //...
  //*****************************************
  #include <xercesc/dom/DOM.hpp>
  #include <xercesc/util/PlatformUtils.hpp>
  #include <xercesc/util/XMLString.hpp>
  #include <xercesc/dom/DOMString.hpp>

  #include <iostream>
  using namespace std; 

  int main(int argc, char* argv[])
  {
   try
   {
    XMLPlatformUtils::Initialize();
   }
   catch(const XMLException& toCatch)
   {
    cerr << "Some errors ocurred at runtime. " << endl;
    return 1;
   }
   //------------------------------------------

   XMLCh xc_1 = '姜'; 
   int n_1 = static_cast<int>(xc_1); 
   const char* pc_1 = "姜"; 
   unsigned char uc_0 = pc_1[0]; 
   unsigned char uc_1 = pc_1[1]; 
   int n_2 = 0; 
   n_2 = static_cast<int>(uc_0 << 8) + static_cast<int>(uc_1); 
   cout << "现在开始输出: " << endl; 
   cout << "n_1 = "; 
   cout << n_1 << endl; 
   cout << "n_2 = "; 
   cout << n_2 << endl; 
   DOMString dstr_1(pc_1); 
   //cout << "DOMString的长度为: "; 
   //cout << dstr_1.length() << endl; 

   XMLPlatformUtils::Terminate(); 
   return(0); 
  }
  //*****************************************

    A exception ocurred on running, the content of exception is:
    "0x120167f0" reference "0x00000000" and this memory can't be "read".
    I am sorry for my poor English. I can't express my problem clearly, but I wish you may get it and give me the answer.