From boris at codesynthesis.com Sat Dec 2 05:01:20 2017 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sat Dec 2 05:01:34 2017 Subject: [xsd-users] Problem with substition groups In-Reply-To: References: <0a47d2a9fe2a4384842ec50585575912@Lizherel.cstb.local> <290424950c734ae9bd777fbb67dac8f8@Lizherel.cstb.local> Message-ID: FLACHET Nicolas writes: > > My main problem is that I cant get do that : > > > > Truitos test = dynamic_cast( building->GenericApplicationPropertyOfAbstractBuilding().at(0) ); > > > > Why can't you do that? Do you get an compile/runtime error? > > No, but the type "Truitos" doesn't exist in my generated classes. Ah, right, it is xml_schema::integer (which is why you tried to dynamic_cast to it). I see you are using --generate-xml-schema/--extern-xml-schema: > --extern-xml-schema xs/xml-schema.xsd Are you generating it with --generate-polymorphic and --polymorphic-type-all? Boris From Nicolas.FLACHET at cstb.fr Mon Dec 4 05:05:46 2017 From: Nicolas.FLACHET at cstb.fr (FLACHET Nicolas) Date: Mon Dec 4 05:05:56 2017 Subject: TR: [xsd-users] Problem with substition groups References: <0a47d2a9fe2a4384842ec50585575912@Lizherel.cstb.local> <290424950c734ae9bd777fbb67dac8f8@Lizherel.cstb.local> Message-ID: <72d3683c035545e1b37430236dd76eb3@Lizherel.cstb.local> Yes, I used --generate-polymorphic and --polymorphic-type-all. I also use a xml-schema-custom that I get from the cityGML wiki page: http://wiki.codesynthesis.com/Schemas/CityGML I join my generated xs schema if it could be of any help. Im' stuggling to make a simple case, as gml (and so forth cityGML) are massively using extension and substitution. -----Message d'origine----- De?: Boris Kolpackov [mailto:boris@codesynthesis.com] Envoy??: samedi 2 d?cembre 2017 11:01 ??: FLACHET Nicolas Cc?: xsd-users@codesynthesis.com Objet?: Re: [xsd-users] Problem with substition groups FLACHET Nicolas writes: > > My main problem is that I cant get do that : > > > > Truitos test = dynamic_cast( > > building->GenericApplicationPropertyOfAbstractBuilding().at(0) ); > > > > Why can't you do that? Do you get an compile/runtime error? > > No, but the type "Truitos" doesn't exist in my generated classes. Ah, right, it is xml_schema::integer (which is why you tried to dynamic_cast to it). I see you are using --generate-xml-schema/--extern-xml-schema: > --extern-xml-schema xs/xml-schema.xsd Are you generating it with --generate-polymorphic and --polymorphic-type-all? Boris -------------- next part -------------- // Copyright (C) 2005-2010 Code Synthesis Tools CC // // This program was generated by CodeSynthesis XSD, an XML Schema to // C++ data binding compiler. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // // In addition, as a special exception, Code Synthesis Tools CC gives // permission to link this program with the Xerces-C++ library (or with // modified versions of Xerces-C++ that use the same license as Xerces-C++), // and distribute linked combinations including the two. You must obey // the GNU General Public License version 2 in all respects for all of // the code used other than Xerces-C++. If you modify this copy of the // program, you may extend this exception to your version of the program, // but you are not obligated to do so. If you do not wish to do so, delete // this exception statement from your version. // // Furthermore, Code Synthesis Tools CC makes a special exception for // the Free/Libre and Open Source Software (FLOSS) which is described // in the accompanying FLOSSE file. // /** * @file * @brief Generated from xml-schema.xsd. */ #ifndef __XML_SCHEMA_HXX #define __XML_SCHEMA_HXX // Begin prologue. // #include "citygml_export.hpp" #include "CityGMLBaseVisitor.h" // // End prologue. #include #if (XSD_INT_VERSION != 3030000L) #error XSD runtime version mismatch #endif #include #ifndef XSD_USE_CHAR #define XSD_USE_CHAR #endif #ifndef XSD_CXX_TREE_USE_CHAR #define XSD_CXX_TREE_USE_CHAR #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /** * @brief C++ namespace for the %http://www.w3.org/2001/XMLSchema * schema namespace. */ namespace xml_schema { // anyType and anySimpleType. // typedef ::xsd::cxx::tree::type type_base; /** * @brief C++ type corresponding to the anyType XML Schema * built-in type. */ class type; /** * @brief C++ type corresponding to the anySimpleType XML Schema * built-in type. */ typedef ::xsd::cxx::tree::simple_type< type > simple_type; /** * @brief Alias for the anyType type. */ typedef ::xsd::cxx::tree::type container; // 8-bit // /** * @brief C++ type corresponding to the byte XML Schema * built-in type. */ typedef signed char byte; /** * @brief C++ type corresponding to the unsignedByte XML Schema * built-in type. */ typedef unsigned char unsigned_byte; // 16-bit // /** * @brief C++ type corresponding to the short XML Schema * built-in type. */ typedef short short_; /** * @brief C++ type corresponding to the unsignedShort XML Schema * built-in type. */ typedef unsigned short unsigned_short; // 32-bit // /** * @brief C++ type corresponding to the int XML Schema * built-in type. */ typedef int int_; /** * @brief C++ type corresponding to the unsignedInt XML Schema * built-in type. */ typedef unsigned int unsigned_int; // 64-bit // /** * @brief C++ type corresponding to the long XML Schema * built-in type. */ typedef long long long_; /** * @brief C++ type corresponding to the unsignedLong XML Schema * built-in type. */ typedef unsigned long long unsigned_long; // Supposed to be arbitrary-length integral types. // /** * @brief C++ type corresponding to the integer XML Schema * built-in type. */ typedef long long integer; /** * @brief C++ type corresponding to the nonPositiveInteger XML Schema * built-in type. */ typedef long long non_positive_integer; /** * @brief C++ type corresponding to the nonNegativeInteger XML Schema * built-in type. */ typedef unsigned long long non_negative_integer; /** * @brief C++ type corresponding to the positiveInteger XML Schema * built-in type. */ typedef unsigned long long positive_integer; /** * @brief C++ type corresponding to the negativeInteger XML Schema * built-in type. */ typedef long long negative_integer; // Boolean. // /** * @brief C++ type corresponding to the boolean XML Schema * built-in type. */ typedef bool boolean; // Floating-point types. // /** * @brief C++ type corresponding to the float XML Schema * built-in type. */ typedef float float_; /** * @brief C++ type corresponding to the double XML Schema * built-in type. */ typedef double double_; /** * @brief C++ type corresponding to the decimal XML Schema * built-in type. */ typedef double decimal; // String types. // /** * @brief C++ type corresponding to the string XML Schema * built-in type. */ typedef ::xsd::cxx::tree::string< char, simple_type > string; /** * @brief C++ type corresponding to the normalizedString XML Schema * built-in type. */ typedef ::xsd::cxx::tree::normalized_string< char, string > normalized_string; /** * @brief C++ type corresponding to the token XML Schema * built-in type. */ typedef ::xsd::cxx::tree::token< char, normalized_string > token; /** * @brief C++ type corresponding to the Name XML Schema * built-in type. */ typedef ::xsd::cxx::tree::name< char, token > name; /** * @brief C++ type corresponding to the NMTOKEN XML Schema * built-in type. */ typedef ::xsd::cxx::tree::nmtoken< char, token > nmtoken; /** * @brief C++ type corresponding to the NMTOKENS XML Schema * built-in type. */ typedef ::xsd::cxx::tree::nmtokens< char, simple_type, nmtoken > nmtokens; /** * @brief C++ type corresponding to the NCName XML Schema * built-in type. */ typedef ::xsd::cxx::tree::ncname< char, name > ncname; /** * @brief C++ type corresponding to the language XML Schema * built-in type. */ typedef ::xsd::cxx::tree::language< char, token > language; // ID/IDREF. // /** * @brief C++ type corresponding to the ID XML Schema * built-in type. */ typedef ::xsd::cxx::tree::id< char, ncname > id; /** * @brief C++ type corresponding to the IDREF XML Schema * built-in type. */ typedef ::xsd::cxx::tree::idref< char, ncname, type > idref; /** * @brief C++ type corresponding to the IDREFS XML Schema * built-in type. */ typedef ::xsd::cxx::tree::idrefs< char, simple_type, idref > idrefs; // URI. // /** * @brief C++ type corresponding to the anyURI XML Schema * built-in type. */ typedef ::xsd::cxx::tree::uri< char, simple_type > uri; // Qualified name. // /** * @brief C++ type corresponding to the QName XML Schema * built-in type. */ typedef ::xsd::cxx::tree::qname< char, simple_type, uri, ncname > qname; // Binary. // /** * @brief Binary buffer type. */ typedef ::xsd::cxx::tree::buffer< char > buffer; /** * @brief C++ type corresponding to the base64Binary XML Schema * built-in type. */ typedef ::xsd::cxx::tree::base64_binary< char, simple_type > base64_binary; /** * @brief C++ type corresponding to the hexBinary XML Schema * built-in type. */ typedef ::xsd::cxx::tree::hex_binary< char, simple_type > hex_binary; // Date/time. // /** * @brief Time zone type. */ typedef ::xsd::cxx::tree::time_zone time_zone; /** * @brief C++ type corresponding to the date XML Schema * built-in type. */ typedef ::xsd::cxx::tree::date< char, simple_type > date; /** * @brief C++ type corresponding to the dateTime XML Schema * built-in type. */ typedef ::xsd::cxx::tree::date_time< char, simple_type > date_time; /** * @brief C++ type corresponding to the duration XML Schema * built-in type. */ typedef ::xsd::cxx::tree::duration< char, simple_type > duration; /** * @brief C++ type corresponding to the gDay XML Schema * built-in type. */ typedef ::xsd::cxx::tree::gday< char, simple_type > gday; /** * @brief C++ type corresponding to the gMonth XML Schema * built-in type. */ typedef ::xsd::cxx::tree::gmonth< char, simple_type > gmonth; /** * @brief C++ type corresponding to the gMonthDay XML Schema * built-in type. */ typedef ::xsd::cxx::tree::gmonth_day< char, simple_type > gmonth_day; /** * @brief C++ type corresponding to the gYear XML Schema * built-in type. */ typedef ::xsd::cxx::tree::gyear< char, simple_type > gyear; /** * @brief C++ type corresponding to the gYearMonth XML Schema * built-in type. */ typedef ::xsd::cxx::tree::gyear_month< char, simple_type > gyear_month; /** * @brief C++ type corresponding to the time XML Schema * built-in type. */ typedef ::xsd::cxx::tree::time< char, simple_type > time; // Entity. // /** * @brief C++ type corresponding to the ENTITY XML Schema * built-in type. */ typedef ::xsd::cxx::tree::entity< char, ncname > entity; /** * @brief C++ type corresponding to the ENTITIES XML Schema * built-in type. */ typedef ::xsd::cxx::tree::entities< char, simple_type, entity > entities; // Namespace information and list stream. Used in // serialization functions. // /** * @brief Namespace serialization information. */ typedef ::xsd::cxx::xml::dom::namespace_info< char > namespace_info; /** * @brief Namespace serialization information map. */ typedef ::xsd::cxx::xml::dom::namespace_infomap< char > namespace_infomap; /** * @brief List serialization stream. */ typedef ::xsd::cxx::tree::list_stream< char > list_stream; /** * @brief Serialization wrapper for the %double type. */ typedef ::xsd::cxx::tree::as_double< double_ > as_double; /** * @brief Serialization wrapper for the %decimal type. */ typedef ::xsd::cxx::tree::as_decimal< decimal > as_decimal; /** * @brief Simple type facet. */ typedef ::xsd::cxx::tree::facet facet; // Flags and properties. // /** * @brief Parsing and serialization flags. */ typedef ::xsd::cxx::tree::flags flags; /** * @brief Parsing properties. */ typedef ::xsd::cxx::tree::properties< char > properties; // Parsing/serialization diagnostics. // /** * @brief Error severity. */ typedef ::xsd::cxx::tree::severity severity; /** * @brief Error condition. */ typedef ::xsd::cxx::tree::error< char > error; /** * @brief List of %error conditions. */ typedef ::xsd::cxx::tree::diagnostics< char > diagnostics; // Exceptions. // /** * @brief Root of the C++/Tree %exception hierarchy. */ typedef ::xsd::cxx::tree::exception< char > exception; /** * @brief Exception indicating that the size argument exceeds * the capacity argument. */ typedef ::xsd::cxx::tree::bounds< char > bounds; /** * @brief Exception indicating that a duplicate ID value * was encountered in the object model. */ typedef ::xsd::cxx::tree::duplicate_id< char > duplicate_id; /** * @brief Exception indicating a parsing failure. */ typedef ::xsd::cxx::tree::parsing< char > parsing; /** * @brief Exception indicating that an expected element * was not encountered. */ typedef ::xsd::cxx::tree::expected_element< char > expected_element; /** * @brief Exception indicating that an unexpected element * was encountered. */ typedef ::xsd::cxx::tree::unexpected_element< char > unexpected_element; /** * @brief Exception indicating that an expected attribute * was not encountered. */ typedef ::xsd::cxx::tree::expected_attribute< char > expected_attribute; /** * @brief Exception indicating that an unexpected enumerator * was encountered. */ typedef ::xsd::cxx::tree::unexpected_enumerator< char > unexpected_enumerator; /** * @brief Exception indicating that the text content was * expected for an element. */ typedef ::xsd::cxx::tree::expected_text_content< char > expected_text_content; /** * @brief Exception indicating that a prefix-namespace * mapping was not provided. */ typedef ::xsd::cxx::tree::no_prefix_mapping< char > no_prefix_mapping; /** * @brief Exception indicating that the type information * is not available for a type. */ typedef ::xsd::cxx::tree::no_type_info< char > no_type_info; /** * @brief Exception indicating that the types are not * related by inheritance. */ typedef ::xsd::cxx::tree::not_derived< char > not_derived; /** * @brief Exception indicating a serialization failure. */ typedef ::xsd::cxx::tree::serialization< char > serialization; /** * @brief Error handler callback interface. */ typedef ::xsd::cxx::xml::error_handler< char > error_handler; /** * @brief DOM interaction. */ namespace dom { /** * @brief Automatic pointer for DOMDocument. */ using ::xsd::cxx::xml::dom::auto_ptr; /** * @brief DOM user data key for back pointers to tree nodes. */ const XMLCh* const tree_node_key = ::xsd::cxx::tree::user_data_keys::node; } } #include // Begin epilogue. // #include "xml-schema-custom.hxx" // // End epilogue. #endif // __XML_SCHEMA_HXX From Nicolas.FLACHET at cstb.fr Mon Dec 4 05:35:17 2017 From: Nicolas.FLACHET at cstb.fr (FLACHET Nicolas) Date: Mon Dec 4 05:35:28 2017 Subject: [xsd-users] Problem with substition groups In-Reply-To: <72d3683c035545e1b37430236dd76eb3@Lizherel.cstb.local> References: <0a47d2a9fe2a4384842ec50585575912@Lizherel.cstb.local> <290424950c734ae9bd777fbb67dac8f8@Lizherel.cstb.local> <72d3683c035545e1b37430236dd76eb3@Lizherel.cstb.local> Message-ID: <41a487d3913b46abafdf8b201671ba11@Lizherel.cstb.local> I think I was able to make a sample case with the problem. I put the xsd-schema.xsd I'm using, a test-schema.xsd that emulate a simple cityGML element and the options and command line I'm using. https://www.dropbox.com/s/njt4jzc658e2g6e/simple%20xsd.zip?dl=0 Best regards, Nicolas -----Message d'origine----- De?: xsd-users-bounces@codesynthesis.com [mailto:xsd-users-bounces@codesynthesis.com] De la part de FLACHET Nicolas Envoy??: lundi 4 d?cembre 2017 11:06 ??: xsd-users@codesynthesis.com Objet?: TR: [xsd-users] Problem with substition groups Yes, I used --generate-polymorphic and --polymorphic-type-all. I also use a xml-schema-custom that I get from the cityGML wiki page: http://wiki.codesynthesis.com/Schemas/CityGML I join my generated xs schema if it could be of any help. Im' stuggling to make a simple case, as gml (and so forth cityGML) are massively using extension and substitution. -----Message d'origine----- De?: Boris Kolpackov [mailto:boris@codesynthesis.com] Envoy??: samedi 2 d?cembre 2017 11:01 ??: FLACHET Nicolas Cc?: xsd-users@codesynthesis.com Objet?: Re: [xsd-users] Problem with substition groups FLACHET Nicolas writes: > > My main problem is that I cant get do that : > > > > Truitos test = dynamic_cast( > > building->GenericApplicationPropertyOfAbstractBuilding().at(0) ); > > > > Why can't you do that? Do you get an compile/runtime error? > > No, but the type "Truitos" doesn't exist in my generated classes. Ah, right, it is xml_schema::integer (which is why you tried to dynamic_cast to it). I see you are using --generate-xml-schema/--extern-xml-schema: > --extern-xml-schema xs/xml-schema.xsd Are you generating it with --generate-polymorphic and --polymorphic-type-all? Boris From boris at codesynthesis.com Tue Dec 5 04:10:53 2017 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Dec 5 04:11:04 2017 Subject: TR: [xsd-users] Problem with substition groups In-Reply-To: <72d3683c035545e1b37430236dd76eb3@Lizherel.cstb.local> References: <0a47d2a9fe2a4384842ec50585575912@Lizherel.cstb.local> <290424950c734ae9bd777fbb67dac8f8@Lizherel.cstb.local> <72d3683c035545e1b37430236dd76eb3@Lizherel.cstb.local> Message-ID: FLACHET Nicolas writes: > > > Ok, I've refreshed my memory and C++/Tree does not support polymorphism for XML Schema types that are mapped to fundamental C++ types. So in the above example type integer (shouldn't it be xs:integer?) is the problem. I've also looked into GML/CityGML schemas and I don't see this element (Truitos) defines in any of them. So this must be coming from another schema and this explains why nobody else using GML/CityGML had the same issue. The easiest workaround would be to tweak the schema to use a type derived from xs:integer. For example: Boris From Nicolas.FLACHET at cstb.fr Wed Dec 6 04:03:27 2017 From: Nicolas.FLACHET at cstb.fr (FLACHET Nicolas) Date: Wed Dec 6 04:03:47 2017 Subject: TR: [xsd-users] Problem with substition groups In-Reply-To: References: <0a47d2a9fe2a4384842ec50585575912@Lizherel.cstb.local> <290424950c734ae9bd777fbb67dac8f8@Lizherel.cstb.local> <72d3683c035545e1b37430236dd76eb3@Lizherel.cstb.local> Message-ID: <37b5f5cb84f44a0bb69ff2165e67844e@Lizherel.cstb.local> Thanks Boris, that could do the trick I'll try it on the large schema database ! > I don't see this element (Truitos) defines in any of them. So this must be coming from another schema and this explains why nobody else using GML/CityGML had the same issue. xsd generate cityGML quite nicely, but our main problem now is with ADE (domain extension) that add polymorphic attribute to multi-polymorphic classes. "truitos" is an attribute for our own ADE, but we find the same problem with the energy ADE for exemple. http://www.citygmlwiki.org/index.php/CityGML_Energy_ADE with, for exemple, the attributes : Still, this ADE is on alpha or beta state, and I have no problem with the noise ADE. -----Message d'origine----- De?: Boris Kolpackov [mailto:boris@codesynthesis.com] Envoy??: mardi 5 d?cembre 2017 10:11 ??: FLACHET Nicolas Cc?: xsd-users@codesynthesis.com Objet?: Re: TR: [xsd-users] Problem with substition groups FLACHET Nicolas writes: > type="xs:anyType" abstract="true"/> > > substitutionGroup="_GenericApplicationPropertyOfAbstractBuilding"/> Ok, I've refreshed my memory and C++/Tree does not support polymorphism for XML Schema types that are mapped to fundamental C++ types. So in the above example type integer (shouldn't it be xs:integer?) is the problem. I've also looked into GML/CityGML schemas and I don't see this element (Truitos) defines in any of them. So this must be coming from another schema and this explains why nobody else using GML/CityGML had the same issue. The easiest workaround would be to tweak the schema to use a type derived from xs:integer. For example: Boris From Nicolas.FLACHET at cstb.fr Thu Dec 7 05:56:46 2017 From: Nicolas.FLACHET at cstb.fr (FLACHET Nicolas) Date: Thu Dec 7 05:57:05 2017 Subject: TR: [xsd-users] Problem with substition groups In-Reply-To: <37b5f5cb84f44a0bb69ff2165e67844e@Lizherel.cstb.local> References: <0a47d2a9fe2a4384842ec50585575912@Lizherel.cstb.local> <290424950c734ae9bd777fbb67dac8f8@Lizherel.cstb.local> <72d3683c035545e1b37430236dd76eb3@Lizherel.cstb.local> <37b5f5cb84f44a0bb69ff2165e67844e@Lizherel.cstb.local> Message-ID: Hello, I used the polymorphic attribute tricks and it works for the most part : * I can read and write a cityGML file with the poymorphic elements. * I can ad an element to the building sequence and it's correcly writed on the deserialization. However, I don't know how to read back an element. Here's an exemple for "Truitos": core::AbstractCityObjectType::_GenericApplicationPropertyOfCityObject_sequence gapSequence; ade::poly_Truitost aTruitos(10); gapSequence.push_back(aTruitos); And to read it back : for (int i = 0; i < b->_ gapSequence ().size(); ++i) { ade::poly_Truitost *test = dynamic_cast< ade::poly_Truitost *>(& gapSequence .at(i) ); } However, test is always null. Best Regards, Nicolas -----Message d'origine----- De?: xsd-users-bounces@codesynthesis.com [mailto:xsd-users-bounces@codesynthesis.com] De la part de FLACHET Nicolas Envoy??: mercredi 6 d?cembre 2017 10:03 ??: xsd-users@codesynthesis.com Objet?: RE: TR: [xsd-users] Problem with substition groups Thanks Boris, that could do the trick I'll try it on the large schema database ! > I don't see this element (Truitos) defines in any of them. So this must be coming from another schema and this explains why nobody else using GML/CityGML had the same issue. xsd generate cityGML quite nicely, but our main problem now is with ADE (domain extension) that add polymorphic attribute to multi-polymorphic classes. "truitos" is an attribute for our own ADE, but we find the same problem with the energy ADE for exemple. http://www.citygmlwiki.org/index.php/CityGML_Energy_ADE with, for exemple, the attributes : Still, this ADE is on alpha or beta state, and I have no problem with the noise ADE. -----Message d'origine----- De?: Boris Kolpackov [mailto:boris@codesynthesis.com] Envoy??: mardi 5 d?cembre 2017 10:11 ??: FLACHET Nicolas Cc?: xsd-users@codesynthesis.com Objet?: Re: TR: [xsd-users] Problem with substition groups FLACHET Nicolas writes: > type="xs:anyType" abstract="true"/> > > substitutionGroup="_GenericApplicationPropertyOfAbstractBuilding"/> Ok, I've refreshed my memory and C++/Tree does not support polymorphism for XML Schema types that are mapped to fundamental C++ types. So in the above example type integer (shouldn't it be xs:integer?) is the problem. I've also looked into GML/CityGML schemas and I don't see this element (Truitos) defines in any of them. So this must be coming from another schema and this explains why nobody else using GML/CityGML had the same issue. The easiest workaround would be to tweak the schema to use a type derived from xs:integer. For example: Boris From isharp at atis.org Thu Dec 7 09:45:13 2017 From: isharp at atis.org (Iain Sharp) Date: Thu Dec 7 09:45:44 2017 Subject: [xsd-users] Tool for documenting/visualizing C++ Tree Output Message-ID: Hi Folks, I am working with a big XSD file defined by committee (literally) which has lots of features used apparently at random (deeply nested named types and inline types, different cardinality classes all over the place, lots of different types of string for different purposes etc.). XSD Tree copes with this all very well. The problem is that is can be difficult to use the resulting C++ classes because it is very hard to keep track of all the different types and which setters/getters have Optional or Sequence cardinality applied. Are there any tools that can automatically provide high-level diagrams of the classes and the available methods? I guess the obvious thing is to try doxygen, but I suspect that will just be a mass of detail that is still hard to work with. I am primarily interested in just basic constructor/setter/getter functions. The serialization aspects are not that relevant to this exercise. My ideal output would be for each class to show, with cross-references/links: * What are the parameters/types needed for the constructor, setter and getter methods. * For the setters and getters what is the cardinality class Regards Iain From boris at codesynthesis.com Fri Dec 8 03:09:35 2017 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Dec 8 03:09:47 2017 Subject: [xsd-users] Tool for documenting/visualizing C++ Tree Output In-Reply-To: References: Message-ID: Iain Sharp writes: > Are there any tools that can automatically provide high-level diagrams > of the classes and the available methods? I guess the obvious thing is > to try doxygen [...] Yes, Doxygen (--generate-doxygen option) is your best bet. You will even have the documentation from the schema copied over. You can see an example of what it looks like here: https://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/hello/html/annotated.html For more information on Doxygen support in C++/Tree, see Section 2.7 "Generating Documentation" in the C++/Tree Mapping Getting Started Guide: https://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#2.7 Boris From isharp at atis.org Fri Dec 8 12:45:02 2017 From: isharp at atis.org (Iain Sharp) Date: Fri Dec 8 12:45:26 2017 Subject: [xsd-users] Tool for documenting/visualizing C++ Tree Output In-Reply-To: References: Message-ID: Thanks - with a bit of tweaking of parameters I was able to get good output from Doxygen. Just one question: even if I include the headers from XSD tree in the Doxygen input I still get output like: typedef ::xsd::cxx::tree::optional< App_ID_type > App_ID_optional Element optional container type. App_ID_optional & App_ID () Return a read-write reference to the element container. More... In this example, the App_ID_optional isn't documented except as an instance of the templated type which itself doesn't seem to appear in the Doxygen output. Is there a way to add some documentation for common templated types like optional etc. to the output? Regards Iain -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: 08 December 2017 08:10 To: Iain Sharp Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Tool for documenting/visualizing C++ Tree Output Iain Sharp writes: > Are there any tools that can automatically provide high-level diagrams > of the classes and the available methods? I guess the obvious thing is > to try doxygen [...] Yes, Doxygen (--generate-doxygen option) is your best bet. You will even have the documentation from the schema copied over. You can see an example of what it looks like here: https://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/hello/html/annotated.html For more information on Doxygen support in C++/Tree, see Section 2.7 "Generating Documentation" in the C++/Tree Mapping Getting Started Guide: https://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#2.7 Boris From boris at codesynthesis.com Mon Dec 11 09:11:21 2017 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Dec 11 09:11:32 2017 Subject: [xsd-users] Tool for documenting/visualizing C++ Tree Output In-Reply-To: References: Message-ID: Iain Sharp writes: > In this example, the App_ID_optional isn't documented except as an > instance of the templated type which itself doesn't seem to appear > in the Doxygen output. Yes, optional (as well as sequence) haven't been documented yet. Boris From boris at codesynthesis.com Mon Dec 11 10:43:07 2017 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Dec 11 10:43:17 2017 Subject: TR: [xsd-users] Problem with substition groups In-Reply-To: References: <0a47d2a9fe2a4384842ec50585575912@Lizherel.cstb.local> <290424950c734ae9bd777fbb67dac8f8@Lizherel.cstb.local> <72d3683c035545e1b37430236dd76eb3@Lizherel.cstb.local> <37b5f5cb84f44a0bb69ff2165e67844e@Lizherel.cstb.local> Message-ID: FLACHET Nicolas writes: > core::AbstractCityObjectType::_GenericApplicationPropertyOfCityObject_sequence gapSequence; > ade::poly_Truitost aTruitos(10); > gapSequence.push_back(aTruitos); > > And to read it back : > for (int i = 0; i < b->_ gapSequence ().size(); ++i) > { > ade::poly_Truitost *test = dynamic_cast< ade::poly_Truitost *>(& gapSequence .at(i) ); > } This should work. Try to step through push_back() code in the debugger. There it should use _clone() to polymorphically copy aTruitos into the sequence. Boris From Nicolas.FLACHET at cstb.fr Tue Dec 12 04:36:22 2017 From: Nicolas.FLACHET at cstb.fr (FLACHET Nicolas) Date: Tue Dec 12 04:36:41 2017 Subject: TR: [xsd-users] Problem with substition groups In-Reply-To: References: <0a47d2a9fe2a4384842ec50585575912@Lizherel.cstb.local> <290424950c734ae9bd777fbb67dac8f8@Lizherel.cstb.local> <72d3683c035545e1b37430236dd76eb3@Lizherel.cstb.local> <37b5f5cb84f44a0bb69ff2165e67844e@Lizherel.cstb.local> Message-ID: Hello, With the _clone() method, it works. Thanks ! -----Message d'origine----- De?: Boris Kolpackov [mailto:boris@codesynthesis.com] Envoy??: lundi 11 d?cembre 2017 16:43 ??: FLACHET Nicolas Cc?: xsd-users@codesynthesis.com Objet?: Re: TR: [xsd-users] Problem with substition groups FLACHET Nicolas writes: > core::AbstractCityObjectType::_GenericApplicationPropertyOfCityObject_ > sequence gapSequence; ade::poly_Truitost aTruitos(10); > gapSequence.push_back(aTruitos); > > And to read it back : > for (int i = 0; i < b->_ gapSequence ().size(); ++i) { > ade::poly_Truitost *test = dynamic_cast< ade::poly_Truitost *>(& > gapSequence .at(i) ); } This should work. Try to step through push_back() code in the debugger. There it should use _clone() to polymorphically copy aTruitos into the sequence. Boris From isharp at atis.org Tue Dec 12 07:51:25 2017 From: isharp at atis.org (Iain Sharp) Date: Tue Dec 12 07:51:57 2017 Subject: [xsd-users] Tool for documenting/visualizing C++ Tree Output In-Reply-To: References: Message-ID: Thanks - that's a shame, but at least I understand why it isn't appearing! Related to this, it may be helpful to add a few more comments to your interface example in section 2.8.2 of the C++/Tree User Manual. A few things weren't obvious to me on a first reading. Here is my proposal: " // Get/set interface. // public: // Check if an element is present or not bool present () const; // Get an element if it is present - an error otherwise const X& get () const; // Get an element if it is present - an error otherwise X& get (); // Makes a deep copy. // void set (const X&); // Assumes ownership. // void set (std::[auto|unique]_ptr); // Detach and return the contained value. // std::[auto|unique]_ptr detach (); // Delete an element void reset (); };" Regards Iain -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: 11 December 2017 14:11 To: Iain Sharp Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Tool for documenting/visualizing C++ Tree Output Iain Sharp writes: > In this example, the App_ID_optional isn't documented except as an > instance of the templated type which itself doesn't seem to appear in > the Doxygen output. Yes, optional (as well as sequence) haven't been documented yet. Boris From jnw at xs4all.nl Tue Dec 12 13:28:12 2017 From: jnw at xs4all.nl (Jeroen N. Witmond) Date: Tue Dec 12 13:28:31 2017 Subject: [xsd-users] XML Schema Authoring Guide has disappeared Message-ID: Greetings, On https://www.codesynthesis.com/projects/xsd/ , https://www.codesynthesis.com/projects/xsde/ and https://www.codesynthesis.com/pipermail/xsd-users/2005-October/000055.html there is a reference to an "XML Schema Authoring Guide" https://www.codesynthesis.com/projects/xsd/documentation/schema-authoring-guide.xhtml This file seems to be both useful and absent ... Jeroen. From boris at codesynthesis.com Wed Dec 13 07:34:30 2017 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Dec 13 07:34:43 2017 Subject: [xsd-users] XML Schema Authoring Guide has disappeared In-Reply-To: References: Message-ID: Jeroen N. Witmond writes: > This file seems to be both useful and absent ... We don't have the resources to maintain (and answer questions about) this anymore so we have removed it. I've removed the broken links from the XSD and XSD/e project pages. Thanks, Boris From Z.Wenhan at hud.ac.uk Thu Dec 14 10:10:35 2017 From: Z.Wenhan at hud.ac.uk (Wenhan Zeng) Date: Thu Dec 14 13:41:08 2017 Subject: [xsd-users] XSD binary Message-ID: Dear Sir/madam, could u please help build a binary. my platform is: windows 10 (64bit), and visual studio 2017. Thank you very much! Regards Wenhan Zeng University of Huddersfield inspiring tomorrow's professionals. [http://marketing.hud.ac.uk/_HOSTED/EmailSig2014/EmailSigFooter.jpg] This transmission is confidential and may be legally privileged. If you receive it in error, please notify us immediately by e-mail and remove it from your system. If the content of this e-mail does not relate to the business of the University of Huddersfield, then we do not endorse it and will accept no liability. From boris at codesynthesis.com Fri Dec 15 08:58:44 2017 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Dec 15 08:58:57 2017 Subject: [xsd-users] XSD binary In-Reply-To: References: Message-ID: Wenhan Zeng writes: > could u please help build a binary. > > my platform is: windows 10 (64bit), and visual studio 2017. Binary of what? If you are looking for the XSD compiler, the binaries are available here: https://codesynthesis.com/products/xsd/download.xhtml All other binaries (Xerces-C++, etc) you will have to build yourself from source. Boris