[From nobody Fri Aug 7 07:09:09 2015 From: Jones Oliver <Oliver.Jones@helvar.com> To: "xsde-users@codesynthesis.com" <xsde-users@codesynthesis.com> Subject: FW: xml_schema namespace conflict problem Thread-Topic: xml_schema namespace conflict problem Thread-Index: AdDQM4Hk1qWVcTjgQvem+D85B4SANgABkPzw Date: Thu, 6 Aug 2015 11:23:27 +0000 Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: multipart/alternative; boundary="_000_6966656975787176707573706867696673686574766878756965727_" MIME-Version: 1.0 --_000_6966656975787176707573706867696673686574766878756965727_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I've managed to make some progress. I'm not sure if this is the way to do = it but I have used a compile option to change the name of the namespace in = the files generated using the xsd. --namespace-map http://www.w3.org/2001/XMLSchema=3Dxml_schemax If you still have any suggestions, improvements or think this is bad practi= ce then please let me know, Regards, Oliver From: Jones Oliver Sent: 06 August 2015 11:35 To: 'xsde-users@codesynthesis.com' Subject: xml_schema namespace conflict problem Hi, I'm using xsd and xsde in the same application. The xsd is required purely= for non-embedded xml use whereas our use of xsde is required for cross pla= tform windows and embedded use. The problem I have is that the namespace xml_schema is generated differentl= y for xsd than for the xsde. Therefore I have two conflicting versions and= am encountering redefinition build errors for the integral types. So basic= ally, types like integer are being defined as long long in xsd and long in = xsde. The c++ files are being generated from the xsd are using different x= ml schema files than for the xsde c++ file generated files. The question is how do I harmonise the xml_schema namespaces when using xsd= and xsde side by side? The windows application we are using is a 32 bit a= pplication, as is our embedded application. Ideally we would like the xsd.= exe to generate the xml_schema integral types as 32 bit data types and not = 'long long'. I have included the two generated xml_schema namespaces below. Any help would be grately appreciated, Regards, Oliver Xml_schema namespace generated from xsde.exe namespace xml_schema { using ::xsde::cxx::hybrid::any_type; typedef ::std::string any_simple_type; typedef signed char byte; using ::xsde::cxx::hybrid::byte_base; typedef unsigned char unsigned_byte; using ::xsde::cxx::hybrid::unsigned_byte_base; typedef short short_; using ::xsde::cxx::hybrid::short_base; typedef unsigned short unsigned_short; using ::xsde::cxx::hybrid::unsigned_short_base; typedef int int_; using ::xsde::cxx::hybrid::int_base; typedef unsigned int unsigned_int; using ::xsde::cxx::hybrid::unsigned_int_base; typedef long long long_; using ::xsde::cxx::hybrid::long_base; typedef unsigned long long unsigned_long; using ::xsde::cxx::hybrid::unsigned_long_base; typedef long integer; using ::xsde::cxx::hybrid::integer_base; typedef long non_positive_integer; using ::xsde::cxx::hybrid::non_positive_integer_base; typedef unsigned long non_negative_integer; using ::xsde::cxx::hybrid::non_negative_integer_base; typedef unsigned long positive_integer; using ::xsde::cxx::hybrid::positive_integer_base; typedef long negative_integer; using ::xsde::cxx::hybrid::negative_integer_base; typedef bool boolean; using ::xsde::cxx::hybrid::boolean_base; typedef float float_; using ::xsde::cxx::hybrid::float_base; typedef double double_; using ::xsde::cxx::hybrid::double_base; typedef double decimal; using ::xsde::cxx::hybrid::decimal_base; typedef ::std::string string; typedef ::std::string normalized_string; typedef ::std::string token; typedef ::std::string name; typedef ::std::string nmtoken; typedef ::xsde::cxx::string_sequence nmtokens; typedef ::std::string ncname; typedef ::std::string language; typedef ::std::string id; typedef ::std::string idref; typedef ::xsde::cxx::string_sequence idrefs; typedef ::std::string uri; using ::xsde::cxx::qname; using ::xsde::cxx::buffer; typedef ::xsde::cxx::buffer base64_binary; typedef ::xsde::cxx::buffer hex_binary; using ::xsde::cxx::time_zone; using ::xsde::cxx::date; using ::xsde::cxx::date_time; using ::xsde::cxx::duration; using ::xsde::cxx::gday; using ::xsde::cxx::gmonth; using ::xsde::cxx::gmonth_day; using ::xsde::cxx::gyear; using ::xsde::cxx::gyear_month; using ::xsde::cxx::time; using ::xsde::cxx::hybrid::pod_sequence; using ::xsde::cxx::hybrid::fix_sequence; using ::xsde::cxx::hybrid::var_sequence; using ::xsde::cxx::string_sequence; using ::xsde::cxx::hybrid::data_sequence; } Xml_schema namespace namespace xml_schema { // anyType and anySimpleType. // typedef ::xsd::cxx::tree::type type; typedef ::xsd::cxx::tree::simple_type< type > simple_type; typedef ::xsd::cxx::tree::type container; // 8-bit // typedef signed char byte; typedef unsigned char unsigned_byte; // 16-bit // typedef short short_; typedef unsigned short unsigned_short; // 32-bit // typedef int int_; typedef unsigned int unsigned_int; // 64-bit // typedef long long long_; typedef unsigned long long unsigned_long; // Supposed to be arbitrary-length integral types. // typedef long long integer; typedef long long non_positive_integer; typedef unsigned long long non_negative_integer; typedef unsigned long long positive_integer; typedef long long negative_integer; // Boolean. // typedef bool boolean; // Floating-point types. // typedef float float_; typedef double double_; typedef double decimal; // String types. // typedef ::xsd::cxx::tree::string< char, simple_type > string; typedef ::xsd::cxx::tree::normalized_string< char, string > normalized_st= ring; typedef ::xsd::cxx::tree::token< char, normalized_string > token; typedef ::xsd::cxx::tree::name< char, token > name; typedef ::xsd::cxx::tree::nmtoken< char, token > nmtoken; typedef ::xsd::cxx::tree::nmtokens< char, simple_type, nmtoken > nmtokens= ; typedef ::xsd::cxx::tree::ncname< char, name > ncname; typedef ::xsd::cxx::tree::language< char, token > language; // ID/IDREF. // typedef ::xsd::cxx::tree::id< char, ncname > id; typedef ::xsd::cxx::tree::idref< char, ncname, type > idref; typedef ::xsd::cxx::tree::idrefs< char, simple_type, idref > idrefs; // URI. // typedef ::xsd::cxx::tree::uri< char, simple_type > uri; // Qualified name. // typedef ::xsd::cxx::tree::qname< char, simple_type, uri, ncname > qname; // Binary. // typedef ::xsd::cxx::tree::buffer< char > buffer; typedef ::xsd::cxx::tree::base64_binary< char, simple_type > base64_binar= y; typedef ::xsd::cxx::tree::hex_binary< char, simple_type > hex_binary; // Date/time. // typedef ::xsd::cxx::tree::time_zone time_zone; typedef ::xsd::cxx::tree::date< char, simple_type > date; typedef ::xsd::cxx::tree::date_time< char, simple_type > date_time; typedef ::xsd::cxx::tree::duration< char, simple_type > duration; typedef ::xsd::cxx::tree::gday< char, simple_type > gday; typedef ::xsd::cxx::tree::gmonth< char, simple_type > gmonth; typedef ::xsd::cxx::tree::gmonth_day< char, simple_type > gmonth_day; typedef ::xsd::cxx::tree::gyear< char, simple_type > gyear; typedef ::xsd::cxx::tree::gyear_month< char, simple_type > gyear_month; typedef ::xsd::cxx::tree::time< char, simple_type > time; // Entity. // typedef ::xsd::cxx::tree::entity< char, ncname > entity; typedef ::xsd::cxx::tree::entities< char, simple_type, entity > entities; // Namespace information and list stream. Used in // serialization functions. // typedef ::xsd::cxx::xml::dom::namespace_info< char > namespace_info; typedef ::xsd::cxx::xml::dom::namespace_infomap< char > namespace_infomap= ; typedef ::xsd::cxx::tree::list_stream< char > list_stream; typedef ::xsd::cxx::tree::as_double< double_ > as_double; typedef ::xsd::cxx::tree::as_decimal< decimal > as_decimal; typedef ::xsd::cxx::tree::facet facet; // Flags and properties. // typedef ::xsd::cxx::tree::flags flags; typedef ::xsd::cxx::tree::properties< char > properties; // Parsing/serialization diagnostics. // typedef ::xsd::cxx::tree::severity severity; typedef ::xsd::cxx::tree::error< char > error; typedef ::xsd::cxx::tree::diagnostics< char > diagnostics; // Exceptions. // typedef ::xsd::cxx::tree::exception< char > exception; typedef ::xsd::cxx::tree::bounds< char > bounds; typedef ::xsd::cxx::tree::duplicate_id< char > duplicate_id; typedef ::xsd::cxx::tree::parsing< char > parsing; typedef ::xsd::cxx::tree::expected_element< char > expected_element; typedef ::xsd::cxx::tree::unexpected_element< char > unexpected_element; typedef ::xsd::cxx::tree::expected_attribute< char > expected_attribute; typedef ::xsd::cxx::tree::unexpected_enumerator< char > unexpected_enumer= ator; typedef ::xsd::cxx::tree::expected_text_content< char > expected_text_con= tent; typedef ::xsd::cxx::tree::no_prefix_mapping< char > no_prefix_mapping; typedef ::xsd::cxx::tree::serialization< char > serialization; // Error handler callback interface. // typedef ::xsd::cxx::xml::error_handler< char > error_handler; // DOM interaction. // namespace dom { // Automatic pointer for DOMDocument. // using ::xsd::cxx::xml::dom::auto_ptr; #ifndef XSD_CXX_TREE_TREE_NODE_KEY__XML_SCHEMA #define XSD_CXX_TREE_TREE_NODE_KEY__XML_SCHEMA // DOM user data key for back pointers to tree nodes. // const XMLCh* const tree_node_key =3D ::xsd::cxx::tree::user_data_keys::= node; #endif } } --_000_6966656975787176707573706867696673686574766878756965727_ Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hi,<= /p> I've managed to = make some progress. I'm not sure if this is the way to do it bu= t I have used a compile option to change the name of the namespace in the f= iles generated using the xsd. --namespace-map http://www.w3.org/2001/XMLSchema=3Dxml_schemax If you still have any = suggestions, improvements or think this is bad practice then please let me = know, Regards, Oliver From:= Jones Oliver Sent: 06 August 2015 11:35 To: 'xsde-users@codesynthesis.com' Subject: xml_schema namespace conflict problem Hi, I'm using xsd and xsde in the same application= . The xsd is required purely for non-embedded xml use whereas our use= of xsde is required for cross platform windows and embedded use. The problem I have is that the namespace xml_schema = is generated differently for xsd than for the xsde. Therefore I have = two conflicting versions and am encountering redefinition build errors for = the integral types. So basically, types like integer are being defined as long long in xsd and long in xsde. = ;The c++ files are being generated from the xsd are using different= xml schema files than for the xsde c++ file generated files.<= /o:p> The question is how do I harmonise the xml_schema na= mespaces when using xsd and xsde side by side? The windows applicatio= n we are using is a 32 bit application, as is our embedded application.&nbs= p; Ideally we would like the xsd.exe to generate the xml_schema integral types as 32 bit data types and not `long lon= g'. I have included the two generated xml_schema namespa= ces below. Any help would be grately appreciated, Regards, Oliver Xml_schema namespace generated from xsde.exe namespace xml_schema { using ::x= sde::::hybrid::any_type; typedef ::s= td::string any_simple_type; typedef signed char byte; using ::x= sde::::hybrid::byte_base; typedef unsigned char unsigned_byte; using ::x= sde::::hybrid::unsigned_byte_base; typedef short short_; using ::x= sde::::hybrid::short_base; typedef unsigned short unsigned_short; using ::x= sde::::hybrid::unsigned_short_base; typedef intint_; using ::x= sde::::hybrid::int_base; typedef unsigned intunsigned_int; using ::x= sde::::hybrid::unsigned_int_base; typedef long long long_ using ::x= sde::::hybrid::long_base; typedef unsigned long long unsigned_long; using ::x= sde::::hybrid::unsigned_long_base; typedef long integer; using ::x= sde::::hybrid::integer_base; typedef long non_positive_integer;= using ::x= sde::::hybrid::non_positive_integer_base; typedef unsigned long non_negative_integer;= using ::x= sde::::hybrid::non_negative_integer_base; typedef unsigned long positive_integer; using ::x= sde::::hybrid::positive_integer_base;<= span style=3D"font-size:9.5pt;font-family:Consolas;color:gainsboro;backgrou = nd:black;mso-highlight:black"> typedef long negative_integer; using ::x= sde::::hybrid::negative_integer_base;<= span style=3D"font-size:9.5pt;font-family:Consolas;color:gainsboro;backgrou = nd:black;mso-highlight:black"> typedef bool boolean; using ::x= sde::::hybrid::boolean_base; typedef float float_; using ::x= sde::::hybrid::float_base; typedef double double_; using ::x= sde::::hybrid::double_base; typedef double decimal; using ::x= sde::::hybrid::decimal_base; typedef ::s= td::string string; typedef ::s= td::string normalized_string; typedef ::s= td::string token typedef ::s= td::string name; typedef ::s= td::string nmtoken; typedef ::x= sde::::string_sequence nmtokens; typedef ::s= td::string ncname; typedef ::s= td::string language; typedef ::s= td::string id;= typedef ::s= td::string idref typedef ::x= sde::::string_sequence idrefs; typedef ::s= td::string uri= ; using ::x= sde::::qname; using ::x= sde::::buffer; typedef ::x= sde::::buffer base64_binary; typedef ::x= sde::::buffer hex_binary; using ::x= sde::::time_zone; using ::x= sde::::date; using ::x= sde::::date_time; using ::x= sde::::duration; using ::x= sde::::gday; using ::x= sde::::gmonth; using ::x= sde::::gmonth_day; using ::x= sde::::gyear; using ::x= sde::::gyear_month; using ::x= sde::::time; using ::x= sde::::hybrid::pod_sequence; using ::x= sde::::hybrid::fix_sequence; using ::x= sde::::hybrid::var_sequence; using ::x= sde::::string_sequence; using ::x= sde::::hybrid::data_sequence; } Xml_schema namespace namespace xml_schema { // anyType and anySimpleType. // typedef ::x= sd::cxx::tree::type type; typedef ::x= sd::cxx::tree::simple_type< type > simple_type; typedef ::x= sd::cxx::tree::type container; // 8-bit // typedef signed char byte; typedef unsigned char unsigned_byte; // 16-bit // typedef short short_; typedef unsigned short unsigned_short; // 32-bit // typedef intint_; typedef unsigned intunsigned_int; // 64-bit // typedef long long long_ typedef unsigned long long unsigned_long; // Supposed to be arbitrary-length inte= gral types. // typedef long long integer; typedef long long non_positive_integer;= typedef unsigned long long non_negative_integer;= typedef unsigned long long positive_integer; typedef long long negative_integer; // Boolean. // typedef bool boolean; // Floating-point types. // typedef float float_; typedef double double_; typedef double decimal; // String types. // typedef ::x= sd::cxx::tree::string< char, simple_type > string; typedef ::x= sd::cxx::tree::normalized_string< char, string > normalized_string; typedef ::x= sd::cxx::tree::token< char, normalized_string > token typedef ::x= sd::cxx::tree::name< char, token > name; typedef ::x= sd::cxx::tree::nmtoken< char, token > nmtoken; typedef ::x= sd::cxx::tree::nmtokens< char, simple_type, nmtoken > nmtokens; typedef ::x= sd::cxx::tree::ncname< char, name > ncname; typedef ::x= sd::cxx::tree::language< char, token > language; // ID/IDREF. // typedef ::x= sd::cxx::tree::id< char, ncname > id;= typedef ::x= sd::cxx::tree::idref< char, ncname, type > idref typedef ::x= sd::cxx::tree::idrefs< char, simple_type, idref > idrefs; // URI. // typedef ::x= sd::cxx::tree::uri< char, simple_type > uri= ; // Qualified name. // typedef ::x= sd::cxx::tree::qname< char, simple_type, uri= , ncname > qname // Binary. // typedef ::x= sd::cxx::tree::buffer< char > buffer; typedef ::x= sd::cxx::tree::base64_binary< char, simple_type > base64_binary; typedef ::x= sd::cxx::tree::hex_binary< char, simple_type > hex_binary; // Date/time. // typedef ::x= sd::cxx::tree::time_zone time_zone; typedef ::x= sd::cxx::tree::date< char, simple_type > date; typedef ::x= sd::cxx::tree::date_time< char, simple_type > date_time; typedef ::x= sd::cxx::tree::duration< char, simple_type > duration; typedef ::x= sd::cxx::tree::gday< char, simple_type > gday; typedef ::x= sd::cxx::tree::gmonth< char, simple_type > gmonth; typedef ::x= sd::cxx::tree::gmonth_day< char, simple_type > gmonth_day; typedef ::x= sd::cxx::tree::gyear< char, simple_type > gyear typedef ::x= sd::cxx::tree::gyear_month< char, simple_type > gyear_month; typedef ::x= sd::cxx::tree::time< char, simple_type > time; // Entity. // typedef ::x= sd::cxx::tree::entity< char, ncname > entity; typedef ::x= sd::cxx::tree::entities< char, simple_type, entity > entities; // Namespace information and list strea= m. Used in // serialization functions. // typedef ::x= sd::cxx::xml::dom::namespace_info< char > namespace_info; typedef ::x= sd::cxx::xml::dom::namespace_infomap< char > namespace_infomap; typedef ::x= sd::cxx::tree::list_stream< char > list_stream; typedef ::x= sd::cxx::tree::as_double< double_ > as_double; typedef ::x= sd::cxx::tree::as_decimal< decimal > as_decimal; typedef ::x= sd::cxx::tree::facet facet // Flags and properties. // typedef ::x= sd::cxx::tree::flags flags typedef ::x= sd::cxx::tree::properties< char > properties; // Parsing/serialization diagnostics. // typedef ::x= sd::cxx::tree::severity severity; typedef ::x= sd::cxx::tree::error< char > error typedef ::x= sd::cxx::tree::diagnostics< char > diagnostics; // Exceptions. // typedef ::x= sd::cxx::tree::exception< char > exception; typedef ::x= sd::cxx::tree::bounds< char > bounds; typedef ::x= sd::cxx::tree::duplicate_id< char > duplicate_id; typedef ::x= sd::cxx::tree::parsing< char > parsing; typedef ::x= sd::cxx::tree::expected_element< char > expected_element; typedef ::x= sd::cxx::tree::unexpected_element< char > unexpected_element; typedef ::x= sd::cxx::tree::expected_attribute< char > expected_attribute; typedef ::x= sd::cxx::tree::unexpected_enumerator<<= span style=3D"font-size:9.5pt;font-family:Consolas;color:gainsboro;backgrou = nd:black;mso-highlight:black"> char > unexpected_enumerator;= typedef ::x= sd::cxx::tree::expected_text_content<<= span style=3D"font-size:9.5pt;font-family:Consolas;color:gainsboro;backgrou = nd:black;mso-highlight:black"> char > expected_text_content;= typedef ::x= sd::cxx::tree::no_prefix_mapping< char > no_prefix_mapping; typedef ::x= sd::cxx::tree::serialization< char > serialization; // Error handler callback i= nterface. // typedef ::xsd:= :cxx::= xml::error_handler< char > error_handler; // DOM interaction. // namespace dom {= // Automatic pointer for DOMDocument. // using ::x= sd::cxx::xml::dom::auto_ptr; #ifndef XSD_CXX_TREE_TREE_NODE_KEY__XML_SCHEMA #define XSD_CXX_TREE_TREE_NODE_KEY__XML_SCHEMA<= /span> // DOM user data key for back pointers = to tree nodes. // const XMLCh const tree_node_key =3D::x= sd::cxx::tree::user_data_keys::node; #endif }= } --_000_6966656975787176707573706867696673686574766878756965727_-- ]