Support for xs:list?

Jan 21, 2010 at 7:25 PM

I've been learning XSD this week and trying to generate corresponding C# classes from my schemas.

Neither xsd.exe nor Xsd2Code seems to do what I expected for xs:list.  For example, this schema:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

   <xs:element name="Data" type="ObjectType" />

   <!-- list of ints -->
   <xs:simpleType name="IntListType">
      <xs:list itemType="xs:int" />
   </xs:simpleType>
 
   <!-- holder of list of ints -->
   <xs:complexType name="ObjectType">
      <xs:sequence>
         <xs:element name="Data1" type="xs:int" />
         <xs:element name="Data2" type="IntListType" />
      </xs:sequence>
   </xs:complexType>

</xs:schema>

seems to create a class containing and int and a string, but I'd kinda-sorta hoped for a class containing an int and an int[] (or List<int>).

Am I doing something wrong?

-mpg