[xsd-users] xsd:list of type xsd:integer problem

Kevin Nesmith knesmith at si2.org
Tue May 27 17:02:09 EDT 2014


When creating an element with a list of integers....
       <xsd:element name="Vector" minOccurs="0" maxOccurs="unbounded">
         <xsd:complexType>
           <xsd:attribute name="values" use="required">
             <xsd:simpleType>
               <xsd:list *itemType="xsd:integer"*/>
             </xsd:simpleType>
           </xsd:attribute>
         </xsd:complexType>
       </xsd:element>

running this command with xsdcxx version 3.3.0
xsdcxx cxx-tree --char-encoding utf8 --hxx-suffix .h --cxx-suffix .cpp \
         --extern-xml-schema xml_schema.h \
         --generate-doxygen \
         --root-element test \
         --generate-serialization \
         test.xsd

then compiling in Fedora 17 with GCC 4.7.2(64bit)
/usr/bin/g++  -c  -Wall -fPIC -O2 -o test.o test.cpp
In file included from /usr/include/xsd/cxx/tree/parsing.hxx:9:0,
                  from xml_schema.h:69,
                  from test.h:63,
                  from test.cpp:41:
/usr/include/xsd/cxx/tree/parsing.txx: In instantiation of 'void 
xsd::cxx::tree::list<T, C, ST, true>::init(const std::basic_string<C>&, 
const xercesc_3_1::DOMElement*) [with T = long long int; C = char; 
xsd::cxx::tree::schema_type::value ST = 
(xsd::cxx::tree::schema_type::value)0u]':
/usr/include/xsd/cxx/tree/parsing.txx:258:9:   required from 
'xsd::cxx::tree::list<T, C, ST, true>::list(const 
xercesc_3_1::DOMElement&, xsd::cxx::tree::flags, 
xsd::cxx::tree::container*) [with T = long long int; C = char; 
xsd::cxx::tree::schema_type::value ST = 
(xsd::cxx::tree::schema_type::value)0u; xsd::cxx::tree::container = 
xsd::cxx::tree::_type]'
test.cpp:11234:72:   required from here
/usr/include/xsd/cxx/tree/parsing.txx:302:13: error: 'push_back' was not 
declared in this scope, and no declarations were found by 
argument-dependent lookup at the point of instantiation [-fpermissive]
/usr/include/xsd/cxx/tree/parsing.txx:302:13: note: declarations in 
dependent base 'std::vector<long long int, std::allocator<long long int> 
 >' are not found by unqualified lookup
/usr/include/xsd/cxx/tree/parsing.txx:302:13: note: use 
'this->push_back' instead
/usr/include/xsd/cxx/tree/parsing.txx:312:13: error: 'push_back' was not 
declared in this scope, and no declarations were found by 
argument-dependent lookup at the point of instantiation [-fpermissive]
/usr/include/xsd/cxx/tree/parsing.txx:312:13: note: declarations in 
dependent base 'std::vector<long long int, std::allocator<long long int> 
 >' are not found by unqualified lookup
/usr/include/xsd/cxx/tree/parsing.txx:312:13: note: use 
'this->push_back' instead
make: *** [test.o] Error 1

If I change the *itemType* from *xsd:integer* to *xsd:string*, it 
compiles fine.  I double check with WC3, their examples include an 
xsd:integer suggesting to me that this should work. 
(http://www.w3schools.com/schema/el_list.asp)  Do you see something I am 
doing wrong, or is there a work around?


Thanks in advanced,

-- 
*Kevin Nesmith*
/Chief Architect/
*Silicon Integration Initiative, Inc.* <http://www.si2.org>



More information about the xsd-users mailing list