valid xml schema generates "Duplicated declaration" error in DataSet

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jan.geek@gmail.com

    valid xml schema generates "Duplicated declaration" error in DataSet

    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" elementFormDefa ult="qualified" xmlns="http://
    tempuri.org/XMLSchema1.xsd" xmlns:mstns="ht tp://tempuri.org/
    XMLSchema1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexTy pe name="Constrain t_CT">
    <xs:sequence>
    <xs:element name="Constrain tType" type="xs:string " />
    <xs:group ref="Constraint sGroup" />
    </xs:sequence>
    </xs:complexType>
    <xs:group name="DeltaOrSe tConstraintGrou p">
    <xs:sequence>
    <xs:element name="UseDelta" type="xs:boolea n" />
    <xs:element name="Constrant 1" type="UniformCo nstraint_CT" />
    <xs:element name="Constrain t2" type="ValueSet_ col" />
    </xs:sequence>
    </xs:group>
    <xs:group name="Constrain tsGroup">
    <xs:choice>
    <xs:group ref="UniformCon straintGroup" />
    <xs:group ref="SetConstra intGroup" />
    <xs:group ref="DeltaOrSet ConstraintGroup " />
    </xs:choice>
    </xs:group>
    <xs:group name="SetConstr aintGroup">
    <xs:sequence>
    <xs:element name="Possibles " type="ValueSet_ col" />
    </xs:sequence>
    </xs:group>
    <xs:complexTy pe name="ValueSet_ CT">
    <xs:sequence>
    <xs:element name="Constrain tType" type="xs:string " />
    <xs:element name="Possibles " type="ValueSet_ col" />
    </xs:sequence>
    </xs:complexType>
    <xs:complexTy pe name="UniformCo nstraint_CT">
    <xs:sequence>
    <xs:element name="Constrain tType" 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:complexTy pe name="ValueSet_ col">
    <xs:sequence>
    <xs:element name="Possibles Value" type="xs:string "
    maxOccurs="unbo unded" minOccurs="0" />
    </xs:sequence>
    </xs:complexType>
    <xs:element name="root">
    <xs:complexType >
    <xs:sequence>
    <xs:element name="id" type="xs:string " />
    <xs:element name="constrain t" type="Constrain t_CT" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:group name="UniformCo nstraintGroup">
    <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

    #2
    Re: valid xml schema generates &quot;Duplicate d declaration&quo t; error inDataSet

    jan.geek@gmail. com wrote:
    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

    Comment

    Working...