Hi,

we have problems with XMLString::transcode() within our
overridden ContentHandler::characters() function. At the
moment we use a construct like the following:

void SaxHandler::characters(const XMLCh * const chars, const unsigned length)
{
    char const*const contentsTranscoded(XMLString::transcode(chars));
    // handle the case where contentsTranscoded == 0
    currentContents_ += contentsTranscoded;
    delete [] contentsTranscoded;
}

(currentContents_ is std::string member of the SaxHandler class.)

If the chunks are small, say about 100 characters, the above
method seems to work (in fact it seems to work well for chunks
with about 15000 characters). However for large chunks of data
(length of about 40000 characters), the delete crashes.

1) Does the parser (created with XMLReaderFactory::createXMLReader())
   handle these large chunks well?

2) Is there a limitation in XMLString::transcode(const XMLCh *) wrt
   to the length of the string?

3) Can XMLString::transcode() possibly overwrite the end of the
   char array (which it has allocated)?

4) Is the above piece of code correct? If not: how should we modify
   the code?

We are using Xerces 2.0.0 on AIX.

Kind regards
    Ingolf
-- 

Ingolf Steinbach                       Jena-Optronik GmbH
[EMAIL PROTECTED]       ++49 3641 200-147
PGP: 0x7B3B5661  213C 828E 0C92 16B5  05D0 4D5B A324 EC04

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

Reply via email to