[xsd-users] cxx-parser with string restrictions

David Miller david.miller at torstonetechnology.com
Thu Jun 8 13:16:40 EDT 2017


If the example hello.xsd is changed so greeting is a restriction e.g.





<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">



  <xs:complexType name="hello">

    <xs:sequence>

      <xs:element name="greeting" type="StrRest"/>

      <xs:element name="name" type="xs:string" maxOccurs="unbounded"/>

    </xs:sequence>

  </xs:complexType>



  <xs:simpleType name="StrRest">

    <xs:restriction base="xs:string">

      <xs:minLength value="20"/>

    </xs:restriction>

  </xs:simpleType>



  <xs:element name="hello" type="hello"/>



</xs:schema>





Then the generated code becomes



  virtual void

  greeting ();



rather than



virtual void

greeting (const ::std::string&);



For tree mappings I believe “greeting” would still map to a string. Is this
a bug ? Or is there some workaround.

-- 
The contents (including attachments) of this email are strictly 
confidential, intended for the addressee(s) only and may be legally 
privileged.  If you are not the intended recipient, please contact the 
sender immediately and delete all copies of this email without distributing 
it further in any way.  Torstone Technology Limited, its affiliates and 
staff do not accept any liability for the contents of the message, and the 
sending of this message is not intended to form a contract with the 
recipient.  Torstone Technology Limited is registered in England and Wales 
with company number 07490275 and registered office at 8 Lloyd's Avenue, 
London EC3N 3EL, United Kingdom.


More information about the xsd-users mailing list