[xsd-users] XSD element with name as type
    Balasubramanyam, Shivakumar 
    sbalasub at qualcomm.com
       
    Tue Jun  3 14:16:24 EDT 2008
    
    
  
Boris,
 
Using XSD 3.1, we are seeing issues where the generated code for XSD
element with name = type conflicts with xml_schema::type. How do we
resolve this?
 
ClassificationScheme::
ClassificationScheme (const ::xml_schema::type& type, const uri_type&
uri, const type_type& type)
 : ::mpeg7::ClassificationSchemeType (type,uri),type_ (type,
::xml_schema::flags (), this) { }
 
This causes a failure at compilation:
generated_files/config_flow_messages.cpp: In constructor
`ClassificationScheme::ClassificationScheme(const xml_schema::type&,
const xml_schema::uri&,const xml_schema::string&)':
generated_files/config_flow_messages.cpp:1441: error: conflicting
declaration 'const xml_schema::type&type'
generated_files/config_flow_messages.cpp:1441: error: 'type' has a
previous declaration as `const xml_schema::string&type'
generated_files/config_flow_messages.cpp:1441: error: declaration of
`const xml_schema::type&type'
generated_files/config_flow_messages.cpp:1441: error: conflicts with
previous declaration `const xml_schema::string&type'
 
The "::xml_schema::type& type" is based on XSD's naming convention while
"const type_type& type" comes from my schema having a tag named "type".
 
In 3.6 version of xsd, the code generated is:
ClassificationScheme:: 
ClassificationScheme (const ::xml_schema::type& anyType,const uri_type&
uri,const type_type& type):mpeg7::ClassificationSchemeType
(anyType,uri),type_ (type, ::xml_schema::flags (), this) { }
 
 
This is with the same set of xsd options and the same code.
 
 
Thanks,
Shiva
 
    
    
More information about the xsd-users
mailing list