I'm trying to replicate the output of a program that uses the DataSet.WriteXml method to write the xml schema. It puts minOccurs="0" at the end of each element:
<xs:element name="record_type" type="xs:string" minOccurs="0" />
When I try to write the schema like this:
XmlSchema schema = XmlSchema.Read(xsd_FileStream, null);
XmlTextWriter xmlWriter = new XmlTextWriter(FileName, null);
xmlWriter.Formatting = Formatting.Indented;
xmlWriter.WriteStartDocument(true);
xmlWriter.WriteStartElement("NewDataSet");
schema.Write(xmlWriter);
I get elements that look like this instead:
<xs:element minOccurs="0" name="record_type" type="xs:string" />