Yes, you are correct. That should have been an *||* and not an *&&*. Sorry
about that. I will fix it immediately and check it in. This of course is in
the 3.1.0/1.1.0 code, so this bug will have to go on our list of things to
fix in any 3.1.x/1.1.x update to the reference release.

As to the Locator, its now checked in and should show up in the 3.2.0/1.2.0
release. Of course its implemented in terms of this underlying Reader
Manager function, so it would be broken in similar circumstances until this
fix goes in.

----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]



[EMAIL PROTECTED] on 03/20/2000 09:17:36 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  looks like a bug in Xerces 1.1.0 C++




Hi

I have experienced following problem with Xerces 1.1.0 (C++ version)

I'm trying to demonstrate it on modified SAXCount example:

in SAXCount.cpp in main( ... ) function:

    try
    {
        const unsigned long startMillis =
XMLPlatformUtils::getCurrentMillis();
        parser.parse(xmlFile);

     // here I have added new line
        parser.parse("c:\\temp\\test\\my_test.xml");

        const unsigned long endMillis =
XMLPlatformUtils::getCurrentMillis();
        duration = endMillis - startMillis;
    }

... so I want to parse the file whose name comes from the command line and
immediately some other file.
If the second file doesn't exist the call to parse() causes Xerces to
crash.

If I coment out the first call to parse ( i.e. parser.parse(xmlFile);) so
the request to parse the nonexisitng file
comes first everything is OK and the error handler catches "fatal error"
exception as expected.

In the first case the crash occurs in ReaderMgr.cpp in the
getLastExtEntityInfo(.. ) method.
I have put some comments here to show what I see in debugger when the
method gets called  (when "parsing" the nonexisting file)

void ReaderMgr::getLastExtEntityInfo(LastExtEntityInfo& lastInfo) const
{
    //
    //  If the reader stack never got created, then we can't give this
    //  information.
    //
    if (!fReaderStack && !fCurReader)

//  ---- HERE  fReaderStack !=0 and fCurReader == 0 so the conditions fails
----
    {
        lastInfo.systemId = XMLUni::fgZeroLenString;
        lastInfo.publicId = XMLUni::fgZeroLenString;
        lastInfo.lineNumber = 0;
        lastInfo.colNumber = 0;
        return;
    }

    // We have at least one entity so get the data
    const XMLEntityDecl*    theEntity;

// --- HERE the getLastExtEntity() returns value of fCurReader !!! equal to
0 (see above) !!!!
// --- which is assigned to the theReader variable

    const XMLReader*        theReader = getLastExtEntity(theEntity);

    // Fill in the info structure with the reader we found

// --- and HERE comes the crash as theReader is NULL pointer

    lastInfo.systemId = theReader->getSystemId();
    lastInfo.publicId = theReader->getPublicId();
    lastInfo.lineNumber = theReader->getLineNumber();
    lastInfo.colNumber = theReader->getColumnNumber();
}


regards

Mira

P.S. I have already asked for that in the past hoping a next version would
fix it.
When do you plan to implement functionality of the Locator class ?





Reply via email to