473,508 Members | 2,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cannot load schema for the namespace

Hi,
I am trying to validate an XML file using the XmlValidatingReader and
XmlUrlResolver.
The code for which goes like this:

// Read the XML file.
XmlTextReader xmlReader = new XmlTextReader( _PathToXMLDoc);

XmlValidatingReader valReader = new XmlValidatingReader(xmlReader);
valReader.ValidationType = ValidationType.Schema;

XmlResolver xRes = new XmlUrlResolver();
valReader.XmlResolver = xRes;
valReader.ValidationEventHandler += new
ValidationEventHandler(this.ValidationCallBack);

while(valReader.Read())
{

}

I have the XML document which refers to a xsd file located on a directory
on the local workstation.
If my XML document has the attribute:
xsi:schemaLocation="20040518 C:\Inetpub\wwwroot\20040518.xsd">
then the validation suceeds.
But if I were to change the attribute to:
xsi:schemaLocation="20040518 http://localhost/20040518.xsd";>
I get the error:

"Cannot load schema for the namespace '20040518' - Specified argument was
out of the range of valid values.
Parameter name: The specified value must be greater than 0."

I am able to view the XSD file in IE using the URL
http://localhost/20040518.xsd, hence I know that the XSD file is present and
the IIS is configured correctly.

Any ideas as what's causing this error?

Nov 12 '05 #1
2 3780
Can you provide your schema and XML instance so the problem can be tracked
down. It seems unlikely that this is simply due to schema location issues.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Ian Emery" <ia******@hotmail.com> wrote in message
news:uS**************@TK2MSFTNGP10.phx.gbl...
Hi,
I am trying to validate an XML file using the XmlValidatingReader and
XmlUrlResolver.
The code for which goes like this:

// Read the XML file.
XmlTextReader xmlReader = new XmlTextReader( _PathToXMLDoc);

XmlValidatingReader valReader = new XmlValidatingReader(xmlReader);
valReader.ValidationType = ValidationType.Schema;

XmlResolver xRes = new XmlUrlResolver();
valReader.XmlResolver = xRes;
valReader.ValidationEventHandler += new
ValidationEventHandler(this.ValidationCallBack);

while(valReader.Read())
{

}

I have the XML document which refers to a xsd file located on a directory
on the local workstation.
If my XML document has the attribute:
xsi:schemaLocation="20040518 C:\Inetpub\wwwroot\20040518.xsd">
then the validation suceeds.
But if I were to change the attribute to:
xsi:schemaLocation="20040518 http://localhost/20040518.xsd";>
I get the error:

"Cannot load schema for the namespace '20040518' - Specified argument was
out of the range of valid values.
Parameter name: The specified value must be greater than 0."

I am able to view the XSD file in IE using the URL
http://localhost/20040518.xsd, hence I know that the XSD file is present and the IIS is configured correctly.

Any ideas as what's causing this error?

Nov 12 '05 #2
can you give me a valid email address to send the xml to, the zipped file is
12K and too big for the newsgroup :(

"Dare Obasanjo [MSFT]" <da***@online.microsoft.com> wrote in message
news:40********@news.microsoft.com...
Can you provide your schema and XML instance so the problem can be tracked
down. It seems unlikely that this is simply due to schema location issues.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ian Emery" <ia******@hotmail.com> wrote in message
news:uS**************@TK2MSFTNGP10.phx.gbl...
Hi,
I am trying to validate an XML file using the XmlValidatingReader and
XmlUrlResolver.
The code for which goes like this:

// Read the XML file.
XmlTextReader xmlReader = new XmlTextReader( _PathToXMLDoc);

XmlValidatingReader valReader = new XmlValidatingReader(xmlReader);
valReader.ValidationType = ValidationType.Schema;

XmlResolver xRes = new XmlUrlResolver();
valReader.XmlResolver = xRes;
valReader.ValidationEventHandler += new
ValidationEventHandler(this.ValidationCallBack);

while(valReader.Read())
{

}

I have the XML document which refers to a xsd file located on a directory on the local workstation.
If my XML document has the attribute:
xsi:schemaLocation="20040518 C:\Inetpub\wwwroot\20040518.xsd">
then the validation suceeds.
But if I were to change the attribute to:
xsi:schemaLocation="20040518 http://localhost/20040518.xsd";>
I get the error:

"Cannot load schema for the namespace '20040518' - Specified argument was out of the range of valid values.
Parameter name: The specified value must be greater than 0."

I am able to view the XSD file in IE using the URL
http://localhost/20040518.xsd, hence I know that the XSD file is present

and
the IIS is configured correctly.

Any ideas as what's causing this error?


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2919
by: Rob Mayo | last post by:
I have a bunch of XSD files in my assembly as embedded content that are read out via reflection and streams. My app creates the XML on the fly, and I want to validate it using the schema files...
2
1024
by: Pet Matrix. | last post by:
Hi, I am trying to validate an XML file using the XmlValidatingReader and XmlUrlResolver. The code for which goes like this: // Read the XML file. XmlTextReader xmlReader = new XmlTextReader(...
2
6896
by: PeterW | last post by:
I have an xml file from which I want to generate an xsd schema and at a later stage a cs class. The xml file has a mix of defined namespaces and also an empty namespace. These are defined as...
3
2746
by: ciaran.mchale | last post by:
Hi folks, I downloaded the binary version of Xerces C++ 2.7.0 for Windows and am using it to help me get up to speed with XML and XML Schema. So please excuse me if this is a "novice" question....
1
4931
by: Hennesey | last post by:
Hello all, I am developing a Visual Studio .Net 2005 application that consumes an Axis 1.3 web service. Importing the WSDL file generates an error "cannot resolve apachesoap:Map type" ...
0
1547
by: delphiconsultingguy | last post by:
Hi all, Spent WAAAYYY too much time trying to figure this out because there's not many good examples out there, so in the interest of sparing y'all from suff'rin same, I've pasted it into...
16
3496
by: TT (Tom Tempelaere) | last post by:
Hi all, I created an XSD to define the structure of an XML file for my project. I made an XML file linked to the XSD using XmlSpy. The problem is that if I read the file using .NET XmlDocument...
5
40860
by: carlpayne1984 | last post by:
Hi all, I'm fairly new to XML, however already I have studied myself stupid without being able to solve this problem. Basically, I have an XML file/Schema about a CD catalog that I've created that...
1
10935
by: leno | last post by:
Hi all, I'm having this problem when i combined multiple schema's into one. The error msg is below: Unable to load schema with target namespace 'http://www.tdbanknorth.com/IFX170_TDBN' from...
0
2021
by: =?Utf-8?B?TGFzdGJ1aWxkZXJz?= | last post by:
Hi all, I have a weird problem which has been causing me a headache for the last two days. I have to dynamicly generate a schema in memory and load it into a dataset in memory to be returned...
0
7120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7380
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.