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 Gareth Reakes <ga...@decisionsoft.com> on 2003/03/28 10:19:37 UTC

Help !!! Exception on Tandem while running SAXPrint


Forwarded message:



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









-- 
Gareth Reakes, Head of Product Development  +44-1865-203192
DecisionSoft Limited                        http://www.decisionsoft.com
XML Development and Services




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