[xsd-users] Missing include in version 4.0.0

svetlana.samsonik at thomsonreuters.com svetlana.samsonik at thomsonreuters.com
Sun Oct 5 20:22:50 EDT 2014


Hello,

Generated sources for the schema below (test.xsd) don't compile because of missing include file. Manually correcting generated code to include ItemMetadataType.hxx corrects it.

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

       <xs:complexType name="ItemMetadataType">
              <xs:sequence>
                     <xs:element name="link" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
       </xs:complexType>

       <xs:element name="itemMeta" type="ItemMetadataType"/>

       <xs:complexType name="AnyItemType" abstract="true" block="restriction">
              <xs:sequence>
                     <xs:element ref="itemMeta"/>
              </xs:sequence>
       </xs:complexType>

       <xs:element name="newsItem">
              <xs:complexType>
                     <xs:complexContent>
                           <xs:extension base="AnyItemType"/>
                     </xs:complexContent>
              </xs:complexType>
       </xs:element>

</xs:schema>

The command used to generate the code:

../bin/xsd cxx-tree --std c++11 \
--root-element newsItem \
--generate-forward \
--file-per-type ../test.xsd

Compiled on Linux with gcc 4.4.6.

g++ -DHAVE_CONFIG_H -I. -Ilibxsd -Wno-deprecated -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -DTIXML_USE_STL -DBOOST_LOG_DYN_LINK -I./../ucdpxsd -I./../ucdpxsd/libxsd -I./../ucdpxsd/cxx-classes -I./../libs/boost -I./../libs/xerces/include -pthread -ldl -lrt -ggdb3 -std=c++0x -O0 -DDEBUG -fPIC -rdynamic -MT cxx-classes/newsItem.lo -MD -MP -MF cxx-classes/.deps/newsItem.Tpo -c cxx-classes/newsItem.cxx  -fPIC -DPIC -o cxx-classes/.libs/newsItem.o

Regards,
Svetlana


More information about the xsd-users mailing list