Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / January 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy C - 18 Jan 2008 14:31 GMT
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
Joe Fawcett - 18 Jan 2008 14:56 GMT
> Hi,
>
[quoted text clipped - 24 lines]
>
> Many thanks

It should be maxOccurs with an uppercase O.

Signature

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

Andy C - 19 Jan 2008 11:51 GMT
That was indeed the problem - cheers!

> > Hi,
> >
[quoted text clipped - 26 lines]
> >
> It should be maxOccurs with an uppercase O.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.