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 "Boris Kolpackov (JIRA)" <xe...@xml.apache.org> on 2009/11/17 14:06:39 UTC
[jira] Closed: (XERCESC-1205) primary document entity could not be
opened - on Win98
[ https://issues.apache.org/jira/browse/XERCESC-1205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Boris Kolpackov closed XERCESC-1205.
------------------------------------
Resolution: Fixed
Fix Version/s: 3.0.1
Win98 is no longer supported.
> primary document entity could not be opened - on Win98
> ------------------------------------------------------
>
> Key: XERCESC-1205
> URL: https://issues.apache.org/jira/browse/XERCESC-1205
> Project: Xerces-C++
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.1.0, 2.4.0, 2.5.0
> Environment: Together with Xalan. I have had the bug on Win98 (1st and 2nd edition). Reading the code I think Win95 and WinME may have the same problem.
> Reporter: Florian Nowotny
> Fix For: 3.0.1
>
>
> When I use an unc path as the input parameter of the constructor of Xalan's XSLTInputSource( const char* )
> on Win98 systems Xerces raises the error:
> The primary document entitiy could not be opened. Id=\\server\shared\..path-to-xml-file
> I traced through Xerces' code an found that
> - the constructor of Xerces' InputSource( const XMLCh* const SystemId, MemoryManager*) is called internally and the systemId is file://///server/shared/...
> - later in Win32PlatformUtils.cpp the Windows API method CreateFileA is called and tmpName is //server/shared/...
> BUT: CreateFileA can't open an UNC-Path with forward slashes on both Win98-PCs that I have tested (Win98 1st and 2nd Edition).
> It's unfriendly that the error message reports the file-to-open-path with back slashes?
> I fixed the problem by patching xerces/src/xercesc/util/Platforms/Win32/Win32PlatformUtils.cpp (Xerces version 2.5.0) in method
> openFile(const XMLCh* const fileName, MemoryManager* const manager).
> Here is my code beginning with line 326:
> else
> {
> //
> // We are Win 95 / 98. Take the Unicode file name back to (char *)
> // so that we can open it.
> //
> char* tmpName = XMLString::transcode(nameToOpen, manager);
>
> //
> // Bugfix:
> // I'm replacing all forward slashes with backward slashes
> //
> int len = strlen(tmpName);
> for ( int i = 0; i < len; ++i )
> {
> if ( tmpName[i] == '/' )
> tmpName[i] = '\\';
> }
>
> retVal = ::CreateFileA
> (
> tmpName
> , GENERIC_READ
> , FILE_SHARE_READ
> , 0
> , OPEN_EXISTING
> , FILE_FLAG_SEQUENTIAL_SCAN
> , 0
> );
> manager->deallocate(tmpName);//delete [] tmpName;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org