Hi Alois,
the Xerces 3.0 infrastructure only supports POSIX file names on Mac (and Xerces 2.x did the same on Mac OS X 10).

Alberto

ContentServ GmbH - Alois Blaimer wrote:
Hallo,

I am using Xerces-C++ 3.0.0.

The following Xerces code works different on Windows XP and on Macintosh
(Mac OS X 10.5.4).

Windows:

On Windows it behaves correct. The code writes a XML-Document in a file
in the correct path.

Macintosh:

On Macintosh a file is generated whose filename exists out of the path
plus the intended filename and which lays in the root.

e.g. goutputfile is "Macintosh HD:test:document.xml". The result is that
a file is generated with the long filename "Macintosh
HD/test/document.xml".

char goutputfile[256];

strcpy(goutputfile, path.GetPlatformString().c_str());

if ( strlen(goutputfile) > 0 )

      myFormTarget = new LocalFileFormatTarget(goutputfile);

else

      myFormTarget = new StdOutFormatTarget();

DOMLSOutput *theOutputDesc =
((DOMImplementationLS*)impl)->createLSOutput();

theOutputDesc->setByteStream(myFormTarget);

DOMLSSerializer   *theSerializer =
((DOMImplementationLS*)impl)->createLSSerializer();

theSerializer->write(rootElem, theOutputDesc);

How can I stop this behaviour on Macintosh?

Alois Blaimer
Developer





Reply via email to