Groups | Blog | Home
all groups > dotnet xml > august 2003 >

dotnet xml : Schema Editor Problems in VS.NET


Andrew Ducker
8/13/2003 8:51:17 AM
I have an XML document and a schema. It validates fine, but when I try to
switch to data view there's a problem. So I tried "Create Schema" and got
the error:
An error occurred while loading the schema with targetNameSpace
"http://tempuri.org/XMLFile1.xsd" referenced in this document.
Index (zero based) must be greater or equal to zero and less than the size
of the argument list.

I can't find any help on this error, or see any reason why it should
occurring.

I've made this as simple as I can and I just can't see where the problem is
occurring.

Andy D



My XML is:

<?xml version="1.0" encoding="utf-8" ?>
<Names xmlns="http://tempuri.org/XMLFile1.xsd">
<name>Andy</name>
<name>Bob</name>
<name>Charles</name>
<name>Derek</name>
</Names>

my XSD is:

<?xml version="1.0" ?>
<xs:schema id="Names" targetNamespace="http://tempuri.org/XMLFile1.xsd"
xmlns:mstns="http://tempuri.org/XMLFile1.xsd"
xmlns="http://tempuri.org/XMLFile1.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-
microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="Names" msdata:IsDataSet="true" msdata:Locale="en-
GB" msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="name" nillable="true"
type="xs:string"></xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
brettke NO[at]SPAM online.microsoft.com
8/13/2003 7:04:27 PM
Hi Andrew,

Thanks again for using Microsoft Newsgroup Support. I have sent your
question on to one of our support teams for a response. I will let you
know when I hear back from them.

Thanks for your patience.

Brett Keown
Microsoft Support
brettke@online.microsoft.com

This posting is provided "AS IS" with no warranties, and confers no rights.
Andrew Ducker
8/17/2003 4:57:18 PM
brettke@online.microsoft.com (Brett Keown [MSFT]) wrote in
news:$i9R62cYDHA.2476@cpmsftngxa06.phx.gbl:

[quoted text, click to view]

Just got back from a weekend away, worked out the problem - there was no
element defined. Being new to xsd I hadn't realised that I couldn't just
have a complex type with other complex types inside it.

However, it would have been nice if I'd been told "warning, you have no
root element" or if the schema creator had let me know in some way that one
was necessary.

Cheers,

brettke NO[at]SPAM online.microsoft.com
8/18/2003 6:50:47 PM
Great Andrew,

Glad to hear that you figured this out. I will submit a DCR asking that a notification message be put in for that type of error. Thanks again for using the
Microsoft Newsgroups!

Brett Keown
Microsoft Developer Support
brettke@nospam.microsoft.com

To email me directly, please remove the "nospam" from my email address.

This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.
AddThis Social Bookmark Button