xsd2php icon indicating copy to clipboard operation
xsd2php copied to clipboard

Handling of xsd:squence with maxOccurs="unbounded"

Open Hanmac opened this issue 3 years ago • 0 comments

Having this part of xsd:

<xsd:element name="EMAILS">
	<xsd:complexType>
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element ref="EMAIL"/>
			<xsd:element ref="PUBLIC_KEY" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
</xsd:element>	

my problem currently is about <xsd:sequence maxOccurs="unbounded">

because of this, wouldn't that make this valid?

<EMAILS>
  <EMAIL>A</EMAIL>
  <PUBLIC_KEY>K1A</PUBLIC_KEY>
  <EMAIL>B</EMAIL>
  <PUBLIC_KEY>K1B</PUBLIC_KEY>
</EMAILS>

and wouldn't that cause problems when serializing, and de-serializing? because currently, it would be serialized as this which isn't valid:

<EMAILS>
  <EMAIL>A</EMAIL>
  <EMAIL>B</EMAIL>
  <PUBLIC_KEY>K1A</PUBLIC_KEY>
  <PUBLIC_KEY>K1B</PUBLIC_KEY>
</EMAILS>

Hanmac avatar Aug 18 '22 15:08 Hanmac