From carmi at avaya.com Wed Mar 1 08:23:27 2006 From: carmi at avaya.com (Carmi, Eyal (Eyal)) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] Default value for complex type/element Message-ID: Hi, I have two elements, both belong to the same complex type(see example below). I wish to set different default values for these elements, is that possible? Also, is is possible to create a "fix" complexElement (I.e. to represent a complex constant). Example: Thanks, Eyal Carmi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060301/d8e61310/attachment.htm From marco.fischer at chipvision.com Thu Mar 2 05:50:52 2006 From: marco.fischer at chipvision.com (Marco Fischer) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] Using XSD for partial XML Data Binding in a large application Message-ID: <1141296652.8090.43.camel@wiesel.fauna> Hi, suppose you have a large application and want to use data binding for a portion of the application's data model. I encountered the following problem: since the data binding models only a part of the whole data model, the interface of the generated classes might be only a subset of what is actually desired in the application. For example, the application wishes to access an element X associated with an element A. ____________ ____________ | A | | X | |____________| |____________| | | ref | | | |--------------->| | |____________| |____________| If both elements are modelled in the data binding, the generated class for A provides an appropriate member function, something like X A::ref(). If X is not part of the data binding, then of course there's no such member function. There could also be needs to have other member functions in the interface of A, not modelled in the data binding. What would be a good approach to integrate a "partial" data binding into an existing application? Does it make sense to write a set of adapters/wrappers which encapsulate instances of data binding model objects, and provide/extend their interface as required by the application? This approach seems to be a bit redundant, as the purpose of data binding actually is that the application can use the model objects directly. Is there any possibility to specify member function stubs to be generated for model objects, which can be implemented manually? Thanks for any thoughts or ideas... Cheers, Marco From vdevaux at jetmultimedia.fr Thu Mar 2 09:33:39 2006 From: vdevaux at jetmultimedia.fr (Virgile Devaux) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] unexpected top-level element: 'redefine' Message-ID: <44070243.1040806@jetmultimedia.fr> Hi, i've got the following error when executing xsd cxx-tree on a w3c schema: > error: unexpected top-level element: 'redefine' Is this tag not implemented? From boris at codesynthesis.com Thu Mar 2 09:34:03 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] unexpected top-level element: 'redefine' In-Reply-To: <44070243.1040806@jetmultimedia.fr> References: <44070243.1040806@jetmultimedia.fr> Message-ID: <20060302143403.GA2791@karelia> Virgile, Virgile Devaux writes: > i've got the following error when executing xsd cxx-tree on a w3c schema: > > error: unexpected top-level element: 'redefine' > Is this tag not implemented? No, redefine is not yet supported. The problem with this mechanism is that there is no appropriate facilities in C++ to map to. BTW, which W3 schema is that? hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060302/45d71802/attachment.pgp From vdevaux at jetmultimedia.fr Thu Mar 2 09:57:35 2006 From: vdevaux at jetmultimedia.fr (Virgile Devaux) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] unexpected top-level element: 'redefine' In-Reply-To: <20060302143403.GA2791@karelia> References: <44070243.1040806@jetmultimedia.fr> <20060302143403.GA2791@karelia> Message-ID: <440707DF.8070001@jetmultimedia.fr> first thank you for your quick response!! i tried to test xsd on the voice xml schema... But it's indeed a complex schema... Maybe i'll get a result by making it lighter (i'll try to remove some of the not-so-needed features including the redefines that bother me). Bye From boris at codesynthesis.com Fri Mar 3 07:16:34 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] Default value for complex type/element In-Reply-To: References: Message-ID: <20060303121634.GA3073@karelia> Eyal, Please note that your question is about XML Schema while this mailing list is for XML Schema to C++ compiler. You may get better resultes by posting such questions to xmlschema-dev@w3.org: http://lists.w3.org/Archives/Public/xmlschema-dev/ Carmi, Eyal (Eyal) writes: > I have two elements, both belong to the same complex type(see example > below). I wish to set different default values for these elements, is > that possible? Default/fixed values can only be specified for elements/attributes of simple types. As a result you cannot do it for 'myType' because it is a complex type. > Also, is is possible to create a "fix" complexElement > (I.e. to represent a complex constant). No, there is no such facility in XML Schema. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060303/07874194/attachment.pgp From boris at codesynthesis.com Fri Mar 3 07:49:57 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] Using XSD for partial XML Data Binding in a large application In-Reply-To: <1141296652.8090.43.camel@wiesel.fauna> References: <1141296652.8090.43.camel@wiesel.fauna> Message-ID: <20060303124957.GB3073@karelia> Marco, Marco Fischer writes: > For example, the application wishes to access an element X associated > with an element A. > > ____________ ____________ > | A | | X | > |____________| |____________| > | | ref | | > | |--------------->| | > |____________| |____________| > > > If both elements are modelled in the data binding, the generated class > for A provides an appropriate member function, something like > > X A::ref(). > > If X is not part of the data binding, then of course there's no such > member function. There could also be needs to have other member > functions in the interface of A, not modelled in the data binding. This is a hard problem. There are currently two approaches that we are evaluating. Suppose you have the following schema: ... And you want to extend A. As you correctly pointed above, it is not enough to merely derive from A and using that type when constructing the tree. When you call b.a () you get A, not your derived class. The only way to get to the actual type is by casting it: B& b (...); MyA& (static_cast (b.a ())); The first solution would allow you to inherit the generated class from your own type, e.g.,: ... (or doing this using a command line option). You may still need to create another type and derive it from A if you want to use the data from the binding. For example: struct AInterface { virtual void print () = 0; }; class A: public AInterface, ... // generated class { }; class AImpl: public A { virtual void print () { // use data from A } }; Now you will be able to write something like this: B& b (...); A& (b.a ()); a.print (); The main disadvantage of this approach is that it is quite verbose. The second solution is to generate class templates for schema types instead of normal classes: template<...> class A { ... }; template class B { A& a (); ... }; Now, in your code, you can do something like this: class MyA: A<...> { void print () { // use data from A } }; typedef B MyB; MyB& b (...); MyA& (b.a ()); a.print (); The problem with this approach is that it is a whole new mapping ;-). You can also read some more on this topic in these threads: http://codesynthesis.com/pipermail/xsd-users/2005-September/000024.html http://codesynthesis.com/pipermail/xsd-users/2006-February/000219.html We probably could implement the first solution after 2.0.0 is out. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060303/854010ae/attachment.pgp From boris at codesynthesis.com Wed Mar 8 10:43:07 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] plans for the xsd 2.X.Y release series Message-ID: <20060308154307.GA23852@karelia> Good day, It is about time to release xsd 2.0.0 and we would like to share with you our plans for this release series. Below is a list of major new features that we plan to implement. If you have a need for something that is not on the list, it's a good time to bring it up. Also your feedback on the proposed new features is always appreciated. General * New cardinality calculator [2.0.0]. This will improve support for schemas that use complex structures with repeated elements, e.g., For this schema, xsd-1.9.0 will assume cardinality of element 'c' to be "optional" while it is actually "one". * New identifier escaping code [2.0.0]. With this feature xsd will be able to generate proper code for schemas that use the same name for an element and an attribute in the same type or use several elements/attributes with different qualified names but with the same local name, e.g., C++/Tree * Customization of the generated code. This will include adding base classes to all or individual generated types as well as deriving from the generated types and using the resulting types to construct the in-memory representation. See the following thread for more information: http://codesynthesis.com/pipermail/xsd-users/2006-March/000254.html * Perfect parser. With this feature, complete XML Schema validation will be (optionally) performed in the generated code rather than (optionally) by a separate validating parser. * In-memory validation. This feature will allow to validate an in- memory instance without first converting it to DOM or XML. * Minimization and cleanup of the generated code. C++/Parser * Perfect parser. With this feature, complete XML Schema validation will be (optionally) performed in the generated code rather than (optionally) by a separate validating parser. * Specialization for void as a parser hook return type. * Generation of sample implementation. This will allow you to implement your logic by modifying working code rather than starting from scratch. -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060308/fd672e6d/attachment.pgp From boris at codesynthesis.com Mon Mar 13 09:03:03 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] xsd 2.0.0 released Message-ID: <20060313140303.GC32664@karelia> Good day, We've released xsd 2.0.0. The NEWS file entries for this version are as follows: * New cardinality calculator. This improves support for schemas that use complex structures with repeated elements, e.g., * New identifier escaping code. With this feature xsd generates proper code for schemas that use the same name for an element and an attribute in the same type or use several elements/attributes with different qualified names but with the same local name, e.g., C++/Tree * New option, --generate-polymorphic, triggers generation of polymorphism-aware code. Before this release xsd used to always generate polymorphism-aware code. However, it appears to be quite wasteful in terms of the generated code size (up to 40%). You will now need to explicitly specify this option if you use substitution groups or xsi:type. A warning is issued if this option is not specified but the schema makes use of substitution groups. * New options, --root-element-first, --root-element-last, --root-element-all, --root-element-none, and --root-element, control generation of parsing and serialization functions. With these options you can avoid generating extra code for global elements that are not document roots. See the man pages for details. * New options, --parts and -parts-suffix, allows you to split generated source code into a number of parts. This is useful when translating large, monolithic schemas and a C++ compiler is not able to compile the resulting source code at once (usually due to insufficient memory). * New option, --generate-default-ctor, triggers generation of default constructors even for types that have required members. Required members of an instance constructed using such a constructor are not initialized and accessing them results in undefined behavior. Thanks to Jean-Francois Dube for suggesting this feature. * New option, --generate-from-base-ctor, triggers generation of constructors that expect an instance of a base type followed by all required members. Thanks to Jean-Francois Dube for suggesting this feature. * Information scopes for attributes and elements with default/fixed values now define the public static default_value function which allows one to obtain the default/fixed value for the element/attribute. Thanks to Dave Moss for suggesting this feature. * MSVC 7.1 has a limit on the length of the "if else if" chain. This results in ICE when compiling generated code for enumerations with a large number of values. This version addresses this issue. Thanks to Cyrille Ch?p?lov for reporting this and suggesting a fix. C++/Parser * The parser construction API has changed. Now, for element 'foo', the name of the parser modifier function is 'foo_parser'. Likewise, operator() for setting all parsers at once has been changed to the 'parsers' function. Precompiled binary distributions for various platforms are available from the product's download page: http://codesynthesis.com/products/xsd/download.xhtml Source code for this release is available from the project's web page: http://codesynthesis.com/projects/xsd/ SHA1 checksums for the files: ac3995abc49ba5b4361c78a5c45080336ebe9b2d xsd-2.0.0.tar.bz2 af02a006c3c4c62662a1a6e8b5be03042263c7d5 xsd_2.0.0-1_i386.deb bbbbaa21d529ad6025963e0fd77b7644177e8380 xsd-2.0.0-1.i686.rpm 72de6e6c2d75a5f369e4540802f7e8a5d65975e0 xsd-2.0.0-i686-linux-gnu.tar.bz2 6f08f742154f68b7c88681733be2c0f90f630cd9 xsd_2.0.0-1_amd64.deb f429995a3902a0b53a052280c23cfe4cbb8e0e68 xsd-2.0.0-1.x86_64.rpm 55d065a82685bbd72506a8a5366507d5e118648f xsd-2.0.0-x86_64-linux-gnu.tar.bz2 4dbde7671eb5390a9cd5f82fc42902da707fc1ac xsd-2.0.0-hppa-hpux.tar.gz 2c43fb2a3b1d6cd3ecf7da7f360a26ce11b9bab3 xsd-2.0.0-hppa-hpux.tar.bz2 568f4c6b039f0358c2d3321dda967e0e1eecc4d5 xsd-2.0.0-powerpc-macosx.tar.bz2 508bdb7900a6c9e11547ed3fb028d2d600cf7273 xsd-2.0.0-sparc-solaris.tar.gz c2d9fdce523ffc902250c01ef54d74f06417793b xsd-2.0.0-sparc-solaris.tar.bz2 1cfb400be84f2aa97854bad5391b849f4e6c6328 xsd-2.0.0-i686-windows.zip have fun, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060313/4ea0e671/attachment.pgp From Abhishek.Agarwal at nortelgov.com Mon Mar 13 10:29:43 2006 From: Abhishek.Agarwal at nortelgov.com (Agarwal, Abhishek) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] Compilation Message-ID: <8D0C5C7A848CE0469B41D1A6C7ED3C51E73809@MAILIS.pecs.com> Hello All, I am new to this and hence i dont know if i am asking a duplicate question. I am trying to compile the xsd emaples but unable to do so. Is there any place where i can get the istruction on how to compile the package. Thanks Abhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060313/4720970a/attachment.htm From boris at codesynthesis.com Mon Mar 13 12:59:51 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] Compilation In-Reply-To: <8D0C5C7A848CE0469B41D1A6C7ED3C51E73809@MAILIS.pecs.com> References: <8D0C5C7A848CE0469B41D1A6C7ED3C51E73809@MAILIS.pecs.com> Message-ID: <20060313175951.GA1053@karelia> Hi Abhishek, Agarwal, Abhishek writes: > I am new to this and hence i dont know if i am asking a duplicate question. > I am trying to compile the xsd emaples but unable to do so. Is there any > place where i can get the istruction on how to compile the package. There is the README file in each package that gives instructions on how to compile examples on the platform the package is for. These README files are also available online at: http://codesynthesis.com/products/xsd/download.xhtml Just scroll down to the second table, choose your OS and the corresponding README file will be on the left, in the last column. If this does not help, please provide more information, e.g., which platform you are trying to compile the examples and what exactly goes wrong. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060313/86f1892b/attachment.pgp From boris at codesynthesis.com Mon Mar 13 14:40:58 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] Parsing the Collada 1.3.1 XSD In-Reply-To: <1136488542.3994.421.camel@debian> References: <1136316233.3994.58.camel@debian> <20060104092414.GA4273@karelia> <1136428498.3994.398.camel@debian> <20060105180436.GA18065@karelia> <1136488542.3994.421.camel@debian> Message-ID: <20060313194058.GA1179@karelia> Hi Mark, > On Thu, 2006-01-05 at 20:04 +0200, Boris Kolpackov wrote: > > > Marcus writes: > > > > > I tried to find COLLADA schema 1.4 but all I can get is 1.3.1. I could > > run xsd on it see if there are any warnings wrt anonymous types and code > > bloat. > > The 1.4 schema will be released today I expect. It'll be at khronos.org. We've got most of the capabilities in xsd to compile COLLADA 1.4 schema. There are still some minor tweaks I had to do: 1. I had to remove default values in lines 4563 and 4564. Xerces-C++ has a bug in its schema processor which prevents this construct from being handled properly. This is fixed in the Xerces repo and will appear in the next release. 2. This is actually something that you may want to address in future revisions: In your schema, you define a bunch of base types (bool, dateTime, etc.) towards the end of the schema and inherit from those types before they were defined. We call it "forward inheritance". This is valid in XML Schema but not in C++. We detect such cases in our compiler and ask the user to rearrange their schemas. So I moved the Primitive Types, Container Types and Aggregate Types right on top. After that I tried to compile it without morphing anonymous types: $ xsd cxx-tree --generate-polymorphic --root-element-first COLLADASchema_140.xsd There are still quite a few cases where anonymous types are used for several elements/attributes and therefore would result in code bloat. Here is the log which lists all the cases: http://codesynthesis.com/~boris/tmp/COLLADASchema_140.log Then I compiled it with --morph-anonymous option (BTW, the second tweak above is not necessary with this option) and everything worked fine except that the generated .cxx file was almost 5M and g++ couldn't compile it with my 2G of RAM. So I had to split the generated code into multiple parts with the --parts 20 option. After that I could compile individual parts one by one and link them into one executable. Splitting the schema into several individual schemas and xsd:include'ing them is something that would make such splitting unnecessary and also make working with the generated code more manageable (e.g., one can include only parts that this translation unit needs). BTW, COLLADA 1.31 compiles fine (with --morph-anonymous) without any tweaks. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060313/b864459b/attachment.pgp From fcampaigne at accesswave.ca Tue Mar 14 19:32:00 2006 From: fcampaigne at accesswave.ca (Fred Campaigne) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] losing double precision in output xml (msvc++7.1) Message-ID: <44176080.9050902@accesswave.ca> Just started using xsd and it is a hit. Makes machine generated xml a breeze. I am having a problem with loss of precision of doubles in the output xml, as follows: std::ostream ofs("outfile.xml", std::ios_base::binary); //non binary is the same ofs.precision(12); //values used in the cxx-tree generated objects are accurate to many places GridSearchData(ofs, *gsd, map); //generate the xml to ofs std::cout << ofs.precision() << std::endl; // this prints 12 and my double precision latitudes and longitude have float precision in the streamed xml. I probably missed something in the notes and email archives. Any help would be very much appreciated. cheers Fred From boris at codesynthesis.com Wed Mar 15 07:06:03 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] losing double precision in output xml (msvc++7.1) In-Reply-To: <44176080.9050902@accesswave.ca> References: <44176080.9050902@accesswave.ca> Message-ID: <20060315120603.GB8571@karelia> Fred, Fred Campaigne writes: > Just started using xsd and it is a hit. Makes machine generated xml a > breeze. I am having a problem with loss of precision of doubles in the > output xml, as follows: > > std::ostream ofs("outfile.xml", std::ios_base::binary); //non binary > is the same > ofs.precision(12); //values used in the cxx-tree generated objects are > accurate to many places > GridSearchData(ofs, *gsd, map); //generate the xml to ofs > std::cout << ofs.precision() << std::endl; // this prints 12 > > and my double precision latitudes and longitude have float precision in > the streamed xml. I think it's a bug. The float, double and long double types should be parsed and serialized with their maximum precisions. I made precision for double 12 and for long double 24. You can get the fixes here: http://codesynthesis.com/~boris/tmp/libxsd-2.0.0-2.zip I tried this on the following test case: // driver.cxx // #include #include "test.hxx" using std::cerr; using std::endl; int main () { double value (1.123456789123); xml_schema::namespace_infomap map; test (cerr, value, map); } It prints: 1.123456789123 Thanks for reporting this! -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060315/625ea850/attachment.pgp From th.mueller at weisang.com Wed Mar 15 07:31:01 2006 From: th.mueller at weisang.com (=?iso-8859-1?Q?Thomas_M=FCller?=) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] XSD generates uncompilable code Message-ID: <001901c6482c$52030b90$0d01a8c0@igb.weisang.com> Hi, I have some trouble with uncompilable code in MSVC++ 8.0. The type involved uses xlink attributes and has empty content. I modified the tree/library example to demonstrate the issue. Here are the steps: - Change the contents of library.xsd to: - Add the xlink.xsd (see attachment) to the library project (custom build: xsd cxx-tree --generate-inline --generate-ostream --morph-anonymous --generate-serialization xlink.xsd). - Generate xlink.hxx and xlink.cxx from xlink.xsd and add them to the project (xlink.cxx compiles fine) - Generate the code for library.xsd (no error, no warning; custom build: xsd cxx-tree --generate-inline --generate-ostream --generate-serialization library.xsd) and try to compile the project. As a result I get the following errors: 1>c:\tools\xsd-2.0.0-i686-windows\examples\cxx\tree\library\library.hxx(329) : warning C4099: 'library::test_type::type' : type name first seen using 'class' now seen using 'struct' 1> c:\tools\xsd-2.0.0-i686-windows\examples\cxx\tree\library\library.hxx(233) : see declaration of 'library::test_type::type' 1>c:\tools\xsd-2.0.0-i686-windows\examples\cxx\tree\library\library.hxx(339) : error C2039: 'type_' : is not a member of 'xsd::cxx::tree::type' 1> c:\tools\xsd-2.0.0-i686-windows\libxsd\xsd\cxx\tree\elements.hxx(110) : see declaration of 'xsd::cxx::tree::type' 1>c:\tools\xsd-2.0.0-i686-windows\examples\cxx\tree\library\library.hxx(339) : error C2143: syntax error : missing ';' before 'const' 1>c:\tools\xsd-2.0.0-i686-windows\examples\cxx\tree\library\library.hxx(339) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\tools\xsd-2.0.0-i686-windows\examples\cxx\tree\library\library.hxx(339) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\tools\xsd-2.0.0-i686-windows\examples\cxx\tree\library\library.hxx(342) : error C2039: 'type_' : is not a member of 'xsd::cxx::tree::type' 1> c:\tools\xsd-2.0.0-i686-windows\libxsd\xsd\cxx\tree\elements.hxx(110) : see declaration of 'xsd::cxx::tree::type' 1>c:\tools\xsd-2.0.0-i686-windows\examples\cxx\tree\library\library.hxx(342) : error C2143: syntax error : missing ';' before '&' < more errors cut > Is this a problem in XSD? Any ideas on how to work around this? Thanks, Thomas -------------- next part -------------- A non-text attachment was scrubbed... Name: xlink.xsd Type: application/xml Size: 1675 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060315/48bd886e/xlink.xml From boris at codesynthesis.com Wed Mar 15 09:02:11 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] XSD generates uncompilable code In-Reply-To: <001901c6482c$52030b90$0d01a8c0@igb.weisang.com> References: <001901c6482c$52030b90$0d01a8c0@igb.weisang.com> Message-ID: <20060315140211.GC8571@karelia> Thomas, Thomas M?ller writes: > I have some trouble with uncompilable code in MSVC++ 8.0. This appears to be a bug in VC++ (both 7.1 and 8.0). Here is a small test case: namespace n { class type {}; } class foo: public ::n::type { public: struct type { typedef int type_; }; type::type_ type (); }; VC++ injects the n::type name into foo's scope but then does not notice that it has been hidden by the foo::type declaration. Later, when we refer to type::type_, it tries to fine type_ in n::type rather than in foo::type. I have a workaround for you here: http://codesynthesis.com/~boris/tmp/elements.hxx Replace you xsd-2.0.0-i686-windows/libxsd/xsd/cxx/tree/elements.hxx with the file above. > xsd cxx-tree --generate-inline --generate-ostream --morph-anonymous > --generate-serialization xlink.xsd > > xsd cxx-tree --generate-inline --generate-ostream --generate-serialization > library.xsd Note that you need to add the --morph-anonymous option to the second invocation as well if you want library.hxx to use types generated in xlink.hxx. > 1>c:\tools\xsd-2.0.0-i686-windows\examples\cxx\tree\library\library.hxx(329) > : warning C4099: 'library::test_type::type' : type name first seen using > 'class' now seen using 'struct' I also fixed this warning. The fix will appear in the next release. Thanks for reporting this and let me know if you still have problems with the workaround above. -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060315/dad575e7/attachment.pgp From th.mueller at weisang.com Wed Mar 15 10:56:30 2006 From: th.mueller at weisang.com (=?iso-8859-1?Q?Thomas_M=FCller?=) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] XSD generates uncompilable code In-Reply-To: <20060315140211.GC8571@karelia> Message-ID: <002c01c64849$06b4c300$0d01a8c0@igb.weisang.com> Hi Boris, > > > I have some trouble with uncompilable code in MSVC++ 8.0. > > This appears to be a bug in VC++ (both 7.1 and 8.0). Here is > a small test case: > > namespace n > { > class type {}; > } > > class foo: public ::n::type > { > public: > struct type > { > typedef int type_; > }; > > type::type_ > type (); > }; > > VC++ injects the n::type name into foo's scope but then does > not notice > that it has been hidden by the foo::type declaration. Later, > when we refer to type::type_, it tries to fine type_ in > n::type rather than in foo::type. > > I have a workaround for you here: > > http://codesynthesis.com/~boris/tmp/elements.hxx > > Replace you > xsd-2.0.0-i686-windows/libxsd/xsd/cxx/tree/elements.hxx with > the file above. It seems that we still have to wait until we get a fully standard compliant VC++... > > > > xsd cxx-tree --generate-inline --generate-ostream --morph-anonymous > > --generate-serialization xlink.xsd > > > > xsd cxx-tree --generate-inline --generate-ostream > > --generate-serialization library.xsd > > Note that you need to add the --morph-anonymous option to the > second invocation as well if you want library.hxx to use > types generated in xlink.hxx. Thanks for the hint, I did this already in the main project but not in the sample. > > > > > 1>c:\tools\xsd-2.0.0-i686-windows\examples\cxx\tree\library\library.hx > > 1>x(329) > > : warning C4099: 'library::test_type::type' : type name first seen > > using 'class' now seen using 'struct' > > I also fixed this warning. The fix will appear in the next release. > > > Thanks for reporting this and let me know if you still have > problems with the workaround above. > Besides from the warnings mentioned above the code compiles now fine using the updated elements.hxx. I tested basic access to the XML files and things are looking good so far. Many thanks for your FAST support! Thomas From boris at codesynthesis.com Wed Mar 15 14:31:41 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] XSD generates uncompilable code In-Reply-To: <002c01c64849$06b4c300$0d01a8c0@igb.weisang.com> References: <20060315140211.GC8571@karelia> <002c01c64849$06b4c300$0d01a8c0@igb.weisang.com> Message-ID: <20060315193141.GA10472@karelia> Thomas, Thomas M?ller writes: > Besides from the warnings mentioned above the code compiles now fine using > the updated elements.hxx. You can get rid of this warning (until the next release) by adding this two options: --hxx-prologue "#pragma warning(disable:4099)" --hxx-epilogue "#pragma warning(default:4099)" hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060315/ae801769/attachment.pgp From Ricky_H_Linh at raytheon.com Fri Mar 24 18:06:40 2006 From: Ricky_H_Linh at raytheon.com (Ricky H Linh) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] xsd binary build for AIX 5.3 Message-ID: Hi, I am new to the xsd tool and would like to know if anyone has ported this tool to run on AIX 5.3 yet? I am working on a project that has a lot of xml schema and this tool has really make it easy for me to convert the schema to C++ classes rather than coding it by hand. However, my working platform is IBM AIX 5.3 and I did not see any binary build for this OS. thanks, -ricky -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060324/5c67bcfa/attachment.html From higglyblue at yahoo.com Sun Mar 26 23:06:09 2006 From: higglyblue at yahoo.com (Michael Cooke) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] AIX compiler support? Message-ID: <20060327040609.90305.qmail@web32708.mail.mud.yahoo.com> Hi all, wondering about the status of compiling xsd generated code under AIX xlC. Are there known issues, or has there been no testing done? Thanks, Michael Cook --------------------------------- New Yahoo! Messenger with Voice. Call regular phones from your PC and save big. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060326/ecd2d6a1/attachment.htm From boris at codesynthesis.com Mon Mar 27 08:47:09 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] xsd binary build for AIX 5.3 In-Reply-To: References: Message-ID: <20060327134709.GA6029@karelia> Hi Ricky and Michael, Ricky H Linh writes: > I am new to the xsd tool and would like to know if anyone has ported this > tool to run on AIX 5.3 yet? I am not aware of anybody using xsd on AIX but it should be straightforward to build the compiler on AIX using g++. Making the runtime library and generated code compile with IBM C++ compiler could be more complicated depending on how well it conforms to the standard. If I were you, I would first try to compile your schemas on some other OS, say GNU/Linux or Windows, then copy the generated code along with the runtime library (libxsd, which contains only headers so you don't need to build it) to an AIX box, and try to compile everything with your C++ compiler. You can try this on examples that come with xsd. You will also need to build Xerces-C++ for AIX. I could do it for you but I don't have access to an AIX box. I can provide you with further assistance, thought. Just post your findings on this mailing list. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060327/7c8d31dd/attachment.pgp From frederic.heem at telsey.it Wed Mar 29 10:40:00 2006 From: frederic.heem at telsey.it (frederic heem) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] cmake module for building xsd application Message-ID: <200603291740.00777.frederic.heem@telsey.it> Hi, Please find attached 2 files FindXercesC.make and FindXsd.cmake These are used with the multiplatform build system cmake Hope it helps Cheers -- ***** ? ? ----- ? ? ***** ? ? ----- ? ? ***** ? ? Frederic Heem Software Designer R&D - Telsey SpA Telecommunications Viale Industria, 1 31055 Quinto di Treviso (TV) ITALY Tel. direct phone: (+39) 0422 377819 Tel. (+39) 0422 377711 Fax. (+39) 0422 470920 website ==> www.telsey.it -------------- next part -------------- # Locate Xsd from code synthesis include paths and binary # Xsd can be found at http://codesynthesis.com/products/xsd/ # Written by Frederic Heem, frederic.heem _at_ telsey.it # This module defines # XSD_INCLUDE_DIR, where to find elements.hxx, etc. # XSD_EXECUTABLE, where is the xsd compiler # XSD_FOUND, If false, don't try to use xsd FIND_PATH(XSD_INCLUDE_DIR cxx/parser/elements.hxx "[HKEY_CURRENT_USER\\software\\xsd\\include]" "[HKEY_CURRENT_USER]\\xsd\\include]" $ENV{XSDDIR}/include /usr/local/include/xsd /usr/include/xsd ) FIND_PROGRAM(XSD_EXECUTABLE NAMES xsd PATHS "[HKEY_CURRENT_USER\\xsd\\bin" $ENV{XSDDIR}/bin /usr/local/bin /usr/bin ) # if the include and the program are found then we have it IF(XSD_INCLUDE_DIR) IF(XSD_EXECUTABLE) SET( XSD_FOUND "YES" ) ENDIF(XSD_EXECUTABLE) ENDIF(XSD_INCLUDE_DIR) MARK_AS_ADVANCED( XSD_INCLUDE_DIR XSD_EXECUTABLE ) -------------- next part -------------- # Locate Xerces-C include paths and libraries # Xerces-C can be found at http://xml.apache.org/xerces-c/ # Written by Frederic Heem, frederic.heem _at_ telsey.it # This module defines # XERCESC_INCLUDE_DIR, where to find ptlib.h, etc. # XERCESC_LIBRARIES, the libraries to link against to use pwlib. # XERCESC_FOUND, If false, don't try to use pwlib. FIND_PATH(XERCESC_INCLUDE_DIR xercesc/dom/DOM.hpp "[HKEY_CURRENT_USER\\software\\xerces-c\\src]" "[HKEY_CURRENT_USER\\xerces-c\\src]" $ENV{XERCESCROOT}/src/ /usr/local/include /usr/include ) FIND_LIBRARY(XERCESC_LIBRARIES NAMES xerces-c PATHS "[HKEY_CURRENT_USER\\software\\xerces-c\\lib]" "[HKEY_CURRENT_USER\\xerces-c\\lib]" $ENV{XERCESCROOT}/lib /usr/local/lib /usr/lib ) # if the include a the library are found then we have it IF(XERCESC_INCLUDE_DIR) IF(XERCESC_LIBRARIES) SET( XERCESC_FOUND "YES" ) ENDIF(XERCESC_LIBRARIES) ENDIF(XERCESC_INCLUDE_DIR) MARK_AS_ADVANCED( XERCESC_INCLUDE_DIR XERCESC_LIBRARIES ) From th.mueller at weisang.com Wed Mar 29 12:00:53 2006 From: th.mueller at weisang.com (=?iso-8859-1?Q?Thomas_M=FCller?=) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] How to iterate different childs of a node together Message-ID: <002701c65352$574cc330$0d01a8c0@igb.weisang.com> Hi, I have an element that basically looks like this: ... .... The generated iterators allow to iterate over all nodes of type subitem1 and subitem2 separately. Is there an easy way to iterate over all subitem-nodes (subitem1 and subitem2) in the sequence of their occurence? Thanks for your help, Thomas From boris at codesynthesis.com Wed Mar 29 13:00:59 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] How to iterate different childs of a node together In-Reply-To: <002701c65352$574cc330$0d01a8c0@igb.weisang.com> References: <002701c65352$574cc330$0d01a8c0@igb.weisang.com> Message-ID: <20060329180059.GA32287@karelia> Hi Thomas, Thomas M?ller writes: > I have an element that basically looks like this: > > > > > > > ... > > > > > .... > > > > > > > The generated iterators allow to iterate over all nodes of type subitem1 and > subitem2 separately. > Is there an easy way to iterate over all subitem-nodes (subitem1 and > subitem2) in the sequence of their occurence? The problem with such an iteration is that it is not clear what type it should be based on. The only type that comes to mind is xml_schema::type, from which all schema types derive. Right now you can associate DOM nodes with your tree nodes (see examples/cxx/tree/mixed on how to do this). With this, you will be able to get a DOM node that corresponds to an 'item' and then iterate over all sub-nodes in the sequence of their occurrence. Though you won't be able to get "back" to the tree nodes (e.g., 'subitem1' and 'subitem2') from DOM nodes. I don't, however, see any technical difficulty in implementing this if somebody needs it (i.e., store a pointer to xml_schema::type in DOM nodes). So let me know if you need this. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060329/2326d0d1/attachment.pgp From boris at codesynthesis.com Wed Mar 29 13:38:32 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] cmake module for building xsd application In-Reply-To: <200603291740.00777.frederic.heem@telsey.it> References: <200603291740.00777.frederic.heem@telsey.it> Message-ID: <20060329183832.GA32416@karelia> Hi Frederic, frederic heem writes: > Please find attached 2 files FindXercesC.make and FindXsd.cmake > These are used with the multiplatform build system cmake Cool! I am going to create a section on the web site for third-party contributions and put them there. Thanks very much! I looked over the files and have a couple of questions: > FIND_PATH(XSD_INCLUDE_DIR cxx/parser/elements.hxx > "[HKEY_CURRENT_USER\\software\\xsd\\include]" > "[HKEY_CURRENT_USER]\\xsd\\include]" ^^^ Shouldn't this be "[HKEY_CURRENT_USER\\xsd\\include]"? Or maybe "[HKEY_CURRENT_USER]\\xsd\\include"? > FIND_PROGRAM(XSD_EXECUTABLE > NAMES > xsd > PATHS > "[HKEY_CURRENT_USER\\xsd\\bin" Same here, should it be "[HKEY_CURRENT_USER\\xsd\\bin]"? thanks, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060329/e0e803e0/attachment.pgp From tm at go-td.de Wed Mar 29 15:40:56 2006 From: tm at go-td.de (=?iso-8859-1?Q?Thomas_M=FCller?=) Date: Sun Oct 11 15:33:43 2009 Subject: AW: [xsd-users] How to iterate different childs of a node together In-Reply-To: <20060329180059.GA32287@karelia> Message-ID: <001001c65371$170cea10$0400a8c0@IDEFIX> Hi Boris, iterating over the base type would be the nicest solution. Using dynamic_cast it should be possible to get to the native type. On the other hand this would add another sequence to each node... Could this be an option to generate this? I looked at the DOM approach, but my problem was - you guess - to get back to the tree nodes. The subitems each have more nested items that need to be processed, so I was stuck. Thus getting back to the tree nodes would be of great help. Thanks, Thomas -----Urspr?ngliche Nachricht----- Von: Boris Kolpackov [mailto:boris@codesynthesis.com] Gesendet: Mittwoch, 29. M?rz 2006 20:01 An: Thomas M?ller Cc: xsd-users@codesynthesis.com Betreff: Re: [xsd-users] How to iterate different childs of a node together Hi Thomas, Thomas M?ller writes: > I have an element that basically looks like this: > > > > > > > ... > > > > > .... > > > > > > > The generated iterators allow to iterate over all nodes of type > subitem1 and > subitem2 separately. > Is there an easy way to iterate over all subitem-nodes (subitem1 and > subitem2) in the sequence of their occurence? The problem with such an iteration is that it is not clear what type it should be based on. The only type that comes to mind is xml_schema::type, from which all schema types derive. Right now you can associate DOM nodes with your tree nodes (see examples/cxx/tree/mixed on how to do this). With this, you will be able to get a DOM node that corresponds to an 'item' and then iterate over all sub-nodes in the sequence of their occurrence. Though you won't be able to get "back" to the tree nodes (e.g., 'subitem1' and 'subitem2') from DOM nodes. I don't, however, see any technical difficulty in implementing this if somebody needs it (i.e., store a pointer to xml_schema::type in DOM nodes). So let me know if you need this. hth, -boris From boris at codesynthesis.com Thu Mar 30 04:33:05 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to iterate different childs of a node together In-Reply-To: <001001c65371$170cea10$0400a8c0@IDEFIX> References: <20060329180059.GA32287@karelia> <001001c65371$170cea10$0400a8c0@IDEFIX> Message-ID: <20060330093305.GA2260@karelia> Hi Thomas, Thomas M?ller writes: > iterating over the base type would be the nicest solution. Using > dynamic_cast it should be possible to get to the native type. On the other > hand this would add another sequence to each node... Could this be an option > to generate this? Yes, I suppose it could be done this way. I am wondering how useful such a feature would be in general. I think for now we will just support getting back from DOM nodes (see below). If more people ask for this, we will consider implementing it. > I looked at the DOM approach, but my problem was - you guess - to get back > to the tree nodes. The subitems each have more nested items that need to be > processed, so I was stuck. Thus getting back to the tree nodes would be of > great help. Ok, it was relatively easy to implement. Here are two files you will need to replace in your 2.0.0 distribution: http://codesynthesis.com/~boris/tmp/libxsd-2.0.0-dom-backptr.zip This adds support for getting back from DOM nodes to tree nodes. Here is how you would use it (from the modified 'mixed' example): case DOMNode::ELEMENT_NODE: { // Let's get back to a tree node from this DOM node. // xml_schema::type& t ( *reinterpret_cast ( n->getUserData (xml_schema::tree_node_key))); anchor_type& a (dynamic_cast (t)); cout << a << "[" << ref << "]"; ++ref; break; } Two things to note: 1. You won't be able to use xml_schema::tree_node_key name until 2.1.0 is released (in a few weeks). Instead use xsd::cxx::tree::user_data_keys::node. 2. You can use static_cast instead of dynamic_cast above if you are sure about the type. Let me know if you run into any problems. -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060330/f5fb76a8/attachment.pgp From boris at codesynthesis.com Thu Mar 30 07:37:13 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] cmake module for building xsd application In-Reply-To: <200603300918.51017.frederic.heem@telsey.it> References: <200603291740.00777.frederic.heem@telsey.it> <20060329183832.GA32416@karelia> <200603300918.51017.frederic.heem@telsey.it> Message-ID: <20060330123713.GA2785@karelia> Hi Frederic, frederic heem writes: > To be honest, it has been tested only on linux, I found on other FindXXX.cmake > the line [HKEY_CURRENT_USER\\path\\to\\include] but I didn't know it wasn't > as you said: [HKEY_CURRENT_USER]\\path\\to\\include. Ok, I added them as-is; somebody with more knowledge may be able to figure this out later: http://codesynthesis.com/download/xsd/contrib/ http://codesynthesis.com/download/xerces-c/contrib/ > By the way, which kind of build system do you use ? I found cmake very > easy to use, powerful and above all, it just works on any platform. I use build: http://kolpackov.net/projects/build/ It is based on GNU make (actually, on a not-yet-released version 3.81 of GNU make ;-)). I like it because of it allows me to build large software dependencies in parallel (it uses non-recursive makefile architecture) and it is quite flexible. It required a unix environment though. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060330/215add11/attachment.pgp From boris at codesynthesis.com Fri Mar 31 04:01:06 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to iterate different childs of a node together In-Reply-To: <002801c653f9$381f8630$0d01a8c0@igb.weisang.com> References: <20060330093305.GA2260@karelia> <002801c653f9$381f8630$0d01a8c0@igb.weisang.com> Message-ID: <20060331090106.GA5414@karelia> Hi Thomas, [I've CC'ed xsd-users back in; others may be interested in this info.] Thomas M?ller writes: > > Yes, I suppose it could be done this way. I am wondering how > > useful such a feature would be in general. I think for now we > > will just support getting back from DOM nodes (see below). If > > more people ask for this, we will consider implementing it. > > To be honest, I don't know. I have at least one case here where I need > it. I agree that in most cases the order of the elements either does not > matter or there are only child nodes of the same type, but sometimes > it can be crucial... Agree. That's the main reason we implemented the optional DOM association feature. > I can live with the solution to switch to the tree and then back to the > generated type system. Huge XML files might be a problem when the DOM tree > is preserved, but the ones I use are usually quite small (~30 KB) so I > don't care. I agree that for big XML instances keeping DOM around could be quite wasteful. If you run into such a situation please let me know. > In case you decide to implement it as an option: I think it should suffice > to generate it on demand for dedicated elements/types given on the command > line. To add a generic sequence for all nodes is probably unnecessary. Agree. There, however, could be some overall changes and overheads involved in order to support this. For example, with this feature, an instance is now contained (or, rather, referenced) in two containers. This will require some sort of reference counting. Also things get tricky when you start considering tree modifications. For example, it is not always clear where to insert a new member in the sequence of all members. In general case, one will have to analyze the corresponding schema to figure out where to insert things. Consider, for instance, the following simple case: Let's say we started with the following instance a 1 The sequence of all members is 'a 1'. Now we first insert element 'two' foo ().two ().push_back (2); The sequence becomes 'a 1 2'. Now we insert element 'one': foo ().one ().push_back ("b"); In order to be valid per schema we will need to insert 'b' before '2': 'a 1 b 2'. So such insertion should be schema-guided. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060331/1ebd0b37/attachment.pgp From th.mueller at weisang.com Fri Mar 31 06:44:49 2006 From: th.mueller at weisang.com (=?iso-8859-1?Q?Thomas_M=FCller?=) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to iterate different childs of a node together In-Reply-To: <20060331090106.GA5414@karelia> Message-ID: <003701c654b8$84d67280$0d01a8c0@igb.weisang.com> Hi Boris, > > > In case you decide to implement it as an option: I think it should > > suffice to generate it on demand for dedicated > elements/types given on > > the command line. To add a generic sequence for all nodes > is probably unnecessary. > > Agree. There, however, could be some overall changes and > overheads involved in order to support this. For example, > with this feature, an instance is now contained (or, rather, > referenced) in two containers. This will require some sort of > reference counting. Also things get tricky when you start > considering tree modifications. If the references in the generic sequence would be considered as weak it should be possible to come away without ref counting... Tree modifications could be a real issue. I currently just read and process the files so I had not in mind to modify them. > For example, it is not always clear where to insert a new > member in the sequence of all members. In general case, one > will have to analyze the corresponding schema to figure out > where to insert things. Consider, for instance, the following > simple case: > > > > > > > > > > > Let's say we started with the following instance > > > a > 1 > > > The sequence of all members is 'a 1'. Now we first insert > element 'two' > > foo ().two ().push_back (2); > > The sequence becomes 'a 1 2'. Now we insert element 'one': > > foo ().one ().push_back ("b"); > > In order to be valid per schema we will need to insert 'b' before '2': > 'a 1 b 2'. So such insertion should be schema-guided. I am not quite sure if I understand this. My XML files are validated against their schema when they are loaded, so if I have them in memory and iterate over the childs of a node from left to right this should always be 'a 1 b 2'. Everything else should be rejected in advance. Thomas From boris at codesynthesis.com Fri Mar 31 09:26:56 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to iterate different childs of a node together In-Reply-To: <003701c654b8$84d67280$0d01a8c0@igb.weisang.com> References: <20060331090106.GA5414@karelia> <003701c654b8$84d67280$0d01a8c0@igb.weisang.com> Message-ID: <20060331142656.GA6793@karelia> Hi Thomas, Thomas M?ller writes: > If the references in the generic sequence would be considered > as weak it should be possible to come away without ref counting... Then we will need to update existing containers to add/remove items in the sequence of all members. I guess we will have to do this anyway. > I am not quite sure if I understand this. My XML files are validated > against their schema when they are loaded, so if I have them in memory > and iterate over the childs of a node from left to right this should > always be 'a 1 b 2'. Everything else should be rejected in advance. Right. I was talking about modification. My example just shows that it becomes really complicated to maintain valid (per-schema) order in the sequence of all members if there are modification to the tree. That's also why we currently don't do this for DOM associations (i.e., we don't create DOM nodes for new tree nodes that were inserted into the tree). hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060331/1c03cb37/attachment.pgp From Abhishek.Agarwal at nortelgov.com Fri Mar 31 11:29:06 2006 From: Abhishek.Agarwal at nortelgov.com (Agarwal, Abhishek) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to get element type from xsd Message-ID: <8D0C5C7A848CE0469B41D1A6C7ED3C51E7383B@MAILIS.pecs.com> Hello, I am a new xsd used and i am creating a class with xsd program. I want to extract the member names and member type from the class at run time. I found a way to extract member names from the DOMNode but i would like to know if someone has any ideas on extracting the type of the member? Abhishek -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060331/8f2f6362/attachment.htm From Abhishek.Agarwal at nortelgov.com Fri Mar 31 11:55:14 2006 From: Abhishek.Agarwal at nortelgov.com (Agarwal, Abhishek) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to convert member names to member functions Message-ID: <8D0C5C7A848CE0469B41D1A6C7ED3C51E7383D@MAILIS.pecs.com> Hello, Is there a way that i can get the member functions from the member names which can be generated from DOMNodes. Abhishek -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060331/26726385/attachment.html From boris at codesynthesis.com Fri Mar 31 12:06:53 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to get element type from xsd In-Reply-To: <8D0C5C7A848CE0469B41D1A6C7ED3C51E7383B@MAILIS.pecs.com> References: <8D0C5C7A848CE0469B41D1A6C7ED3C51E7383B@MAILIS.pecs.com> Message-ID: <20060331170653.GA7074@karelia> Hi Abhishek, Agarwal, Abhishek writes: > I am a new xsd used and i am creating a class with xsd program. I want to > extract the member names and member type from the class at run time. I found > a way to extract member names from the DOMNode but i would like to know if > someone has any ideas on extracting the type of the member? Hm, do you want C++ type name (as generated by xsd compiler) or original XML Schema type name? Also it would help if you could give us some idea about what you are trying to achieve. Maybe we could suggest better ways to do this. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060331/e9490d14/attachment.pgp From Abhishek.Agarwal at nortelgov.com Fri Mar 31 12:36:58 2006 From: Abhishek.Agarwal at nortelgov.com (Agarwal, Abhishek) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to get element type from xsd Message-ID: <8D0C5C7A848CE0469B41D1A6C7ED3C51E7383E@MAILIS.pecs.com> Hello Boris, Thank you for a quick response. Actually i am trying to create a access the member functions at run time with no knowledge of the member names. In my application I want to define a structure which contains members from the schema file. This structure has to be defined at run time. I want to know the data types of member variable as defined in schema. Abhishek -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Fri 3/31/2006 12:06 PM To: Agarwal, Abhishek Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] How to get element type from xsd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060331/28223119/attachment.html From boris at codesynthesis.com Fri Mar 31 12:47:18 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to get element type from xsd In-Reply-To: <8D0C5C7A848CE0469B41D1A6C7ED3C51E7383E@MAILIS.pecs.com> References: <8D0C5C7A848CE0469B41D1A6C7ED3C51E7383E@MAILIS.pecs.com> Message-ID: <20060331174718.GC7074@karelia> Hi Abhishek, Agarwal, Abhishek writes: > Thank you for a quick response. Actually i am trying to create a access the > member functions at run time with no knowledge of the member names. In my > application I want to define a structure which contains members from the > schema file. This structure has to be defined at run time. Are you going to have values of members in your structure or just member names and their type information? > I want to know the data types of member variable as defined in schema. The only way that I can think of is by using DOM PSVI (stands for Post Schema Validation Infoset). It would contain XML Schema type for each element/attribute in DOM document. Look at getTypeInfo function in DOMElement and DOMAttribute types. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060331/91b12bf8/attachment.pgp From boris at codesynthesis.com Fri Mar 31 12:51:37 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to convert member names to member functions In-Reply-To: <8D0C5C7A848CE0469B41D1A6C7ED3C51E7383D@MAILIS.pecs.com> References: <8D0C5C7A848CE0469B41D1A6C7ED3C51E7383D@MAILIS.pecs.com> Message-ID: <20060331175137.GD7074@karelia> Hi Abhishek, Agarwal, Abhishek writes: > Is there a way that i can get the member functions from the member names > which can be generated from DOMNodes. I assume you want to get a pointer to one of the member function generated by xsd for a particular element/attribute by passing a string with its name. If so then there is no such functionality. Also note that there are usually several overloaded member functions generated for each element/attribute. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060331/607472fb/attachment.pgp From yongsheng.zhao at nortelgov.com Fri Mar 31 14:49:57 2006 From: yongsheng.zhao at nortelgov.com (Zhao, Yongsheng) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to know the member functions at run time Message-ID: <8D0C5C7A848CE0469B41D1A6C7ED3C5122FCBC@MAILIS.pecs.com> Hello, Say, I have a Task class which is generated by xsd from xml schema. But I don't know what exactly in this class, due to this class varies from applications. Then I need call the member functions of this class. Is there a way to do it at run time? Does xsd provide this kind of functions? I was told JAXB provides this kind ability, but I don't know if xsd has the equivalent. Any help is appreciated. Yongsheng Zhao -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060331/c3d7ff23/attachment.htm From Abhishek.Agarwal at nortelgov.com Fri Mar 31 17:34:59 2006 From: Abhishek.Agarwal at nortelgov.com (Agarwal, Abhishek) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] Create Containers Message-ID: <8D0C5C7A848CE0469B41D1A6C7ED3C51E73842@MAILIS.pecs.com> Hello, Is there a way that we can create containers using xsd? Abhishek -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Fri 3/31/2006 12:51 PM To: Agarwal, Abhishek Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] How to convert member names to member functions -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060331/d7ce8442/attachment.html