You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Stephen Collyer <sc...@netspinner.co.uk> on 2008/08/09 15:21:54 UTC
[Win32] "The primary document entity could not be opened."
1. I have a C++ application that targets both Linux/Unix
and Win32. I'm using Xerces 2.7.0 in both Opensuse 10.3 and
the Win32 environment.
2. I am setting XMLUni::fgXercesSchemaExternalSchemaLocation
prior to parsing XML to allow the parser to locate a schema
definition. The value passed to setProperty() is:
"http://www.smpte-ra.org/schemas/2032-2/2007/MDP file:c:\tmp\mdp.xsd"
This works correctly in the Linux build. It fails at parse time
in the Win32 build with the following warning:
> The primary document entity could not be opened. Id=file:c:\tmp\mdp.xsd
3. Logging in the application tells me that the file
in question c:\tmp\mdp.xsd does indeed exist and is readable.
Can anyone suggest why this code is failing under Windows, but
fine under Linux ?
--
Regards
Steve Collyer
Netspinner Ltd
Re: [Win32] "The primary document entity could not be opened."
Posted by Stephen Collyer <sc...@netspinner.co.uk>.
David Bertoni wrote:
> Stephen Collyer wrote:
>> 1. I have a C++ application that targets both Linux/Unix
>> and Win32. I'm using Xerces 2.7.0 in both Opensuse 10.3 and
>> the Win32 environment.
>>
>> 2. I am setting XMLUni::fgXercesSchemaExternalSchemaLocation
>> prior to parsing XML to allow the parser to locate a schema
>> definition. The value passed to setProperty() is:
>>
>> "http://www.smpte-ra.org/schemas/2032-2/2007/MDP file:c:\tmp\mdp.xsd"
> This is not a valid URL. Try:
>
> file:///c:/tmp/mdp.xsd
Thanks. That looks very likely to be the culprit.
--
Regards
Steve Collyer
Netspinner Ltd
Re: [Win32] "The primary document entity could not be opened."
Posted by David Bertoni <db...@apache.org>.
Stephen Collyer wrote:
> 1. I have a C++ application that targets both Linux/Unix
> and Win32. I'm using Xerces 2.7.0 in both Opensuse 10.3 and
> the Win32 environment.
>
> 2. I am setting XMLUni::fgXercesSchemaExternalSchemaLocation
> prior to parsing XML to allow the parser to locate a schema
> definition. The value passed to setProperty() is:
>
> "http://www.smpte-ra.org/schemas/2032-2/2007/MDP file:c:\tmp\mdp.xsd"
This is not a valid URL. Try:
file:///c:/tmp/mdp.xsd
You can also omit the "c:" if the C drive is your current drive.
>
> This works correctly in the Linux build. It fails at parse time
> in the Win32 build with the following warning:
I don't you have a file on the C drive on a Linux system. What URL are
you using on Linux?
>
>> The primary document entity could not be opened. Id=file:c:\tmp\mdp.xsd
>
> 3. Logging in the application tells me that the file
> in question c:\tmp\mdp.xsd does indeed exist and is readable.
>
> Can anyone suggest why this code is failing under Windows, but
> fine under Linux ?
Because you're probably supplying a valid URL on Linux, although that's
just a guess.
Dave