I am using xsd to generate classes from an xml file. It is working ok but there is one part of the xml file that is not being generated as I would like.
Here is a sample section of the xml:
<Product>
<p0>Stapler</p0>
<p1>1.50</p1>
<p2>0</p2>
</Product>
In the xsd that was generated form the xml, I see this section:
<xs:element name="Product" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="p0" type="xs:string" minOccurs="0" />
<xs:element name="p1" type="xs:decimal" minOccurs="0" />
<xs:element name="p2" type="xs:decimal" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
The problem here is that the xml responses I am trying to deserialize will have varying numbers of elements in the Product section. In the above example, it goes from p0 to p2. Other responses may go from p0 to p8.
Is there a way for me to generate a my class so that it can handle a variable number of elements for the Product?