Am Mittwoch, 6. April 2005 20:48 schrieb Ovanes Markarian:
> Hi all!
>
> I am trying to open a local file under cygwin using either the URI or
> local unix name for it. Under Win32 (XP) this code works fine, but
> under Cygwin it fails. I tried a lot of approaches, like splitting
> the path into the systemId and relative path or passing the entire
> path.
>
> Can someone suggest what could be wrong here? I am using Xerces-C
> 2.6.0.
>
> //will automatically convert to XMLCh*
> MyStringClass basePath="file:///c:/someDir/";
> MyStringClass relFilePath="./someXMLfile.xml";
Hi Ovanes,
how is the conversion in MyStringClass done? Did you verify that it's
correct (e.g. can you successfully re-convert, can you successfully
convert well-known XMLCh-strings)? If you have an invalid conversion,
nothing would help you afterwards...
> URLInputSource is(static_cast<const XMLCh*>(basePath),
> static_cast<const XMLCh*>(relFilePath));
>
> BinInputStream* stream=is.makeStream();
> XMLByte bytes[1024]={0};
> size_t read=0;
>
> do
> {
> read=stream->readBytes(bytes, 1024);
> }while(read==1024);
And what is the meaning of the do-while-loop? I can't see any sense...
What is actually going wrong?
> I also tryied using LocalFileInputSource with URI, UNIX like path
> (/cygdrive/c/...) and windows path (c:\\...) with no luck.
Did you try to omit the leading './' in relFilePath?
BTW: Did you compile xercesc-2.6 under cygwin? If so, which version of
gcc did you use? I'm trying to compile xercesc under cygwin without
success until now due to linker errors, so this information might help
me here.
Axel
--
Humboldt-Universit�t zu Berlin
Institut f�r Informatik
Signalverarbeitung und Mustererkennung
Dipl.-Inf. Axel Wei�
Rudower Chaussee 25
12489 Berlin-Adlershof
+49-30-2093-3050
** www.freesp.de **
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]