[xsd-users] Attribute named "type" generates post_xxx() skeleton
 code with invalid return data type
    Edward Brabant 
    ebrabant at ramlabs.com
       
    Wed Feb  5 21:36:49 EST 2014
    
    
  
The XSD definition of the element iwhich contains the attribute named "type":
 <xs:element name='domainfinder'>
  <xs:complexType>
   <xs:attribute name='type' use='required'>
    <xs:simpleType>
     <xs:restriction base='xs:string'>
      <xs:enumeration value='filesystem'/>
      <xs:enumeration value='eventchannel'/>
      <xs:enumeration value='application'/>
      <xs:enumeration value='servicename'/>
      <xs:enumeration value='servicetype'/>
     </xs:restriction>
    </xs:simpleType>
   </xs:attribute>
   <xs:attribute name='name' type='xs:string' use='optional'/>
  </xs:complexType>
 </xs:element>
The corresponding entry in the XSD map file is:
     type std::string;
This causes XSD version 3.3.0 (on CentOS 6.3) to generate skeleton code with the signature:
 
    virtual void post_type ();
The return type should be std::string, per the entry in the XSD map file above, but is void instead.
Note that if I change the attribute name to something other than "type", e.g. "types", the skeleton code is generated correctly, i.e. the return type is std::string.
Regards,
Ed Brabant
Contractor
JTRS Test Application (JTAP) team, JTRS Test and Evaluation Lab (JTEL),
Joint Tactical Networking Center (JTNC) Technical Directorate (TD),
Space and Naval Warfare (SPAWAR) Systems Command (SSC) Pacific
    
    
More information about the xsd-users
mailing list