xsd makes an array when you have maxOccurs="unbounded", eg passing the
following xsd into xsd.exe gives me an array:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="" id="Ionic">
<xs:complexType name="Root">
<xs:sequence>
<xs:element name="Stamp" maxOccurs="unbounded" type="xs:date"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Something" type="Root"/>
</xs:schema>
For Q2, when deserializing, pass the Deserialize() method an instance of
XmlValidatingReader.
Here is an example:
XmlReader xr = new XmlTextReader(fileName);
XmlValidatingReader vr = new XmlValidatingReader(xr);
vr.Schemas.Add("urn:example-org:person", "person.xsd");
Person p = (Person)ser.Deserialize(vr);
ref:
http://msdn.microsoft.com/msdnmag/issues/02/11/XMLFiles/default.aspx
-Dino

Signature
Dino Chiesa
Microsoft Developer Division
d i n o c h @ o n l i n e . m i c r o s o f t . c o m
> I'm embarking on a c# based project in which I would like to make use of a
> lot of XML including database access and using hte xml and .net tools as a
[quoted text clipped - 28 lines]
>
> iain
Iain - 27 Nov 2003 09:51 GMT
Thank you very much.
I had a maxOccurs, but in the wrong place (I'm still getting to grips with
xsd - it's one of those things that sounds obvious, but turns out to be VERY
complicated in detail!).
And the other trick is exactly what I'm looking for!
Iain
> xsd makes an array when you have maxOccurs="unbounded", eg passing the
> following xsd into xsd.exe gives me an array:
[quoted text clipped - 61 lines]
> >
> > iain