473,386 Members | 1,969 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,386 software developers and data experts.

reference to element under 'all' indicator result with error

Che
Hi all,

I am working with XSD for a ahile using C# objects (
XmlSchemaCollection , XmlValidatingReader) and have met this problem:

current code demonstrate the problem:

<xs:schema ...>

<xs:element name="Parent" type="Parent_Type" />

<xs:complexType name="Parent_Type">
<xs:all>
<xs:element name="Type" type="xs:string" maxOccurs="1" />
</xs:all>
</xs:complexType>

<xs:complexType name="Child_Type">
<xs:complexContent>
<xs:extension base="Parent_Type"/>
</xs:complexContent>
</xs:complexType>

<xs:element name="Child" substitutionGroup="Parent" type="Child_Type"
/>

<xs:element name="Test">
<xs:complexType>
<xs:all>
<xs:element ref="Parent" minOccurs="0" />
<xs:element name="additionalElement" type="xs:boolean" />
</xs:all>
</xs:complexType>
</xs:element>

</xs:schema>

When loading the XSD to a XmlSchemaCollection object I get the
exception: System.InvalidCastException.

The most weird thing is that when I change the indicator to be
<xs:sequence> - it works fine (!)
And when I remove the object 'Child' it also works fine (!!!)
If I remove the 'additionalElement' it also works fine (!!!!!!)
What is wrong here? Could it be a bug?

Jul 20 '05 #1
0 1172

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

Similar topics

41
by: Berk Birand | last post by:
Hi, I am just learning about the array/pointer duality in C/C++. I couldn't help wondering, is there a way to pass an array by value? It seems like the only way to do is to pass it by...
3
by: Matthias Lohrer | last post by:
Hi, my XML-Document hat this structure <book> <section> <para /> <para /> </section> <section> <para />
6
by: trexim | last post by:
Hi, I am trying to create a Web Reference for CSTA using the URL http://www.ecma-international.org/standards/ecma-348/csta-wsdl/csta-wsdl-all-operations.wsdl Visual .Net complains that: "...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
0
by: Richard Gregory | last post by:
Hi, I have the wsdl below, for an Axis web service, and when I select Add Web Refernce in Visual Studio the proxy is missing a class representing the returnedElementsType (see reference.cs below...
14
by: Frank Swarbrick | last post by:
A few weeks ago I had posed a question about how one my create a cursor for a query where the predicate condition is dynamic. Meaning that the query might want to have one of several possible...
2
by: Moses | last post by:
Hi All, Is is possible to catch the error of an undefined element while creating an object for it. Consider we are not having an element with id indicator but we are trying to make the object...
5
by: Gustaf | last post by:
Here's what happens: I got a Web Service installed locally on my IIS. Then I got a client project, which will call this service. But when I add the Web Reference to the Web Service, and look at the...
0
by: =?ISO-8859-1?Q?Jan_Thom=E4?= | last post by:
Hi, I've been trying like a madman to make my WSDL work with .net, but it seems I am out of luck. Whenever I add a service reference to Visual C#, the code gets generated fine, however all...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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
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
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...

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.