I saw a sample like this:
<xsd:element name="Product"> <xsd:complexType> <xsd:sequence> <xsd:element name="ProductName" type="xsd:string" /> <xsd:element name="Customer" type="xsd:CustomerType" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="CustomerType"> <xsd:complexType> <xsd:sequence> <xsd:element name="FullName" type="xsd:string" /> <xsd:element name="Age" type="xsd:string" /> <xsd:element name="Age" type="xsd:occupation" /> </xsd:sequence> </xsd:complexType> </xsd:element>
And I wonder why in this case someone would choose typeinstead ref:
type
ref
<xsd:element name="Product"> <xsd:complexType> <xsd:sequence> <xsd:element name="ProductName" type="xsd:string" /> <xsd:element ref="Customer" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="Customer"> <xsd:complexType> <xsd:sequence> <xsd:element name="FullName" type="xsd:string" /> <xsd:element name="Age" type="xsd:string" /> <xsd:element name="Age" type="xsd:occupation" /> </xsd:sequence> </xsd:complexType> </xsd:element>
What would be the positive side of using typeinstead ref, can someone explain to me? I know that it refcan also have a parameter minOccursand maxOccursso that you can define refhow arrays are in the deserialized code.
minOccurs
maxOccurs
. , , . ; : , , , . , XSD, XSD, , . " ", ... , contains only one global element (, rq/rs -, ?) .
contains only one global element
, , "Salami Slice": , (). , , .
, , , " ". , elementFormDefault .
/maxOccurs, , . . , , ref ed local, .