473,663 Members | 2,719 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 XmlValidatingRe ader and
XmlUrlResolver.
The code for which goes like this:

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

XmlValidatingRe ader valReader = new XmlValidatingRe ader(xmlReader) ;
valReader.Valid ationType = ValidationType. Schema;

XmlResolver xRes = new XmlUrlResolver( );
valReader.XmlRe solver = xRes;
valReader.Valid ationEventHandl er += new
ValidationEvent Handler(this.Va lidationCallBac k);

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:schemaLocat ion="20040518 C:\Inetpub\wwwr oot\20040518.xs d">
then the validation suceeds.
But if I were to change the attribute to:
xsi:schemaLocat ion="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 3794
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******@hotma il.com> wrote in message
news:uS******** ******@TK2MSFTN GP10.phx.gbl...
Hi,
I am trying to validate an XML file using the XmlValidatingRe ader and
XmlUrlResolver.
The code for which goes like this:

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

XmlValidatingRe ader valReader = new XmlValidatingRe ader(xmlReader) ;
valReader.Valid ationType = ValidationType. Schema;

XmlResolver xRes = new XmlUrlResolver( );
valReader.XmlRe solver = xRes;
valReader.Valid ationEventHandl er += new
ValidationEvent Handler(this.Va lidationCallBac k);

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:schemaLocat ion="20040518 C:\Inetpub\wwwr oot\20040518.xs d">
then the validation suceeds.
But if I were to change the attribute to:
xsi:schemaLocat ion="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.m icrosoft.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******@hotma il.com> wrote in message
news:uS******** ******@TK2MSFTN GP10.phx.gbl...
Hi,
I am trying to validate an XML file using the XmlValidatingRe ader and
XmlUrlResolver.
The code for which goes like this:

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

XmlValidatingRe ader valReader = new XmlValidatingRe ader(xmlReader) ;
valReader.Valid ationType = ValidationType. Schema;

XmlResolver xRes = new XmlUrlResolver( );
valReader.XmlRe solver = xRes;
valReader.Valid ationEventHandl er += new
ValidationEvent Handler(this.Va lidationCallBac k);

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:schemaLocat ion="20040518 C:\Inetpub\wwwr oot\20040518.xs d">
then the validation suceeds.
But if I were to change the attribute to:
xsi:schemaLocat ion="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
2924
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 embedded in my assembly. Unfortunately, my problem is that every element is coming up invalid. Here is the code: Public Sub Validate(ByVal XmlText As String)Dim strmXML As New System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(XmlText))Dim...
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( _PathToXMLDoc); XmlValidatingReader valReader = new XmlValidatingReader(xmlReader); valReader.ValidationType = ValidationType.Schema;
2
6925
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 follows: <silcn:silcn xmlns:silcn='http://silcn.org/200309' xmlns='http://xmlprobe.com/200312'> it contains an element <report> off the root and also a separate <Silcn:report> again off the root.
3
2756
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. In the samples/data directory, I ran the following command for all the files: DOMPrint -n -s -f -v=always <filename>
1
4948
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" What's wrong? Does the JAVA guy has to correct something?
0
1562
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 eternity for you. Works like a charm. (I know, I know, I love you too) Sean
16
3515
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 and then query for the root element, the result is always null (1). However if I strip the root element of all attributes generated by XmlSpy, then there is no problem to find the root element with .NET XML classes (2). (1) The XML for which...
5
40912
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 I want to combine with an XML/Schema that a friend has created. Both XML files/Schema validate individually. Now comes the tricky part, combining them. I've created a new XML file and schema, called catalog.xml and catalog.xsd. Into the...
1
10956
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 'IFX170_TDBN.xsd'. combinedXSD: <xsd:schema xmlns:TDBN="http://www.tdbanknorth.com/WebServices" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:IFXTDBN="http://www.tdbanknorth.com/IFX170_TDBN" xmlns:IFX="http://www.tdbanknorth.com/IFX170_XSD"...
0
2031
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 for further use. To create the schema I am using the XMLSchema classes and the result is the
0
8435
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8547
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6186
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1754
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.