Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-847

Help !!! Exception on Tandem while running SAXPrint

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Incomplete
    • 2.2.0
    • None
    • Samples/Tests
    • None
    • Operating System: Other
      Platform: Other
    • 18432

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            pravtm@yahoo.com Praveen T M
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: