Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

valid xml schema generates "Duplicated declaration" error in DataSet

Question posted by: jan.geek@gmail.com (Guest) on June 27th, 2008 07:20 PM
Hi all,

When reading the following ugly but valid (according to w3c XSV) xsd
into a DataSet I get "Duplicated declaration PossiblesValue" error.

Can anyone tell me why? This is a small part of a large xsd reverse
engineered from an existing xml output from an application so despite
the structure being crap it can't be changed.

Thanks,

Here's the XSD...

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="XMLSchema1" targetNamespace="http://tempuri.org/
XMLSchema1.xsd" elementFormDefault="qualified" xmlns="http://
tempuri.org/XMLSchema1.xsd" xmlns:mstns="http://tempuri.org/
XMLSchema1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="Constraint_CT">
<xs:sequence>
<xs:element name="ConstraintType" type="xs:string" />
<xs:group ref="ConstraintsGroup" />
</xs:sequence>
</xs:complexType>
<xs:group name="DeltaOrSetConstraintGroup">
<xs:sequence>
<xs:element name="UseDelta" type="xs:boolean" />
<xs:element name="Constrant1" type="UniformConstraint_CT" />
<xs:element name="Constraint2" type="ValueSet_col" />
</xs:sequence>
</xs:group>
<xs:group name="ConstraintsGroup">
<xs:choice>
<xs:group ref="UniformConstraintGroup" />
<xs:group ref="SetConstraintGroup" />
<xs:group ref="DeltaOrSetConstraintGroup" />
</xs:choice>
</xs:group>
<xs:group name="SetConstraintGroup">
<xs:sequence>
<xs:element name="Possibles" type="ValueSet_col" />
</xs:sequence>
</xs:group>
<xs:complexType name="ValueSet_CT">
<xs:sequence>
<xs:element name="ConstraintType" type="xs:string" />
<xs:element name="Possibles" type="ValueSet_col" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="UniformConstraint_CT">
<xs:sequence>
<xs:element name="ConstraintType" type="xs:string" />
<xs:element name="Min" type="xs:string" />
<xs:element name="Max" type="xs:string" />
<xs:element name="Delta" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="ValueSet_col">
<xs:sequence>
<xs:element name="PossiblesValue" type="xs:string"
maxOccurs="unbounded" minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="id" type="xs:string" />
<xs:element name="constraint" type="Constraint_CT" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:group name="UniformConstraintGroup">
<xs:sequence>
<xs:element name="Min" type="xs:string" />
<xs:element name="Max" type="xs:string" />
<xs:element name="Delta" type="xs:string" />
</xs:sequence>
</xs:group>
</xs:schema>

Martin Honnen's Avatar
Martin Honnen
Guest
n/a Posts
June 27th, 2008
07:20 PM
#2

Re: valid xml schema generates "Duplicated declaration" error in DataSet
Join Bytes! wrote:
Quote:
When reading the following ugly but valid (according to w3c XSV) xsd
into a DataSet I get "Duplicated declaration PossiblesValue" error.
>
Can anyone tell me why?


A schema can be valid but nevertheless not suitable for a DataSet, for
instance if a table has two columns with the same name then you get an
error. If you want to know whether the schema is valid as far as .NET is
concerned then you should load it into an XmlSchemaSet and not into a
DataSet.


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

 
Not the answer you were looking for? Post your question . . .
190,472 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors