[xsd-users] XSD compilation fails: "Global element declared more than once"

Björn Stresing bjoern.stresing at gmx.de
Wed May 13 09:33:34 EDT 2015


Hi again,

I have to correct myself. The xsd binary runs through without throwing 
errors but the generated code won't compile with visual studio compiler 
12. Even worse, a schema that previously worked with xsd binary version 
4.0.0 and visual studio stopped working (see below). The changelog shows 
that version 4.1.0 has a new feature (support for abstract XML Schema 
types). This feature probably causes the errors (every abstract xsd type 
triggers one error). Is there a command line option to disable this feature?

The schema that stopped working using xsd binary 4.1.0:
https://dl.dropboxusercontent.com/u/85154074/xsd.zip

Best Regards,
Bjoern Stresing

1>------ Build started: Project: Archivist, Configuration: Debug Win32 
------
1>  imf-cpl.cpp
1>D:\DEV\xsd\libxsd\xsd/cxx/tree/elements.hxx(1495): error C2259: 
'cpl::BaseResourceType' : cannot instantiate abstract class
1>          due to following members:
1>          'cpl::BaseResourceType 
*cpl::BaseResourceType::_clone(xml_schema::Flags,xsd::cxx::tree::_type 
*) const' : is abstract
1>          d:\svn\archivist\trunk\src\synthesis\imf-cpl.h(1596) : see 
declaration of 'cpl::BaseResourceType::_clone'
1>          D:\DEV\xsd\libxsd\xsd/cxx/tree/elements.hxx(1494) : while 
compiling class template member function 'std::auto_ptr<T> 
xsd::cxx::tree::traits<T,char,other>::create(const 
xercesc_3_1::DOMElement 
&,xsd::cxx::tree::flags,xsd::cxx::tree::container *)'
1>          with
1>          [
1> T=cpl::SequenceType_ResourceListType::ResourceType
1>          ]
1> D:\SVN\archivist\trunk\src\synthesis\imf-cpl.cpp(4912) : see 
reference to function template instantiation 'std::auto_ptr<T> 
xsd::cxx::tree::traits<T,char,other>::create(const 
xercesc_3_1::DOMElement 
&,xsd::cxx::tree::flags,xsd::cxx::tree::container *)' being compiled
1>          with
1>          [
1> T=cpl::SequenceType_ResourceListType::ResourceType
1>          ]
1> D:\SVN\archivist\trunk\src\synthesis\imf-cpl.cpp(4912) : see 
reference to class template instantiation 
'xsd::cxx::tree::traits<cpl::SequenceType_ResourceListType::ResourceType,char,other>' 
being compiled
1>  st2067-100a-2014.cpp
1>D:\DEV\xsd\libxsd\xsd/cxx/tree/elements.hxx(1495): error C2259: 
'opl::MacroType' : cannot instantiate abstract class
1>          due to following members:
1>          'opl::MacroType 
*opl::MacroType::_clone(xml_schema::Flags,xsd::cxx::tree::_type *) 
const' : is abstract
1> d:\svn\archivist\trunk\src\synthesis\st2067-100a-2014.h(611) : see 
declaration of 'opl::MacroType::_clone'
1>          D:\DEV\xsd\libxsd\xsd/cxx/tree/elements.hxx(1494) : while 
compiling class template member function 'std::auto_ptr<T> 
xsd::cxx::tree::traits<T,char,other>::create(const 
xercesc_3_1::DOMElement 
&,xsd::cxx::tree::flags,xsd::cxx::tree::container *)'
1>          with
1>          [
1> T=opl::OutputProfileListType_MacroListType::MacroType
1>          ]
1> D:\SVN\archivist\trunk\src\synthesis\st2067-100a-2014.cpp(1367) : see 
reference to function template instantiation 'std::auto_ptr<T> 
xsd::cxx::tree::traits<T,char,other>::create(const 
xercesc_3_1::DOMElement 
&,xsd::cxx::tree::flags,xsd::cxx::tree::container *)' being compiled
1>          with
1>          [
1> T=opl::OutputProfileListType_MacroListType::MacroType
1>          ]
1> D:\SVN\archivist\trunk\src\synthesis\st2067-100a-2014.cpp(1367) : see 
reference to class template instantiation 
'xsd::cxx::tree::traits<opl::OutputProfileListType_MacroListType::MacroType,char,other>' 
being compiled
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4231 bytes
Desc: S/MIME Cryptographic Signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150513/eab20d04/smime.bin


More information about the xsd-users mailing list