XML Schema (XSD) and ADO.net DataSet - limitations mapping between them

D

David Laub

The following valid XSD schema can NOT be successfully read by the
ReadXMLSchema method of the DataSet object - it errors out with a
"NonEmptyString not defined" error. This schema is more complex than a
plain vanilla schema, but doesn't strike me as obscenely complex.

Are there general rules for what can an can not be mapped between any XSD
schema & a .net DataSet?

Thanks

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Wheels Inc
(Wheels Inc) -->
<!--W3C Schema generated by XMLSpy v2005 rel. 3 U (http://www.altova.com)-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">

<xs:element name="CollisionTemplateA1">

<xs:complexType>

<xs:sequence>

<xs:element ref="FullName"/>

<xs:element ref="Hometown"/>

<xs:element ref="Province"/>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="FullName">

<xs:complexType>

<xs:simpleContent>

<xs:extension base="NonEmptyString">

<xs:attribute name="from" fixed="/LR/Deeper/IsDriverInsane"/>

<xs:attribute name="conditional" fixed="yes"/>

<xs:attribute name="source1" fixed="/LR/Deeper/Name"/>

<xs:attribute name="source2" fixed="/LR/Name"/>

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

<xs:element name="Hometown">

<xs:complexType>

<xs:simpleContent>

<xs:extension base="NonEmptyString">

<xs:attribute name="from" type="xs:string" fixed="/LR/City"/>

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

<xs:element name="Province">

<xs:complexType>

<xs:simpleContent>

<xs:extension base="NonEmptyString">

<xs:attribute name="from" type="xs:string" fixed="/LR/State"/>

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

<xs:simpleType name="NonEmptyString">

<xs:restriction base="xs:string">

<xs:minLength value="1"/>

</xs:restriction>

</xs:simpleType>

</xs:schema>
 
A

amir massourian

in 1.0 and 1.1, DataSet does not support named simple types.
DataSet 2.0 Beta 1, processes below provided schema.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top