tng         2002/11/12 09:50:48

  Modified:    c/samples/DOMCount DOMCount.cpp
  Log:
  DOM Message: make use of the non-standard extension 
DOMImplementation::loadDOMExceptionMsg
  to load the default error text message for the correspond Exception Code.
  
  Revision  Changes    Path
  1.33      +10 -4     xml-xerces/c/samples/DOMCount/DOMCount.cpp
  
  Index: DOMCount.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/DOMCount/DOMCount.cpp,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- DOMCount.cpp      8 Nov 2002 16:18:29 -0000       1.32
  +++ DOMCount.cpp      12 Nov 2002 17:50:48 -0000      1.33
  @@ -204,7 +204,7 @@
               // it will recognize the unicode character 0x85 as new line character
               // instead of regular character as specified in XML 1.0
               // do not turn this on unless really necessary
  -             
  +
                recognizeNEL = true;
           }
            else if (!strncmp(argV[argInd], "-locale=", 8))
  @@ -351,9 +351,15 @@
           }
           catch (const DOMException& toCatch)
           {
  +            const unsigned int maxChars = 2047;
  +            XMLCh errText[maxChars + 1];
  +
               cerr << "\nDOM Error during parsing: '" << xmlFile << "'\n"
  -                 << "DOMException code is:  \n"
  -                 << toCatch.code << "\n" << endl;
  +                 << "DOMException code is:  " << toCatch.code << endl;
  +
  +            if (DOMImplementation::loadDOMExceptionMsg(toCatch.code, errText, 
maxChars))
  +                 cerr << "Message is: " << StrX(errText) << endl;
  +
               errorOccurred = true;
               continue;
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to