Hi!
I am writing an xml schema and i came to an problem. I want to have
element "protocol" 2 times but each time with different properties. It also has
an element access also each time different properties.
I have tried the choice option but my validation tool says that a cant use the same element. Is it possible to solve this in an different way?
<xs:choice>
<xs:element name="protocol">
<xs:complexType>
<xs:sequence>
<xs:element name="type" type="xs:string" />
<xs:element name="version" type="xs:string" />
<xs:element name="timeout" type="xs:integer" />
<xs:element name="access" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="security_level" type="xs:string" />
<xs:element name="user_security_name" type="xs:string" />
<xs:element name="user_context_name" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="protocol">
<xs:complexType>
<xs:sequence>
<xs:element name="type" type="xs:string" />
<xs:element name="access" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="community" type="xs:string" />
<xs:element name="set_community" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Is it possible to solve this? Please help.
I am writing an xml schema and i came to an problem. I want to have
element "protocol" 2 times but each time with different properties. It also has
an element access also each time different properties.
I have tried the choice option but my validation tool says that a cant use the same element. Is it possible to solve this in an different way?
<xs:choice>
<xs:element name="protocol">
<xs:complexType>
<xs:sequence>
<xs:element name="type" type="xs:string" />
<xs:element name="version" type="xs:string" />
<xs:element name="timeout" type="xs:integer" />
<xs:element name="access" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="security_level" type="xs:string" />
<xs:element name="user_security_name" type="xs:string" />
<xs:element name="user_context_name" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="protocol">
<xs:complexType>
<xs:sequence>
<xs:element name="type" type="xs:string" />
<xs:element name="access" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="community" type="xs:string" />
<xs:element name="set_community" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Is it possible to solve this? Please help.