Static Case (length restricted to 32K or less):

XSD type:

   <xsd:simpleType name="TypeName">
      <xsd:restriction base="xsd:hexBinary">
         <xsd:length value="length"/>
      </xsd:restriction>
   </xsd:simpleType>

Generated C code:

   typedef struct TypeName {
      OSUINT32 numocts;         /* if -x64 is not used */
      OSSIZE numocts;           /* if -x64 is used */
      OSOCTET data[length];
   } TypeName;

Generated C++ code:

   class TypeName : public OSRTBaseType {
      OSUINT32 numocts;         /* if -x64 is not used */
      OSSIZE numocts;           /* if -x64 is used */
      OSOCTET data[length];
      ...
   } ;

Note: in the static case, the maxLength facet will cause the same code to be generated with maxLength used for the size of the array.