I need to create an xml file like this:
<AGENDA>
<COVER COLOR>BLACK</COVER COLOR>
<PRICE>24.99</PRICE>
<ENTRIES>
<NAMESURNAME>AAABBB</NAMESURNAME>
<PHONENUMBER>3434534543</PHONENUMBER>
<NAMESURNAME>EEEAAA</NAMESURNAME>
<PHONENUMBER>2342342</PHONENUMBER>
</ENTRIES>
</AGENDA>
That is, one or more options and a complex type in sequence. I need only one set of options per xml file while one or more entries.
I use the xsd text editor embedded in VS2010 but I don't know how to properly place the options elements.
If I type (after the <xsd:schema....>
tag):
<xsd:element name="OPTION1" type="xsd:string"/>
<xsd:element name="RawPolling">
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
<xsd:element name="RawPollingEntry">
<xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="0">
<xsd:element name="Nome" type="xsd:string" />
.....
....
I do not get any error on xsd but when I write the xml I get "XML document cannot contain multiple root level elements" I tried to move the OPTION1 inside the RawPolling (but not inside the RawPollingEntry, OPTION1 is not part of a complex/sequence type, I need only one OPTION1 per xml file) and get other errors ("the element ... has invalid child element...)
How can I accomplish this?