You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2003/03/28 00:46:57 UTC

DO NOT REPLY [Bug 18432] New: - Help !!! Exception on Tandem while running SAXPrint

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18432>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18432

Help !!!  Exception on Tandem while running SAXPrint

           Summary: Help !!!  Exception on Tandem while running SAXPrint
           Product: Xerces-C++
           Version: 2.2.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Samples/Tests
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: pravtm@yahoo.com
                CC: pravtm@yahoo.com


I created a library on Tandem using Xercesc 2.2.0 . I tried to run the SAXPrint 
sample program using the below mentioned command 

./SAXPrint Sample.xml

It throws an exception , but the xml file is present in the same directory from 
where i am running.

<?xml version="1.0" encoding="LATIN1"?>

Fatal Error at file , line 0, char 0
  Message: An exception occurred! Type:XMLPlatformException, Message:Could not r
ead data from file 

I looked at the LocalFileInputSource.cpp and TandemPlatformUtils.cpp below 
mentioned 

LocalFileInputSource::LocalFileInputSource(const XMLCh* const filePath)
{
    //
    //  If the path is relative, then complete it acording to the current
    //  working directory rules of the current platform. Else, just take
    //  it as is.
    //
    if (XMLPlatformUtils::isRelative(filePath))
    {
        XMLCh* tmpBuf = XMLPlatformUtils::getFullPath(filePath);
        setSystemId(tmpBuf);
        delete [] tmpBuf;
    }
     else
    {
        setSystemId(filePath);
    }
}





XMLCh* XMLPlatformUtils::getFullPath(const XMLCh* const srcPath)
{

    //
    //  NOTE: THe path provided has always already been opened successfully,
    //  so we know that its not some pathological freaky path. It comes in
    //  in native format, and goes out as Unicode always
    //
    char* newSrc = XMLString::transcode(srcPath);

    // Use a local buffer that is big enough for the largest legal path
     char* tmpPath = dirname((char*)newSrc);
    if (!tmpPath)
    {
        ThrowXML(XMLPlatformUtilsException, 
XMLExcepts::File_CouldNotGetBasePathName);
    }

    char* newXMLString = new char [strlen(tmpPath) +1];
    ArrayJanitor<char> newJanitor(newXMLString);
    strcpy(newXMLString, tmpPath);
        strcat(newXMLString , "/");
    // Return a copy of the path, in Unicode format
    return XMLString::transcode(newXMLString);
}


Can somebody please tell me what exactly is going wrong

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org