1

I've created this XSD schema and I want to use XSD2Code to generate code. The problem I'm facing happens when I try to have a list of objects. It cannot recognize the complex type.

XSD Example:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:element name="INVOICE01">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Test" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="nome" minOccurs="0" type="xs:string" ></xs:element>
                            <xs:element name="nome2" minOccurs="0" type="xs:string" ></xs:element>
                            <xs:element name="henrique">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element type="xs:string" name="henrique1" minOccurs="0"></xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

If I don't use the maxOccurs="unbounded" it work fine.

Alexandre Juma
  • 3,128
  • 1
  • 20
  • 46
GeoKing88
  • 11
  • 1
  • Welcome to SO! Please post the error you're getting. – Alexandre Juma Oct 25 '21 at 19:52
  • I don't have any error. I want a List of objects, when I use "unbounded" attribute. It generate but not recognize the values in XML file. The list is empty even when we have the elements in the file. – GeoKing88 Oct 25 '21 at 19:55

0 Answers0