[xsd-users] --generate-comparison and anyType

Ray Lischner rlischner at proteuseng.com
Sat Oct 9 16:51:02 EDT 2010


We are using Code Synthesis 3.3.0. When I use --generate-comparison and an element has type anyType, the generated comparison function does not compile because xml_schema::type does not have the == operator. I don't know what it means for an anyType to == an anyType, so I don't know the solution to this problem, but I think it a real problem when a valid schema compiles to invalid C++ without a peep from xsd.

demo.xsd
<schema xmlns=http://www.w3.org/2001/XMLSchema xmlns:sample="urn:demo" targetNamespace="urn:demo"/>
  <complexType name="Type">
    <sequence>
      <element name="a" type="anyType"/>
      <element name="b" type="int"/>
    </sequence>
  </complexType>
</schema>

xsd cxx-tree --generate-comparison demo.xsd
g++ -c -Ixsd demo.cxx
demo.cxx: In function 'bool demo::operator==(const demo::Type&, const demo::Type&)':
demo.cxx:204: error: no match for 'operator==' in '((const demo::Type*)x)->demo::Type::a() == ((const demo::Type*)y)->demo::Type::a()'

Ray Lischner,
Senior Member of Technical Staff
133 National Business Pkwy, Ste 150     t. 443.539.3448
Annapolis Junction, MD 20701                c. 410.854.5170
rlischner at proteuseng.com                     f. 443.539.3370

This electronic message and any files transmitted with it contain information
which may be privileged and/or proprietary. The information is intended for use
solely by the intended recipient(s). If you are not the intended recipient, be
aware that any disclosure, copying, distribution or use of this information is
prohibited. If you have received this electronic message in error, please advise
the sender by reply email or by telephone (443.539.3400) and delete the message.


More information about the xsd-users mailing list