Memory fault in DOMImplementationRegistry::getDOMImplementation
---------------------------------------------------------------

                 Key: XERCESC-1843
                 URL: https://issues.apache.org/jira/browse/XERCESC-1843
             Project: Xerces-C++
          Issue Type: Bug
          Components: DOM
    Affects Versions: 2.6.0
         Environment: HP-UX 
            Reporter: Ravi Binwade
            Priority: Blocker


Hi,
I am stuck with memory fault problem in 
DOMImplementationRegistry::getDOMImplementation for last 2 weeks :(
First , I parse xml buffer string using SAXParser and then create a DOMTree.
I need to return DOMDocument node from my parse function.

Following is my code : 

DOMDocument* BaseRecord::Pars(const char* buffer, int length, bool& success)
{
DOMDocument* Doc=NULL;
XMLPlatformUtils::Initialize(); 
SAXParser* parser = new SAXParser();
MemBufInputSource* inputSource = new MemBufInputSource((const 
XMLByte*)buffer,strle(buffer),"test", false);
parser->parse(*inputSource);
success=(parser->getErrorCount()==0);
XMLCh tempStr[100];
XMLString::transcode("LS", tempStr, 99);
Wrapper4InputSource domISWrapper(inputSource,false);
DOMImplementation *impl = 
DOMImplementationRegistry::getDOMImplementation(tempStr); // Segment fault here
DOMBuilder* domparser = 
((DOMImplementationLS*)impl)->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS,
 0);       
Doc = domparser->parse(domISWrapper);   
domparser->release();
XMLPlatformUtils::Terminate();
delete parser;
delete docHandler;
delete inputSource;
return Doc;
}

Following is data in buffer : 
<KeyFields>
    <Field name="FIELD_NAME">
        <Value>event</Value>
    </Field>
    <Field name="ERROR_SWITCH">
        <Value>5</Value>
    </Field>
</KeyFields>

I tried using XercesDomParser but found a memory leak in its implementation.
So , I am left with only option of using SAXParser.

Can you please help ?

Many thanks.

~ Ravi Binwade


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to