473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

"The 'maxoccurs' attribute is not supported in this context"

Hi,

I'm trying to load some XML into a dataset with C# but I have an issue with
the schema. I'm using exactly the same code to successfully load other XML.

The only difference is in the XML I'm trying to load it has:

xs:choice maxoccurs="unbounded"

The error message I'm getting is: "The 'maxoccurs' attribute is not
supported in this context"

The code I'm using to load the DataSet is:

WebRequest request = WebRequest.Create(SchemaURL);
request.Proxy = new WebProxy(proxyServer);
request.Proxy.Credentials = credentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream dataStream = response.GetResponseStream();
ds.ReadXmlSchema(dataStream);

.....and it's aborting on the ReadXMLSchema.

Any ideas what I'm doing wrong?

Many thanks

Jan 18 '08 #1
2 4272


"Andy C" <An***@discussions.microsoft.comwrote in message
news:31**********************************@microsof t.com...
Hi,

I'm trying to load some XML into a dataset with C# but I have an issue
with
the schema. I'm using exactly the same code to successfully load other
XML.

The only difference is in the XML I'm trying to load it has:

xs:choice maxoccurs="unbounded"

The error message I'm getting is: "The 'maxoccurs' attribute is not
supported in this context"

The code I'm using to load the DataSet is:

WebRequest request = WebRequest.Create(SchemaURL);
request.Proxy = new WebProxy(proxyServer);
request.Proxy.Credentials = credentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream dataStream = response.GetResponseStream();
ds.ReadXmlSchema(dataStream);

....and it's aborting on the ReadXMLSchema.

Any ideas what I'm doing wrong?

Many thanks


It should be maxOccurs with an uppercase O.

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

Jan 18 '08 #2
That was indeed the problem - cheers!

"Joe Fawcett" wrote:
>

"Andy C" <An***@discussions.microsoft.comwrote in message
news:31**********************************@microsof t.com...
Hi,

I'm trying to load some XML into a dataset with C# but I have an issue
with
the schema. I'm using exactly the same code to successfully load other
XML.

The only difference is in the XML I'm trying to load it has:

xs:choice maxoccurs="unbounded"

The error message I'm getting is: "The 'maxoccurs' attribute is not
supported in this context"

The code I'm using to load the DataSet is:

WebRequest request = WebRequest.Create(SchemaURL);
request.Proxy = new WebProxy(proxyServer);
request.Proxy.Credentials = credentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream dataStream = response.GetResponseStream();
ds.ReadXmlSchema(dataStream);

....and it's aborting on the ReadXMLSchema.

Any ideas what I'm doing wrong?

Many thanks

It should be maxOccurs with an uppercase O.

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name
Jan 19 '08 #3

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

Similar topics

52
by: Markus Elfring | last post by:
How much are you interested that the attribute "style" will offer the same or similar capabilities like they are provided by the element "style" in the element "head"? Do you want that the...
24
by: Charles Crume | last post by:
Hello; My "index.htm" page has 3 frames (content, navigation bar, and logo). I set the "SRC" of the "logo" frame to a blank gif image and then want to change it's contents after the other two...
4
by: mike | last post by:
regards: <a href="JavaScript:loadwindow(106,90);" style="font-family:Verdana;">元智Intranet</a> In HTML spec,are "href" and "style" called "attribute"?....@@ Could someone good give me the...
6
by: TS | last post by:
Hi, i have a problem validating xml against schema. I used http://apps.gotdotnet.com/xmltools/xsdvalidator/Default.aspx validator and it says it is fine. Can you tell me why this doesn't work? ...
28
by: Steven Bethard | last post by:
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions!...
2
by: mavis | last post by:
The usage of <xs:choice maxOccurs="unbounded"> When we want to define a set of elements that could be in any order and with any occurences (0-unbounded), we can use <xs:choice...
1
by: BillAtWork | last post by:
Hi, I'm trying to validate an XML document against an XSD schema and I receive the following error: ---------- MyCode.CreateValidRequest : System.Web.Services.Protocols.SoapException :...
1
by: BillAtWork | last post by:
Hi, I'm trying to validate an XML document against an XSD schema and I receive the following error: ---------- MyCode.CreateValidRequest : System.Web.Services.Protocols.SoapException :...
2
by: psokulski | last post by:
I have problem with passing parameters for web service. Address for WSDL 'http://www.odfl.com/RateWeb/wsdl/com/odfl/ws/ rateestimate/RateEstimate.wsdl'. Im trying to call calculateRate in wsdl...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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...
0
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...

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.