Hello,

I have been trying to study the examples bundled with xerces. I have a few
questions after trying to use the code into a small application I tried
creating:
If you could answer or guide me to resources to understand these I would be
extremely grateful.

1) I get a null pointer exception in the lines of code below:
    First-chance exception at 0x1202368a in xerces_test.exe: 0xC0000005:
Access violation reading location 0x00000000.
Unhandled exception at 0x1202368a in xerces_test.exe: 0xC0000005: Access
violation reading location 0x00000000.

     // Instantiate the DOM parser.
    static const XMLCh gLS[] = { chLatin_L, chLatin_S, chNull};
    DOMImplementation *impl =
DOMImplementationRegistry::getDOMImplementation(gLS);

In the above lines of code, I could not follow the concept of using a const
XMLCh. (I did read about ASCII conversion and 16-character UniCode
conversion. But I don't know why this should throw a null point exception.


2) In the sample, there are many lines of code that use the
XERCES_STD_QUALIFIER, for example-

  XERCES_STD_QUALIFIER cout << xmlFile << ": " << duration << " ms ("
                 << elementCount << " elems)." << XERCES_STD_QUALIFIER endl;

If one doesn't incorporate this and simply use cout instead, is it wrong ?


3) Instead of using the StrX object declared in the DOMCount.hpp header, can
I use the transcode function like:
char* XMLCh_to_String( const XMLCh* toTranscode )
{
    return XMLString::transcode(toTranscode);
}

Reply via email to