CybOXProject / schemas

CybOX Schemas and Schema Development
42 stars 17 forks source link

Fix Redundant xs:choice usage in Network Packet Object #338

Open ikiril01 opened 9 years ago

ikiril01 commented 9 years ago

We have some redundant uses of xs:choice in some types of the Network Packet Object, where it has only a single child element. This has no effect on the actual use of the object, but we should still clean it up.

E.g.,

<xs:complexType name="ICMPv6EchoRequestType">
               <xs:annotation>
                       <xs:documentation>Echo request informational ICMP v6 message; type=128.</xs:documentation>
               </xs:annotation>
               <xs:sequence>
                       <xs:choice minOccurs="0">
                               <xs:element name="Echo_Request" type="xs:boolean" minOccurs="0">
                                      <xs:annotation>
                                              <xs:documentation>Every node must implement an ICMP v6 Echo responder function that receives Echo Requests (ICMP v6 code=0).</xs:documentation>
                                      </xs:annotation>
                               </xs:element>
                       </xs:choice>
                       <xs:element name="Data" type="cyboxCommon:HexBinaryObjectPropertyType" minOccurs="0">
                               <xs:annotation>
                                      <xs:documentation>Zero or more octets of arbitrary data.</xs:documentation>
                               </xs:annotation>
                       </xs:element>
               </xs:sequence>
        </xs:complexType>
gtback commented 9 years ago

I've noticed this before, and thought I'd made an issue, but can't seem to find it now (so I probably didn't). Thanks, @ikiril01 .

ikiril01 commented 9 years ago

Updated title for clarity.