From boris at codesynthesis.com Fri Jun 1 08:23:35 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Example of Anonymous Types In-Reply-To: <21532.66473.qm@web30815.mail.mud.yahoo.com> References: <21532.66473.qm@web30815.mail.mud.yahoo.com> Message-ID: <20070601122335.GA7105@karelia> Hi Lester, Lester Memmott writes: > So my question is: I've seen some info about "--morph-anonymous" and > have seen some info in the docs about using anonymous types but I've > not found any examples in order to complete a working copy showing > this in action. The key idea is that I would like to still use VS2005 > to create the schema but I don't want to go to all the work and convert > the anonymous types to named types. Is it possible? Can someone point > in to the right documentation and examples? Yes, it is possible with the --morph-anonymous option. With this option all anonymous types will be automatically named with their names derived from the names of enclosing elements/attributes. I see that when you named the types manually, you added the _type suffix. You can do this too by adding the --anonymous-regex option, e.g.: --anonymous-regex "%.* .* (.+/)*(.+)%$2_type%" This option allows you to alter the process of name derivation used by XSD. For more information on these and other (e.g., --anonymous-regex-trace) options see the XSD Compiler Command Line Manual: http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml The C++/Tree Mapping FAQ entry 1.1 also has some relevant information: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/faq/#1.1 BTW, in the next release of XSD the automatic anonymous type naming will be turned on by default. 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/20070601/cacdfcc6/attachment.pgp From lmemmott at yahoo.com Fri Jun 1 12:34:18 2007 From: lmemmott at yahoo.com (Lester Memmott) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Example of Anonymous Types Message-ID: <251393.2237.qm@web30811.mail.mud.yahoo.com> All, A sincere thanks for the response, Boris. From the details you provided it looks like there is a lot of flexibility in the tool. For the moment, I'd like to get a basic proof-of-concept working that shows that anonymous types can be used (so that I don't have to rewrite schema files) and still write reasonable C++ code to access the object bound to the XML document. For those following this thread, I was able to work up an example using the same xml, xsd I started this thread with without rewriting the xsd from anonymous types to named types. Case 1: I created the .cxx and .hxx source in the following fashion: (again .xsd was using anonymous types) xsd cxx-tree --morph-anonymous AkodGuiConfig.xsd And the corresponding code looks like: void AkodGuiConfigTestMorphOn(char * argv) { std::auto_ptr h(AkodGuiConfig_(argv)); //Get the PredefinedIdentifiers info within the AkodGuiConfig tag for (PredefinedIdentifiers::IdentifierDescription::iterator pii(h->PredefinedIdentifiers().IdentifierDescription().begin()); pii != h->PredefinedIdentifiers().IdentifierDescription().end(); ++pii) { //Get the XML attributes cout << "PredefinedIdentifiers Info: " << endl; cout << pii->Description() << endl; cout << pii->UnitOfMeasure() << endl; cout << pii->IntrinsicDataType() << endl; cout << pii->Multivalued() << endl; cout << pii->SupportsEvents() << endl; cout << pii->CanBeProjected() << endl; cout << pii->DefaultValue() << endl; //Get the XML Value (i.e. CDATA / content) cout << *pii << endl; cout << endl; } cout << endl << endl; //Get the CurrentlyUsedIdentifiers info within the AkodGuiConfig tag for (CurrentlyUsedIdentifiers::Identifier::iterator cuii(h->CurrentlyUsedIdentifiers().Identifier().begin()); cuii != h->CurrentlyUsedIdentifiers().Identifier().end(); ++cuii) { //Get the XML attributes cout << "CurrentlyUsedIdentifiers Info: " << endl; cout << cuii->Name() << endl; if (cuii->LastKnownValue().present()) //check for existance since it is an optional parameter cout << cuii->LastKnownValue().get() << endl; cout << endl; } } Case 2: I created the .cxx and .hxx source in the following fashion: xsd cxx-tree AkodGuiConfig.xsd Note: Did not use --morph-anonymous And the corresponding code looks like: void AkodGuiConfigTestMorphOff(char * argv) { std::auto_ptr h(AkodGuiConfig(argv)); //Get the PredefinedIdentifiers info within the AkodGuiConfig tag for (AkodGuiConfig::type::PredefinedIdentifiers::type::IdentifierDescription::iterator pii(h->PredefinedIdentifiers().IdentifierDescription().begin()); pii != h->PredefinedIdentifiers().IdentifierDescription().end(); ++pii) { //Get the XML attributes cout << "PredefinedIdentifiers Info: " << endl; cout << pii->Description() << endl; cout << pii->UnitOfMeasure() << endl; cout << pii->IntrinsicDataType() << endl; cout << pii->Multivalued() << endl; cout << pii->SupportsEvents() << endl; cout << pii->CanBeProjected() << endl; cout << pii->DefaultValue() << endl; //Get the XML Value (i.e. CDATA / content) cout << *pii << endl; cout << endl; } cout << endl << endl; //Get the CurrentlyUsedIdentifiers info within the AkodGuiConfig tag for (AkodGuiConfig::type::CurrentlyUsedIdentifiers::type::Identifier::iterator cuii(h->CurrentlyUsedIdentifiers().Identifier().begin()); cuii != h->CurrentlyUsedIdentifiers().Identifier().end(); ++cuii) { //Get the XML attributes cout << "CurrentlyUsedIdentifiers Info: " << endl; cout << cuii->Name() << endl; if (cuii->LastKnownValue().present()) //check for existance since it is an optional parameter cout << cuii->LastKnownValue().get() << endl; cout << endl; } } So in summary, the bulk of the code is the same between between named-types vs anonymous types (morph on) and anonymous types (morph off). The only part that gets tricky is knowing how to declare the objects and the iterators. You'll note that in the case with morph off the iterator type name gets rather long. Thanks, Lester From boris at codesynthesis.com Fri Jun 1 12:50:08 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Example of Anonymous Types In-Reply-To: <251393.2237.qm@web30811.mail.mud.yahoo.com> References: <251393.2237.qm@web30811.mail.mud.yahoo.com> Message-ID: <20070601165008.GA10249@karelia> Hi Lester, Lester Memmott writes: > So in summary, the bulk of the code is the same between between > named-types vs anonymous types (morph on) and anonymous types > (morph off). The only part that gets tricky is knowing how to > declare the objects and the iterators. You'll note that in the > case with morph off the iterator type name gets rather long. Another, a more serious problem, in leaving anonymous types is the potential code bloat. Consider, for example, this schema: ... Here both bar amd baz will have their own copy of anonymous type foo generated inside each class unnecessarily duplicating the code (XSD will warn you about this situation). 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/20070601/c9d988cb/attachment.pgp From lmemmott at yahoo.com Fri Jun 1 14:39:41 2007 From: lmemmott at yahoo.com (Lester Memmott) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Example of Anonymous Types Message-ID: <673120.83674.qm@web30810.mail.mud.yahoo.com> Boris, Regarding: >Another, a more serious problem, in leaving anonymous types is >the potential code bloat. Consider, for example, this schema: I completely agree with you. When doing quick-and-easy work I'll probaby stick with the schema creation tools provided in MSVC 2005. If you know of any others, I'd be interested. When doing product quality schemas, especially any work that would be seen by a customer, I would probably handcraft and fine tune them including the use of named types. Thanks, Lester From boris at codesynthesis.com Tue Jun 5 11:09:30 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] XSD 3.0.0.b1 released Message-ID: <20070605150930.GB23858@karelia> Hi, We have released XSD 3.0.0.b1 which is the first beta for the upcoming 3.0.0 major release. This beta is mostly focused on the C++/Tree mapping. The following beta will have more changes and improvements to the C++/Parser mapping. The NEWS file entries so far are as follows: * Anonymous type morphing (automatic type naming) is now performed by default in both mappings. The --morph-anonymous option does not have any effect but is preserved for backwards compatibility. A new option, --preserve-anonymous, disables anonymous type morphing. This option is useful together with --show-anonymous if you want to make sure your schemas do not have any anonymous types. * Number of bug fixes in both C++/Tree and C++/Parser mappings. C++/Tree * Optimizations for the generated code size and compilation time, including space optimizations for polymorphic parsing and serialization. * The type definitions for local elements and attributes in the form name::type have been changed to name_type. For example, an element bar in type foo with maxOccurs="unbounded" used to have its iterator type defined as foo::bar::iterator. With this change it becomes foo::bar_iterator. This is a backwards incompatibility change and may require the application code adjustments (the C++ compiler will pinpoint the affected places). * New option, --generate-wildcard, triggers generation of the new wildcard (any and anyAttribute) mapping. This mapping represents the content matched by wildcards as DOM fragments. For more information on the new mapping see Section 2.12, "Mapping for any and anyAttribute" in the C++/Tree Mapping User Manual as well as the wildcard example in the examples/cxx/tree/ directory. * New option, --generate-comparison, triggers generation of comparison operators (== and !=) for complex types. Comparison is performed memberwise. * Support for polymorphic binary serialization and extraction. Note that the semantics of the --generate-insertion and --generate-extraction options has changed. See the XSD Compiler Command Line Manual (man pages) for details. * The mapping of built-in XML Schema type decimal has changed from long double to double. The old mapping can be obtained by providing a custom mapping for this type. * The xml_schema::errors type which is used in the xml_schema::parsing and xml_schema::serialization exceptions has been renamed to xml_schema::diagnostics and extended to include warnings in addition to errors. * Serialization operators now clear the element being serialized to from existing child nodes and attributes (except for special attributes such as prefix-namespace mappings, etc.). * Improved built-in type parsing, including support for normalization and whitespace collapsing. C++/Parser * The xml_schema::errors type which is used in the xml_schema::parsing exception has been renamed to xml_schema::diagnostics and extended to include warnings in addition to errors. Thanks to the following individuals for reporting bugs as well as suggesting fixes and improvements: Ray Lischner Bradley Beddoes Mark Hoffmann Thomas M?ller Mark Lofdahl Fukasawa Mitsuo Mark Watson Sergei V. Firsov Paolo Volpi Mark Kinzie Arthur Eelko de Groot Thomas Maenner Gerard Lanois Glenn Nieuwenhuyse Mark Kinzie Precompiled binary distributions are available from the product's download page: http://www.codesynthesis.com/products/xsd/download.xhtml Source code for this release is available from the project's web page: http://www.codesynthesis.com/projects/xsd/ SHA1 checksums for the files: 8dc37877bb4557839d62b142cc35642108c9a02d xsd-3.0.0.b1.tar.bz2 4da49a7557292a3755e190ea8525db0ebcef5c16 xsd-3.0.0.b1-i686-linux-gnu.tar.bz2 b352929b3484c26589e349712eebe2dc37ede70b xsd-3.0.0.b1-x86_64-linux-gnu.tar.bz2 580141d82865964ac08237377049d3c5ebc28aff xsd-3.0.0.b1-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/20070605/f81d3ef7/attachment.pgp From uri at hyperroll.com Sun Jun 10 01:36:00 2007 From: uri at hyperroll.com (Uri Karagila) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] xsd inheretance at generated code Message-ID: <783879783B65E44995520FEF376C45380B5A76@ilexch1.int.hyperroll.com> hey, please review the following case: 1. xsd abstract type "shape". 2. both xsd type "triangle" and type "square" are an extension of "shape". at the generated code will get: 1. class shape 2. classes triangle and square, both inherited shape. in case i have a container which holds "shape" class descendant objects. what would be the best way to get random element's type. note: both "triangle" and "square" does not have and attribute (i.e., class member) which holds object type. Regards uri From boris at codesynthesis.com Sun Jun 10 04:31:57 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] xsd inheretance at generated code In-Reply-To: <783879783B65E44995520FEF376C45380B5A76@ilexch1.int.hyperroll.com> References: <783879783B65E44995520FEF376C45380B5A76@ilexch1.int.hyperroll.com> Message-ID: <20070610083157.GA14002@karelia> Hi Uri, Uri Karagila writes: > 1. xsd abstract type "shape". > 2. both xsd type "triangle" and type "square" are an extension of "shape". > at the generated code will get: > 1. class shape > 2. classes triangle and square, both inherited shape. > > in case i have a container which holds "shape" class descendant objects. > what would be the best way to get random element's type. note: both > "triangle" and "square" does not have and attribute (i.e., class member) > which holds object type. To figure out if a particular shape is a triangle or a square, you can use dynamic_cast. For example, assuming container_type is a sequence that holds shapes: container_type& c = ... for (container_type::iterator i (c.begin ()); i != c.end (); ++i) { if (triangle* t = dynamic_cast (&(*i))) { // triangle } else if (square* t = dynamic_cast (&(*i))) { // square } else { // something else } } The polymorphism example in the cxx/tree/examples directory also shows how to do this. If instead you need an object that identifies the type of an element in the container, then you can use the typeid operator. Also note that if you want to serialize (and later parse) such a polymorphic container then you will need to use the --generate-polymorphic option when translating your schemas. hth, -boris From uri at hyperroll.com Sun Jun 10 04:53:50 2007 From: uri at hyperroll.com (Uri Karagila) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] xsd inheretance at generated code References: <783879783B65E44995520FEF376C45380B5A76@ilexch1.int.hyperroll.com> <20070610083157.GA14002@karelia> Message-ID: <783879783B65E44995520FEF376C45380B5A77@ilexch1.int.hyperroll.com> Hi Boris, suggested option was already considered; yet, since we are not using RTTI (code performance reasons)and therefore dynamic_cast is forbidden. can you think of other options (beside updating xsd schema)? Regards Uri BTW Tnx for your fast replay. -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Sun 6/10/2007 11:31 AM To: Uri Karagila Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] xsd inheretance at generated code Hi Uri, Uri Karagila writes: > 1. xsd abstract type "shape". > 2. both xsd type "triangle" and type "square" are an extension of "shape". > at the generated code will get: > 1. class shape > 2. classes triangle and square, both inherited shape. > > in case i have a container which holds "shape" class descendant objects. > what would be the best way to get random element's type. note: both > "triangle" and "square" does not have and attribute (i.e., class member) > which holds object type. To figure out if a particular shape is a triangle or a square, you can use dynamic_cast. For example, assuming container_type is a sequence that holds shapes: container_type& c = ... for (container_type::iterator i (c.begin ()); i != c.end (); ++i) { if (triangle* t = dynamic_cast (&(*i))) { // triangle } else if (square* t = dynamic_cast (&(*i))) { // square } else { // something else } } The polymorphism example in the cxx/tree/examples directory also shows how to do this. If instead you need an object that identifies the type of an element in the container, then you can use the typeid operator. Also note that if you want to serialize (and later parse) such a polymorphic container then you will need to use the --generate-polymorphic option when translating your schemas. hth, -boris From boris at codesynthesis.com Sun Jun 10 05:11:41 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] xsd inheretance at generated code In-Reply-To: <783879783B65E44995520FEF376C45380B5A77@ilexch1.int.hyperroll.com> References: <783879783B65E44995520FEF376C45380B5A76@ilexch1.int.hyperroll.com> <20070610083157.GA14002@karelia> <783879783B65E44995520FEF376C45380B5A77@ilexch1.int.hyperroll.com> Message-ID: <20070610091141.GB14002@karelia> Hi Uri, Uri Karagila writes: > suggested option was already considered; yet, since we are not using > RTTI (code performance reasons) and therefore dynamic_cast is forbidden. > can you think of other options (beside updating xsd schema)? You want to figure out the type of an object at runtime. The only way to do this in C++ is by using RTTI (or a similar custom mechanism which will most likely be less efficient than RTTI). One way you can work around this situation is by customizing the types involved to use virtual functions to perform the tasks you need. For an example of this approach see the taxonomy example in the examples/cxx/tree/custom directory. Note, however, that the --generate-polymorphic option depends on RTTI so I am not sure how useful the above approach will be to you. hth, -boris From jerome.martinet at mpsa.com Mon Jun 11 09:53:18 2007 From: jerome.martinet at mpsa.com (jerome.martinet@mpsa.com) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] help about XSD Message-ID: Hello, I'm working on a project named Autosar. I have the XSD file (which you can find here :http://autosar.org/download/AUTOSAR_xsd.zip) and I want to generate C++ code using your tools XSD with Visual studio 2005 express. I generated the code but I can't access to elements I need (ATOMiC-SOFTWARE-COMPONENT for example) I have a constructor on the class AUTOSAR but nothing on ELEMENTS , how can I use a link between this two elements ? I read documentation and samples but I didn't found any information about how to use your tool with the mark-up and I didn't understood how to choice the entry point. The command I use is : xsd cxx-tree --show-classification --parts 8 --parts-suffix _part --generate-inline --generate-ostream --namespace-map http://autosar.org=NS_AUTOSAR --morph-anonymous --generate-serialization ../XSD/Autosar.xsd Can you help me ? Thanks for your tools . MARTINET J?r?me Student-Ingenieer From boris at codesynthesis.com Mon Jun 11 10:30:10 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] help about XSD In-Reply-To: References: Message-ID: <20070611143010.GA23782@karelia> Hi J?r?me, jerome.martinet@mpsa.com writes: > I'm working on a project named Autosar. I have the XSD file (which you can > find here :http://autosar.org/download/AUTOSAR_xsd.zip) and I want to > generate C++ code using your tools XSD with Visual studio 2005 express. Uh, quite a big schema. > > I generated the code but I can't access to elements I need > (ATOMiC-SOFTWARE-COMPONENT for example) > > I have a constructor on the class AUTOSAR but nothing on ELEMENTS , how can > I use a link between this two elements ? The root element of your vocabulary is element AUTOSAR and its type is AUTOSAR. So you get an instance of this type AUTOSAR when you parse you XML document, e.g., using namespace NS_AUTOSAR; std::auto_ptr autosar (AUTOSAR_ ("autosar.xml")); Looking at the definition of type AUTOSAR in the schema we see that its content is defined as a reference to a group (xsd:group) named AUTOSAR. When a group is referenced somewhere in the schema it is as if the contents of the group were copied to the place of reference. So we look at the AUTOSAR group and see that it contains a single optional (minOccurs="0") element TOP-LEVEL-PACKAGES. Since this element is optional, the generated code will follow the rules for the optional cardinality class as described in the manual. So we can test for presence of this element and get its content like so: if (autosar->TOP_LEVEL_PACKAGES ().present ()) { TOP_LEVEL_PACKAGES& tlp = autosar->TOP_LEVEL_PACKAGES ().get (); Looking at the type for TOP-LEVEL-PACKAGES we see that it is a sequence of AR-PACKAGE elements of type AR-PACKAGE. To iterate over them we can do this: TOP_LEVEL_PACKAGES::AR_PACKAGE::container& c = tlp.AR_PACKAGE (); for (TOP_LEVEL_PACKAGES::AR_PACKAGE::iterator i (c.begin ()); i != c.end (); ++i) { AR_PACKAGE& arp = *i; } } Next you can figure out the contents of AR_PACKAGE, etc. You can also look into the generated header file to figure out to which cardinality class a particular element belongs if it is not immediately obvious from studying the 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/20070611/ed12da22/attachment.pgp From kiran_nittur at yahoo.com Tue Jun 12 10:52:14 2007 From: kiran_nittur at yahoo.com (Kiran Nittur) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Libxsd serialize question Message-ID: <417551.28205.qm@web50807.mail.re2.yahoo.com> Hi, I am trying to use the code synthesis for xml data binding. As I noticed the root element of the xml is always qualified with the namespace example is shown below highlighted in red. We are using xsdobjectgen tool to generate C# code which will deserialize the xml into C# objects. The deserialize api is failing if there is a namespace in the root element. I would appreciate if you think of any workaround to this issue. Thanks, Kiran Joe Dirt joe@dirt.com 555 DIRT Kiran Nittur knittur@commvault.com 555 111 ____________________________________________________________________________________ Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 From mkesler at datawolf.cc Wed Jun 13 11:52:02 2007 From: mkesler at datawolf.cc (Michael Kesler) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] cxx-tree failing generated xml file Message-ID: <467012A2.9010206@datawolf.cc> This is my first post here, and please forgive me if this question/problem is already posted. I tried finding this in Google and came up with nothing exactly relevant. I have one application which writes an XML configuration file, which is read by another application. Both applications use the XSD generated classes, the first writing the data and the second reading the data. When I try to read the data, I get these exceptions: * settings.xml:2:181 error: Unknown element 'Settings' * settings.xml:2:181 error: Attribute 'xmlns' is not declared for element 'Settings' * settings.xml:2:181 error: Attribute '{http://www.w3.org/2000/xmlns/}xsi' is not declared for element 'Settings' * settings.xml:2:181 error: Attribute '{http://www.w3.org/2001/XMLSchema-instance}schemaLocation' is not declared for element 'Settings' * settings.xml:4:8 error: Unknown element 'dsn' * settings.xml:6:9 error: Unknown element 'user' * settings.xml:9:13 error: Unknown element 'password' What I don't understand is that the xsd-generated classes are writing this XML file that it can't read. The following is my XSD: Any assistance will be greatly appreciated. ~Michael From boris at codesynthesis.com Wed Jun 13 12:12:14 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] cxx-tree failing generated xml file In-Reply-To: <467012A2.9010206@datawolf.cc> References: <467012A2.9010206@datawolf.cc> Message-ID: <20070613161214.GC24487@karelia> Hi Michael, Michael Kesler writes: > I have one application which writes an XML configuration file, which is > read by another application. Both applications use the XSD generated > classes, the first writing the data and the second reading the data. > > When I try to read the data, I get these exceptions: > > * settings.xml:2:181 error: Unknown element 'Settings' > * settings.xml:2:181 error: Attribute 'xmlns' is not declared for > element 'Settings' > * settings.xml:2:181 error: Attribute > '{http://www.w3.org/2000/xmlns/}xsi' is not declared for element > 'Settings' > * settings.xml:2:181 error: Attribute > '{http://www.w3.org/2001/XMLSchema-instance}schemaLocation' is not > declared for element 'Settings' > * settings.xml:4:8 error: Unknown element 'dsn' > * settings.xml:6:9 error: Unknown element 'user' > * settings.xml:9:13 error: Unknown element 'password' > > What I don't understand is that the xsd-generated classes are writing > this XML file that it can't read. This is most likely because the second application (the one that read the XML file) cannot find the schema to validate the instance. By default XSD has validation in the underlying parser turned on so if the schema is not found then all elements in your instance are "unknown" to the schema processor. One way to get rid of this is to disable validation by passing the xml_schema::flags::dont_validate flag to the parsing function you call. hth, -boris From boris at codesynthesis.com Wed Jun 13 13:12:58 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] cxx-tree failing generated xml file In-Reply-To: <46701C5E.8010100@datawolf.cc> References: <467012A2.9010206@datawolf.cc> <20070613161214.GC24487@karelia> <46701C5E.8010100@datawolf.cc> Message-ID: <20070613171258.GD24487@karelia> Hi Michael, In the future please keep your replies CC'ed to the xsd-users mailing list. This way a) other developers who may have experienced a similar problem can provide you with a solution b) questions and answers will be archived and available to others with similar problems. Michael Kesler writes: > Thank you for your quick reply. Where can I put the schema so that it > can find it? I'd like to keep everything validating, if possible. I've > tried placing the schema in the execution directory, and that didn't work. > > Does it need to be in the same directory as the XML file? There are two common ways of doing it. The first is to add the xsi:schemaLocation (or xsi:noNamespaceSchemaLocation) attribute to your XML instance. The path in this attribute is treated as relative to the XML document unless it is an absolute URL (i.e., starts with http:// or file:///). The second option is to provide the schema location programmatically using the properties argument to the parsing function. For more information on that option please see FAQ entry 2.4: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/faq/#2.4 hth, -boris From mkesler at datawolf.cc Wed Jun 13 13:51:47 2007 From: mkesler at datawolf.cc (Michael Kesler) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] cxx-tree failing generated xml file In-Reply-To: <20070613171258.GD24487@karelia> References: <467012A2.9010206@datawolf.cc> <20070613161214.GC24487@karelia> <46701C5E.8010100@datawolf.cc> <20070613171258.GD24487@karelia> Message-ID: <46702EB3.9070404@datawolf.cc> I'm sorry about not CCing the mailing list. I'm used to mailing-lists using the Reply-To mail header to handle that for me, and I didn't check the 'To' address. Thanks for the help! Boris Kolpackov wrote: > Hi Michael, > > In the future please keep your replies CC'ed to the xsd-users mailing > list. This way a) other developers who may have experienced a similar > problem can provide you with a solution b) questions and answers will > be archived and available to others with similar problems. > > > Michael Kesler writes: > > >> Thank you for your quick reply. Where can I put the schema so that it >> can find it? I'd like to keep everything validating, if possible. I've >> tried placing the schema in the execution directory, and that didn't work. >> >> Does it need to be in the same directory as the XML file? >> > > There are two common ways of doing it. The first is to add the > xsi:schemaLocation (or xsi:noNamespaceSchemaLocation) attribute > to your XML instance. The path in this attribute is treated as > relative to the XML document unless it is an absolute URL (i.e., > starts with http:// or file:///). > > The second option is to provide the schema location programmatically > using the properties argument to the parsing function. For more > information on that option please see FAQ entry 2.4: > > http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/faq/#2.4 > > > hth, > -boris > From kroiz at hyperroll.com Sun Jun 17 02:38:46 2007 From: kroiz at hyperroll.com (Kroizman Guy) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] autoexp.dat Message-ID: <1182062326.5810.4.camel@localhost.localdomain> Just wondering if anybody modified his visual studio autoexp.dat to handle the generated code and is willing to share... From kroiz at hyperroll.com Sun Jun 17 04:27:48 2007 From: kroiz at hyperroll.com (Kroizman Guy) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] rtti in headers Message-ID: <1182068868.5810.21.camel@localhost.localdomain> Hi, Our Code is build without RTTI, and we wanna keep it this way. We also want to use polymorphism in our XSD. So we put the generated code in a library. We rather this library would be static and not dynamically linked but for that there must not be any RTTI dependent code in the header. can you please tell me if that is generally the case? or would we be safer just using the lib as a dll? From kroiz at hyperroll.com Sun Jun 17 04:53:13 2007 From: kroiz at hyperroll.com (Kroizman Guy) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Re: rtti in headers In-Reply-To: <1182068868.5810.21.camel@localhost.localdomain> References: <1182068868.5810.21.camel@localhost.localdomain> Message-ID: <1182070393.5810.26.camel@localhost.localdomain> I now realize that in either case (static or dynamic linking), we should have no RTTI depended code in the headers. On Sun, 2007-06-17 at 11:27 +0300, Kroizman Guy wrote: > Hi, > Our Code is build without RTTI, and we wanna keep it this way. > We also want to use polymorphism in our XSD. > So we put the generated code in a library. > We rather this library would be static and not dynamically linked but > for that there must not be any RTTI dependent code in the header. > > can you please tell me if that is generally the case? or would we be > safer just using the lib as a dll? From boris at codesynthesis.com Sun Jun 17 10:35:14 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] rtti in headers In-Reply-To: <1182068868.5810.21.camel@localhost.localdomain> References: <1182068868.5810.21.camel@localhost.localdomain> Message-ID: <20070617143514.GA11907@karelia> Hi, Kroizman Guy writes: > Our Code is build without RTTI, and we wanna keep it this way. > We also want to use polymorphism in our XSD. > So we put the generated code in a library. > We rather this library would be static and not dynamically linked but > for that there must not be any RTTI dependent code in the header. > > can you please tell me if that is generally the case? or would we be > safer just using the lib as a dll? I think either DLL or static library approach should work. Note that you will probably also need to wrap calls to parsing/serialization functions since they report errors with exceptions (and those are not available when RTTI is disabled). hth, -boris From kroiz at hyperroll.com Mon Jun 18 04:24:17 2007 From: kroiz at hyperroll.com (Kroizman Guy) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] rtti in headers In-Reply-To: <20070617143514.GA11907@karelia> References: <1182068868.5810.21.camel@localhost.localdomain> <20070617143514.GA11907@karelia> Message-ID: <1182155057.8186.3.camel@localhost.localdomain> I don't understand, why exceptions are not available when RTTI is disables? would you please elaborate? On Sun, 2007-06-17 at 16:35 +0200, Boris Kolpackov wrote: > Hi, > > Kroizman Guy writes: > > > Our Code is build without RTTI, and we wanna keep it this way. > > We also want to use polymorphism in our XSD. > > So we put the generated code in a library. > > We rather this library would be static and not dynamically linked but > > for that there must not be any RTTI dependent code in the header. > > > > can you please tell me if that is generally the case? or would we be > > safer just using the lib as a dll? > > I think either DLL or static library approach should work. Note that > you will probably also need to wrap calls to parsing/serialization > functions since they report errors with exceptions (and those are not > available when RTTI is disabled). > > hth, > -boris From boris at codesynthesis.com Mon Jun 18 05:40:47 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] rtti in headers In-Reply-To: <1182155057.8186.3.camel@localhost.localdomain> References: <1182068868.5810.21.camel@localhost.localdomain> <20070617143514.GA11907@karelia> <1182155057.8186.3.camel@localhost.localdomain> Message-ID: <20070618094047.GA14045@karelia> Hi, Kroizman Guy writes: > I don't understand, why exceptions are not available when RTTI is > disables? would you please elaborate? Ah, my bad. For some reason I thought that exception handling in Visual C++ requires RTTI. This indeed does not seem to be the case. -boris From david.r.moss at selex-comms.com Mon Jun 18 09:11:24 2007 From: david.r.moss at selex-comms.com (david.r.moss@selex-comms.com) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Ambiguous ostream operator In-Reply-To: <20070618094047.GA14045@karelia> Message-ID: All, using xsd-3.0.0.b1-i686-windows and compiling the attached schema with xsd cxx-tree --generate-serialization empty-list-test.xsd i get the 'error C2593: 'operator <<' is ambiguous' error with the following code: auto_ptr db( root( "empty-list-test.xml" ) ); test_list_t& l = db->test_list(); // cout << "list:" << l << "." << endl; // FIXME: ambiguous << operator (list, simple type or type) if( !l.empty() ) // never empty with v2.3.1! { cout << "\tfirst item:" << *(l.begin()) << "." << endl; } any ideas?! I discovered this while trying to figure out why an empty list read from file (see attached xml) resulted in an object containing one (garbage-looking) item - i was using xsd version 2.3.1 at the time; that bug seems to have been fixed in 3.0.0.b1! Cheers, Dave. Dave Moss SELEX Communications Grange Road Christchurch Dorset BH23 4JE United Kingdom Tel: + 44 (0) 1202 404841 Email: david.r.moss@selex-comms.com ------------------------------------------------------------ This email and any attached files contains company confidential information which may be legally privileged. It is intended only for the person(s) or entity to which it is addressed and solely for the purposes set forth therein. If you are not the intended recipient or have received this email in error please notify the sender by return, delete it from your system and destroy any local copies. It is strictly forbidden to use the information in this email including any attachment or part thereof including copying, disclosing, distributing, amending or using for any other purpose. In addition the sender excludes all liabilities (whether tortious or common law) for damage or breach arising or related to this email including but not limited to viruses and libel. SELEX Communications Limited is a Private Limited Company registered in England and Wales under Company Number 964533 and whose Registered Office is Marconi House, New Street, CHELMSFORD, Essex. CM1 1PL. England. -------------- next part -------------- A non-text attachment was scrubbed... Name: empty-list-test.xsd Type: application/octet-stream Size: 396 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070618/b95a0441/empty-list-test.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: empty-list-test.xml Type: application/octet-stream Size: 182 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070618/b95a0441/empty-list-test-0001.obj From boris at codesynthesis.com Mon Jun 18 10:15:49 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Ambiguous ostream operator In-Reply-To: References: <20070618094047.GA14045@karelia> Message-ID: <20070618141549.GA14518@karelia> Hi Dave, david.r.moss@selex-comms.com writes: > xsd cxx-tree --generate-serialization empty-list-test.xsd > > i get the 'error C2593: 'operator <<' is ambiguous' error with the > following code: > > // cout << "list:" << l << "." << endl; I am not sure why VC++ complains about it being ambiguous. g++ correctly points out that there is simply no match. I think VC++ is confused by the serialization operators (which do not match anyway). In any case, you need to add the --generate-ostream option to the command line in order to get ostream operators for generated types. After adding this option the code compiles fine for me. > I discovered this while trying to figure out why an empty list read from > file (see attached xml) resulted in an object containing one > (garbage-looking) item - i was using xsd version 2.3.1 at the time; that > bug seems to have been fixed in 3.0.0.b1! Let me know if you have to stick with 2.3.1 and I will try to come up with a patch. Otherwise you can use 3.0.0.b1. It has quite a few new features and bugfixes. hth, -boris From david.r.moss at selex-comms.com Mon Jun 18 10:40:33 2007 From: david.r.moss at selex-comms.com (david.r.moss@selex-comms.com) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Ambiguous ostream operator In-Reply-To: <20070618141549.GA14518@karelia> Message-ID: Boris, > I am not sure why VC++ complains about it being ambiguous. g++ correctly > points out that there is simply no match. I think VC++ is confused by > the serialization operators (which do not match anyway). Wouldn't be the first time vc++ falls short of g++ :) > Let me know if you have to stick with 2.3.1 and I will try to come up > with a patch. Otherwise you can use 3.0.0.b1. It has quite a few new > features and bugfixes. I can't currently see a reason not to use 3.0.0.b1 so don't worry about a patch. thanks anyway, and for the swift response. Cheers, Dave. Dave Moss SELEX Communications Grange Road Christchurch Dorset BH23 4JE United Kingdom Tel: + 44 (0) 1202 404841 Email: david.r.moss@selex-comms.com xsd-users-bounces@codesynthesis.com wrote on 06/18/2007 03:15:49 PM: > Hi Dave, > > david.r.moss@selex-comms.com writes: > > > xsd cxx-tree --generate-serialization empty-list-test.xsd > > > > i get the 'error C2593: 'operator <<' is ambiguous' error with the > > following code: > > > > // cout << "list:" << l << "." << endl; > > I am not sure why VC++ complains about it being ambiguous. g++ correctly > points out that there is simply no match. I think VC++ is confused by > the serialization operators (which do not match anyway). In any case, > you need to add the --generate-ostream option to the command line in > order to get ostream operators for generated types. After adding this > option the code compiles fine for me. > > > I discovered this while trying to figure out why an empty list read from > > file (see attached xml) resulted in an object containing one > > (garbage-looking) item - i was using xsd version 2.3.1 at the time; that > > bug seems to have been fixed in 3.0.0.b1! > > Let me know if you have to stick with 2.3.1 and I will try to come up > with a patch. Otherwise you can use 3.0.0.b1. It has quite a few new > features and bugfixes. > > hth, > -boris > ------------------------------------------------------------ This email and any attached files contains company confidential information which may be legally privileged. It is intended only for the person(s) or entity to which it is addressed and solely for the purposes set forth therein. If you are not the intended recipient or have received this email in error please notify the sender by return, delete it from your system and destroy any local copies. It is strictly forbidden to use the information in this email including any attachment or part thereof including copying, disclosing, distributing, amending or using for any other purpose. In addition the sender excludes all liabilities (whether tortious or common law) for damage or breach arising or related to this email including but not limited to viruses and libel. SELEX Communications Limited is a Private Limited Company registered in England and Wales under Company Number 964533 and whose Registered Office is Marconi House, New Street, CHELMSFORD, Essex. CM1 1PL. England. From samiksha.rajput at tcs.com Thu Jun 21 06:09:16 2007 From: samiksha.rajput at tcs.com (Samiksha Rajput) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] problem with xsd-2.3.1-hppa-hpux Message-ID: Hi , I have downloaded xsd-2.3.1-hppa-hpux . I have HP UX 11.11 Compiler aCC 3.63 64 bit xerces is built with -AA option . I am able to build the code but at run time I am getting following error. /usr/lib/dld.sl: Unresolved symbol: typeid__XT9exception_ (data) from /xerces-c-src_2_7_0/lib/libxerces-c.sl.27 Abort(coredump) Please help me. Thank you Samiksha Vijaysinha Rajput Tata Consultancy Services Mailto: samiksha.rajput@tcs.com Website: http://www.tcs.com =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you From boris at codesynthesis.com Thu Jun 21 06:54:41 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] problem with xsd-2.3.1-hppa-hpux In-Reply-To: References: Message-ID: <20070621105441.GA2417@karelia> Hi Samiksha, Samiksha Rajput writes: > I have HP UX 11.11 > Compiler aCC 3.63 64 bit > > xerces is built with -AA option . > > I am able to build the code but at run time I am getting following error. > /usr/lib/dld.sl: Unresolved symbol: typeid__XT9exception_ (data) from > /xerces-c-src_2_7_0/lib/libxerces-c.sl.27 > Abort(coredump) Can you make sure you are compiling the generated code and linking your application with the -AA option. The library that provides this symbol is automatically included when you link your program with the -AA option. hth, -boris From boris at codesynthesis.com Thu Jun 21 09:19:32 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] problem with xsd-2.3.1-hppa-hpux In-Reply-To: References: <20070621105441.GA2417@karelia> Message-ID: <20070621131932.GB2417@karelia> Hi Samiksha, In the future please keep your replies CC'ed to the xsd-users mailing list. This way a) other developers who may have experienced a similar problem can provide you with a solution b) questions and answers will be archived and available to others with similar problems. Samiksha Rajput writes: > I am compiling the generated code and linking application with the -AA > option > > Command Given => gmake CXX=aCC CPPFLAGS="-I /usr/local/include" > LDFLAGS="-L /usr/local/lib" > > Output => > > ../../../../bin/xsd cxx-tree hello.xsd > > aCC -I /usr/local/include -I../../../../libxsd -AA +W849 +W1039 -c > driver.cxx -o driver.o > > aCC -I /usr/local/include -I../../../../libxsd -AA +W849 +W1039 -c > hello.cxx -o hello.o > > aCC -AA +W849 +W1039 -L /usr/local/lib -o driver driver.o hello.o > -lxerces-c > > It builds driver executable Hm, the next suspect is the Xerces-C++ library. Can you make sure that it is compiled and linked with the -AA option by adding the -l -AA and -z -AA options to runConfigure and rebuilding Xerces-C++? hth, -boris From samiksha.rajput at tcs.com Fri Jun 22 02:16:24 2007 From: samiksha.rajput at tcs.com (Samiksha Rajput) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] problem with xsd-2.3.1-hppa-hpux In-Reply-To: <20070621131932.GB2417@karelia> Message-ID: Hi Boris, We have compiled and linked Xerces-C++ library with the -AA option by adding the -l -AA and -z -AA options to runConfigure and rebuilding Xerces-C++. After this we were getting problem of coredump . But that problem was solved by we need to build hello.cxx with -mt option .. This finally solved the problem. Thanks and Regards. Samiksha Vijaysinha Rajput Tata Consultancy Services Mailto: samiksha.rajput@tcs.com Website: http://www.tcs.com Boris Kolpackov 06/21/2007 06:49 PM To Samiksha Rajput cc xsd-users@codesynthesis.com Subject Re: [xsd-users] problem with xsd-2.3.1-hppa-hpux Hi Samiksha, In the future please keep your replies CC'ed to the xsd-users mailing list. This way a) other developers who may have experienced a similar problem can provide you with a solution b) questions and answers will be archived and available to others with similar problems. Samiksha Rajput writes: > I am compiling the generated code and linking application with the -AA > option > > Command Given => gmake CXX=aCC CPPFLAGS="-I /usr/local/include" > LDFLAGS="-L /usr/local/lib" > > Output => > > ../../../../bin/xsd cxx-tree hello.xsd > > aCC -I /usr/local/include -I../../../../libxsd -AA +W849 +W1039 -c > driver.cxx -o driver.o > > aCC -I /usr/local/include -I../../../../libxsd -AA +W849 +W1039 -c > hello.cxx -o hello.o > > aCC -AA +W849 +W1039 -L /usr/local/lib -o driver driver.o hello.o > -lxerces-c > > It builds driver executable Hm, the next suspect is the Xerces-C++ library. Can you make sure that it is compiled and linked with the -AA option by adding the -l -AA and -z -AA options to runConfigure and rebuilding Xerces-C++? hth, -boris ForwardSourceID:NT00007CC2 =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you From samiksha.rajput at tcs.com Fri Jun 22 10:09:23 2007 From: samiksha.rajput at tcs.com (Samiksha Rajput) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] problem with xsd-2.3.1-hppa-hpux In-Reply-To: <20070621131932.GB2417@karelia> Message-ID: Hi Boris, My project requirement are as follows: XML files (around 7GB data) are received through Websphere MQ. The data from the xml file is used to populate the input parameters of the method to be invoked. The output parameters from method is required to form back xml which will be response xml needed to be passed through Websphere MQ. Please let us know whether xsd fits in with above requirements? Thanks and Regards. Samiksha Vijaysinha Rajput Tata Consultancy Services Mailto: samiksha.rajput@tcs.com Website: http://www.tcs.com Boris Kolpackov 06/21/2007 06:49 PM To Samiksha Rajput cc xsd-users@codesynthesis.com Subject Re: [xsd-users] problem with xsd-2.3.1-hppa-hpux Hi Samiksha, In the future please keep your replies CC'ed to the xsd-users mailing list. This way a) other developers who may have experienced a similar problem can provide you with a solution b) questions and answers will be archived and available to others with similar problems. Samiksha Rajput writes: > I am compiling the generated code and linking application with the -AA > option > > Command Given => gmake CXX=aCC CPPFLAGS="-I /usr/local/include" > LDFLAGS="-L /usr/local/lib" > > Output => > > ../../../../bin/xsd cxx-tree hello.xsd > > aCC -I /usr/local/include -I../../../../libxsd -AA +W849 +W1039 -c > driver.cxx -o driver.o > > aCC -I /usr/local/include -I../../../../libxsd -AA +W849 +W1039 -c > hello.cxx -o hello.o > > aCC -AA +W849 +W1039 -L /usr/local/lib -o driver driver.o hello.o > -lxerces-c > > It builds driver executable Hm, the next suspect is the Xerces-C++ library. Can you make sure that it is compiled and linked with the -AA option by adding the -l -AA and -z -AA options to runConfigure and rebuilding Xerces-C++? hth, -boris ForwardSourceID:NT00007CC2 =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you From rlischner at proteus-technologies.com Fri Jun 22 13:34:05 2007 From: rlischner at proteus-technologies.com (Ray Lischner) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] xsd::cxx::tree::list::init() in 2.3.1 can't handle empty strings Message-ID: There is a bug in the library of release 2.3.1. An empty causes list::init to take the empty string and try to initialize one element of the list with that empty string. I was going to supply a patch, but then I realized that I'm not entirely sure what is correct. An empty string is easy. What if the string contains a single space? None of my books is detailed enough to describe precisely the correct behavior in that case. -- Ray Lischner, Proteus Technologies From boris at codesynthesis.com Sat Jun 23 13:03:15 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] xsd::cxx::tree::list::init() in 2.3.1 can't handle empty strings In-Reply-To: References: Message-ID: <20070623170315.GA13518@karelia> Hi Ray, Ray Lischner writes: > There is a bug in the library of release 2.3.1. An empty causes > list::init to take the empty string and try to initialize one element > of the list with that empty string. I was going to supply a patch, but > then I realized that I'm not entirely sure what is correct. An empty > string is easy. What if the string contains a single space? The spaces are collapsed which means a string with a single space results in an empty list. I have made a patch for 2.3.1 that should fix this bug: http://www.codesynthesis.com/~boris/tmp/xsd-2.3.1-list-init.patch Thanks for reporting this! -boris From boris at codesynthesis.com Sat Jun 23 13:13:33 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] problem with xsd-2.3.1-hppa-hpux In-Reply-To: References: <20070621131932.GB2417@karelia> Message-ID: <20070623171333.GB13518@karelia> Hi Samiksha, Samiksha Rajput writes: > XML files (around 7GB data) are received through Websphere MQ. Do you mean each XML file is around 7GB? > The data from the xml file is used to populate the input parameters of > the method to be invoked. > The output parameters from method is required to form back xml which > will be response xml needed to be passed through Websphere MQ. How much data from an XML file is used to make each request? If the data required for each request is spread all over the XML file than an in-memory approach would probably be the most straightforward (provided you have enough RAM to hold the data in memory). If you use only a small, fairly local portion (think "record") of XML data in a request then a stream-based approach might be a better answer especially for 7GB files. XSD offers both in-memory (C++/Tree mapping) and stream-oriented (C++/Parser mapping) XML data binding. hth, -boris From breizh_picsou at yahoo.fr Mon Jun 25 03:19:41 2007 From: breizh_picsou at yahoo.fr (Picsou en Bretagne) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Need help !!! Message-ID: <652253.43173.qm@web26008.mail.ukl.yahoo.com> Hello , I look for help for using your tool. First I use cxx-tree and I can parse my xsd file and xml. But I need to find a specific function : for example, with the ID of a node, I want to "see" its parents. IS it possible only using genrate code or must I use xerces functions ? THXS for your help Mike --------------------------------- Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail From boris at codesynthesis.com Mon Jun 25 05:46:27 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Need help !!! In-Reply-To: <652253.43173.qm@web26008.mail.ukl.yahoo.com> References: <652253.43173.qm@web26008.mail.ukl.yahoo.com> Message-ID: <20070625094627.GA24368@karelia> Hi, Picsou en Bretagne writes: > But I need to find a specific function : for example, with the ID of a > node, I want to "see" its parents. IS it possible only using genrate > code or must I use xerces functions? I am not sure what you mean here. Each node has only one parent (the in-memory structure is a tree). Perhaps you want to get to the child nodes? Providing a small schema fragment that illustrates what you are trying to accomplish would also be helpful. -boris From samiksha.rajput at tcs.com Mon Jun 25 06:57:02 2007 From: samiksha.rajput at tcs.com (Samiksha Rajput) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] creation of xml file from c++ object In-Reply-To: <20070625094627.GA24368@karelia> Message-ID: Hi Boris, Is it possible to generate the xml file when c++ object is provided to the xsd-2.3.1-hppa-hpux tool. Also please send the documentation link for the same. Thanks and Regards. Samiksha Vijaysinha Rajput Tata Consultancy Services Mailto: samiksha.rajput@tcs.com Website: http://www.tcs.com Boris Kolpackov Sent by: xsd-users-bounces@codesynthesis.com 06/25/2007 03:16 PM To Picsou en Bretagne cc xsd-users@codesynthesis.com Subject Re: [xsd-users] Need help !!! Hi, Picsou en Bretagne writes: > But I need to find a specific function : for example, with the ID of a > node, I want to "see" its parents. IS it possible only using genrate > code or must I use xerces functions? I am not sure what you mean here. Each node has only one parent (the in-memory structure is a tree). Perhaps you want to get to the child nodes? Providing a small schema fragment that illustrates what you are trying to accomplish would also be helpful. -boris ForwardSourceID:NT00007D32 =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you From boris at codesynthesis.com Mon Jun 25 07:08:18 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Re: creation of xml file from c++ object In-Reply-To: References: <20070625094627.GA24368@karelia> Message-ID: <20070625110818.GA25448@karelia> Hi Samiksha, Samiksha Rajput writes: > Is it possible to generate the xml file when c++ object is provided to the > xsd-2.3.1-hppa-hpux tool. If you want to automatically generate XML serialization code from your own C++ classes, then no, this is not possible with XSD. If you want to serialize C++ classes that were generated from XML Schema, then yes, this can be done. See the library example in the XSD distribution and Chapter 4, "Serialization" in the C++/Tree Mapping User Manual: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#4 hth, -boris From samiksha.rajput at tcs.com Mon Jun 25 07:54:57 2007 From: samiksha.rajput at tcs.com (Samiksha Rajput) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Re: creation of xml file from c++ object In-Reply-To: <20070625110818.GA25448@karelia> Message-ID: Hi , Can anyone please tell me how to access elements of type "xsd::cxx::tree::optional" in the driver.cxx Thanks and Samiksha Vijaysinha Rajput Tata Consultancy Services Mailto: samiksha.rajput@tcs.com Website: http://www.tcs.com Boris Kolpackov 06/25/2007 04:38 PM To Samiksha Rajput cc Boris Kolpackov , xsd-users@codesynthesis.com Subject Re: creation of xml file from c++ object Hi Samiksha, Samiksha Rajput writes: > Is it possible to generate the xml file when c++ object is provided to the > xsd-2.3.1-hppa-hpux tool. If you want to automatically generate XML serialization code from your own C++ classes, then no, this is not possible with XSD. If you want to serialize C++ classes that were generated from XML Schema, then yes, this can be done. See the library example in the XSD distribution and Chapter 4, "Serialization" in the C++/Tree Mapping User Manual: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#4 hth, -boris ForwardSourceID:NT00007D3E =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you From boris at codesynthesis.com Mon Jun 25 07:52:37 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Need help !!! In-Reply-To: <197255.20421.qm@web26013.mail.ukl.yahoo.com> References: <20070625094627.GA24368@karelia> <197255.20421.qm@web26013.mail.ukl.yahoo.com> Message-ID: <20070625115237.GB25448@karelia> Hi, In the future please keep your replies CC'ed to the xsd-users mailing list. This way a) other developers who may have experienced a similar problem can provide you with a solution b) questions and answers will be archived and available to others with similar problems. Picsou en Bretagne writes: > For example, in the sample for polymorphism: > > Bruce Wayne > > > > I have in parameter "Bruce Wayne" and I want to know that it a > "child" of superman with the attributes "can-fly" .... This sample > is pershaps too short to explain my problem but you can imagine this > with 2 steps with containers for example. > > > for (AAA::iterator iter ...) > { > ... (get and container) > for (BBB::iterator iter2 ...) > ---> Here I want to know witch AAA element has the present > son and his attributes, values without storing this. You can use the _container function which returns parent object as a pointer to xml_schema::type. This type is a root of the generated types hierarchy: object& obj = ... xml_schema::type* parent (obj._container ()); hth, -boris From boris at codesynthesis.com Mon Jun 25 08:05:45 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Re: creation of xml file from c++ object In-Reply-To: References: <20070625110818.GA25448@karelia> Message-ID: <20070625120545.GD25448@karelia> Hi Samiksha, Samiksha Rajput writes: > Can anyone please tell me how to access elements of type > "xsd::cxx::tree::optional" in the driver.cxx Please read the manual, particularly Section 2.8.2, "Mapping for Members with the Optional Cardinality Class": http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.8.2 -boris From breizh_picsou at yahoo.fr Mon Jun 25 08:29:12 2007 From: breizh_picsou at yahoo.fr (Picsou en Bretagne) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Need help !!! In-Reply-To: <20070625115237.GB25448@karelia> Message-ID: <842497.22012.qm@web26015.mail.ukl.yahoo.com> sorry for the reply and thanks for your solution but is it possible to have the parent object to have attributes for exemple because I'm not sur but this solution bring the name of the element only , No ? I think it's my last question !!! Mike Boris Kolpackov a ?crit : Hi, In the future please keep your replies CC'ed to the xsd-users mailing list. This way a) other developers who may have experienced a similar problem can provide you with a solution b) questions and answers will be archived and available to others with similar problems. Picsou en Bretagne writes: > For example, in the sample for polymorphism: > > Bruce Wayne > > > > I have in parameter "Bruce Wayne" and I want to know that it a > "child" of superman with the attributes "can-fly" .... This sample > is pershaps too short to explain my problem but you can imagine this > with 2 steps with containers for example. > > > for (AAA::iterator iter ...) > { > ... (get and container) > for (BBB::iterator iter2 ...) > ---> Here I want to know witch AAA element has the present > son and his attributes, values without storing this. You can use the _container function which returns parent object as a pointer to xml_schema::type. This type is a root of the generated types hierarchy: object& obj = ... xml_schema::type* parent (obj._container ()); hth, -boris --------------------------------- Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail From boris at codesynthesis.com Mon Jun 25 08:48:57 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Need help !!! In-Reply-To: <842497.22012.qm@web26015.mail.ukl.yahoo.com> References: <20070625115237.GB25448@karelia> <842497.22012.qm@web26015.mail.ukl.yahoo.com> Message-ID: <20070625124857.GA25720@karelia> Hi, Picsou en Bretagne writes: > sorry for the reply and thanks for your solution but is it possible to > have the parent object to have attributes for exemple because I'm not > sur but this solution bring the name of the element only , No ? You will need to cast the returned (generic) pointer to a concrete type before you can do anything useful with it. For example if we are iterating over authors of a book in the library example (using 2.3.1 syntax): catalog& cat = ... for (catalog::book::iterator bi (cat.book ().begin ()); bi != cat.book ().end (); ++bi) { for (book::author::iterator ai (bi->author ().begin ()); ai != bi->author ().end (); ++ai) { author& a = *ai; book* b = static_cast (a._container ()); catalog* c = static_cast (b->_container ()); } } hth, -boris From smartpratik at gmail.com Mon Jun 25 09:09:57 2007 From: smartpratik at gmail.com (pratik verma) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] problem while compiling the class generated by codesynthesis XSD2.2.3 Message-ID: hello, I m pratik verma. We are working on a open source project Chillout for which we need to convert xml schemas in to c++ classes. The class has been generated by the following command for the attache file. There was not any kind of error and warning during its generation. But when we are compiling it with some other files there is an error in this file Command used for generation for .hxx and template .txx is xsd cxx-parser --morph-anonymous --namespace-map urn:dmp:idp2:Represent:DRMMessages:2006:02=chillout::dmp2rdm --namespace-map urn:dmp:idp2:Represent:Key:2006:02=chillout::dmp2rk --namespace-map urn:dmp:idp2:Represent:License:2006:02=chillout::dmp2rl --namespace-map urn:dmp:idp2:Represent:ToolBody:2006:02=chillout::dmp2rtb --namespace-map urn:dmp:idp1:mpeg21:2002:01-DII-NS:2005:04=chillout::dmp2dii --namespace-map urn:dmp:idp2:mpeg21:2004:01-IPMPDIDL-NS:2006:02=chillout::dmp2ipmpdidl --namespace-map urn:dmp:idp2:mpeg21:2004:01-IPMPINFO-NS:2006:02=chillout::dmp2ipmpinfo --namespace-map http://www.w3.org/2000/09/xmldsig#=chillout::dsig--namespace-map http://www.w3.org/2001/04/xmlenc#=chillout::xenc dmp2rdm-2006-02.xsd errors while compiling are:- in .hxx Error : declaration of struct chillout::dm2rdm::_xsd_toolType<_xsd_toolBaseDescription_,_xsd_ToolRef_, _xsd_InitalizationSettings_, _xsd_RightsDescriptor_, _xsd_signature, _xsd_order, _xsd_alternators, _xsd parametricDescription> Error 2: line 568 unexpected initalizer before '<' token Error 3: chillout dmp2info has not been declared .txx Error line 3529 _end_element_impl has not been declared Error chillout:dmp2ipmpinfo not declared I have also attached the .xsd file for it. So please suggest me somthing so that I can overcome this error.I shall be waiting for your reply -------------- next part -------------- A non-text attachment was scrubbed... Name: dmp2rdm-2006-02.xsd Type: application/octet-stream Size: 32434 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070625/62c23ef1/dmp2rdm-2006-02.obj From rlischner at proteus-technologies.com Mon Jun 25 10:05:45 2007 From: rlischner at proteus-technologies.com (Ray Lischner) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] xsd::cxx::tree::list::init() in 2.3.1 can't handle empty strings References: <20070623170315.GA13518@karelia> Message-ID: Thank you, but the patch has a problem. The compiler complains that sequence has no member named ptr. I agree with the compiler. I don't understand the line typedef typename sequence::ptr ptr; It seems that ptr is a struct, defined earlier in the file, and this line simply shouldn't be there. -- Ray Lischner, Proteus Technologies ________________________________ From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Sat 6/23/2007 1:03 PM To: Ray Lischner Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] xsd::cxx::tree::list::init() in 2.3.1 can't handle empty strings Hi Ray, Ray Lischner writes: > There is a bug in the library of release 2.3.1. An empty causes > list::init to take the empty string and try to initialize one element > of the list with that empty string. I was going to supply a patch, but > then I realized that I'm not entirely sure what is correct. An empty > string is easy. What if the string contains a single space? The spaces are collapsed which means a string with a single space results in an empty list. I have made a patch for 2.3.1 that should fix this bug: http://www.codesynthesis.com/~boris/tmp/xsd-2.3.1-list-init.patch Thanks for reporting this! -boris From boris at codesynthesis.com Mon Jun 25 10:27:23 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] xsd::cxx::tree::list::init() in 2.3.1 can't handle empty strings In-Reply-To: References: <20070623170315.GA13518@karelia> Message-ID: <20070625142723.GC25720@karelia> Hi Ray, Ray Lischner writes: > The compiler complains that sequence has no member named ptr. I agree > with the compiler. I don't understand the line > > typedef typename sequence::ptr ptr; > > It seems that ptr is a struct, defined earlier in the file, and this > line simply shouldn't be there. Yes, this line should be removed. I've adopted this code from 3.0.0 which requires this typedef. I've also uploaded the correct patch: http://www.codesynthesis.com/~boris/tmp/xsd-2.3.1-list-init.patch thanks, -boris From boris at codesynthesis.com Mon Jun 25 11:12:09 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Re: problem while compiling the class generated by codesynthesis XSD2.2.3 In-Reply-To: References: Message-ID: <20070625151209.GD25720@karelia> Hi Pratik, pratik verma writes: > I have also attached the .xsd file for it. So please suggest me somthing > so that I can overcome this error. I was unable to generate the code from your schema and try to reproduce the problem because your schema imports a number of other schemas which you haven't provided. If you want me to further look into this, please send (or better yet put on the web and provide a link) all the dependencies. Alternatively, there are a few things you may want to try: 1. Upgrade to 2.3.1. A few bugs have been fixed since 2.2.3 in C++/Parser. 2. For the upcoming 3.0.0 release we have significantly redesigned and improved the C++/Parser mapping. It also includes the sample implementation generation feature which should speed up the development for large XML vocabularies. We are releasing the second beta for 3.0.0 tomorrow. I suggest that you give this version a try. hth, -boris From samiksha.rajput at tcs.com Tue Jun 26 04:52:28 2007 From: samiksha.rajput at tcs.com (Samiksha Rajput) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Re: creation of xml file from c++ object In-Reply-To: <20070625110818.GA25448@karelia> Message-ID: Hi, Can anyone tell me where can I get the example for the conversion of c++ object to the xml file. Thanks and Regards. Samiksha Vijaysinha Rajput Tata Consultancy Services Mailto: samiksha.rajput@tcs.com Website: http://www.tcs.com Boris Kolpackov 06/25/2007 04:38 PM To Samiksha Rajput cc Boris Kolpackov , xsd-users@codesynthesis.com Subject Re: creation of xml file from c++ object Hi Samiksha, Samiksha Rajput writes: > Is it possible to generate the xml file when c++ object is provided to the > xsd-2.3.1-hppa-hpux tool. If you want to automatically generate XML serialization code from your own C++ classes, then no, this is not possible with XSD. If you want to serialize C++ classes that were generated from XML Schema, then yes, this can be done. See the library example in the XSD distribution and Chapter 4, "Serialization" in the C++/Tree Mapping User Manual: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#4 hth, -boris ForwardSourceID:NT0000107E =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you From breizh_picsou at yahoo.fr Tue Jun 26 05:14:31 2007 From: breizh_picsou at yahoo.fr (Picsou en Bretagne) Date: Sun Oct 11 15:33:56 2009 Subject: [xsd-users] Need help !!! In-Reply-To: <20070625124857.GA25720@karelia> Message-ID: <922020.93370.qm@web26012.mail.ukl.yahoo.com> sorry to disturb you again but I have problems using your sample. In my project, first I'm reading all elements and I'm storing reference of this elements in a list. Then I'm reading the list and trying to find parent of this element to find the "path". For example, this is a sample of my problem : for ( LIST::iterator iter (myList.begin()); iter !=myList.end(); ++iter) { A & a = *iter; cerr << endl << "ELEMENT: " << a.NAME() << endl ; B* b = static_cast (a._container ()); cerr << endl << "PARENT : " << b->NAME() << endl ; } but the result is bad : for "b", I see name of "a" thxs a lot MIKE Boris Kolpackov a ?crit : Hi, Picsou en Bretagne writes: > sorry for the reply and thanks for your solution but is it possible to > have the parent object to have attributes for exemple because I'm not > sur but this solution bring the name of the element only , No ? You will need to cast the returned (generic) pointer to a concrete type before you can do anything useful with it. For example if we are iterating over authors of a book in the library example (using 2.3.1 syntax): catalog& cat = ... for (catalog::book::iterator bi (cat.book ().begin ()); bi != cat.book ().end (); ++bi) { for (book::author::iterator ai (bi->author ().begin ()); ai != bi->author ().end (); ++ai) { author& a = *ai; book* b = static_cast (a._container ()); catalog* c = static_cast (b->_container ()); } } hth, -boris --------------------------------- Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail From boris at codesynthesis.com Tue Jun 26 06:24:07 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Re: creation of xml file from c++ object In-Reply-To: References: <20070625110818.GA25448@karelia> Message-ID: <20070626102407.GA29591@karelia> Hi Samiksha, Samiksha Rajput writes: > Can anyone tell me where can I get the example for the conversion of c++ > object to the xml file. If you mean XSD-generated C++ object then take a look at the library example in examples/cxx/tree/library/. If you mean your own C++ object, then, as I said, this functionality is not provided by XSD and this list is a wrong place to ask this question. hth, -boris From boris at codesynthesis.com Tue Jun 26 06:28:08 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Need help !!! In-Reply-To: <922020.93370.qm@web26012.mail.ukl.yahoo.com> References: <20070625124857.GA25720@karelia> <922020.93370.qm@web26012.mail.ukl.yahoo.com> Message-ID: <20070626102808.GB29591@karelia> Hi, Picsou en Bretagne writes: > In my project, first I'm reading all elements and I'm storing reference > of this elements in a list. You cannot store a reference in a list. What you are doing is making and storing a copy of the node in your list. Since this copy is not part of the original tree, it does not have a parent. Try instead to store a pointer to the original node which is part of the tree. Then everything should work. hth, -boris From samiksha.rajput at tcs.com Tue Jun 26 09:01:12 2007 From: samiksha.rajput at tcs.com (Samiksha Rajput) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Compilation options -Aa and -AA In-Reply-To: <20070626102407.GA29591@karelia> Message-ID: Hi Boris, I have one problem in compiling the xsd . My application needs the -Aa option for the build and xsd requires -AA option for build . So in such case can you please tell me how to handle both requirements of compilation options? I have tried to compile with both options separately and together but in each case it fails . When I give both -Aa and -AA options together its giving preference to -AA and ultimately at run time it fails . Can you please tell me how to overcome this problem? Is it possible for you to provide your contact number? Thanks and Regards. Samiksha Vijaysinha Rajput Tata Consultancy Services Mailto: samiksha.rajput@tcs.com Website: http://www.tcs.com Boris Kolpackov 06/26/2007 03:54 PM To Samiksha Rajput cc xsd-users@codesynthesis.com Subject Re: creation of xml file from c++ object Hi Samiksha, Samiksha Rajput writes: > Can anyone tell me where can I get the example for the conversion of c++ > object to the xml file. If you mean XSD-generated C++ object then take a look at the library example in examples/cxx/tree/library/. If you mean your own C++ object, then, as I said, this functionality is not provided by XSD and this list is a wrong place to ask this question. hth, -boris ForwardSourceID:NT00007DB2 =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you From boris at codesynthesis.com Tue Jun 26 09:38:54 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Re: Compilation options -Aa and -AA In-Reply-To: References: <20070626102407.GA29591@karelia> Message-ID: <20070626133854.GD29591@karelia> Hi Samiksha, Samiksha Rajput writes: > I have one problem in compiling the xsd . > My application needs the -Aa option for the build and xsd requires -AA > option for build . > So in such case can you please tell me how to handle both requirements of > compilation options? XSD requires -AA since this option switches the compiler into ANSI C++ mode. Since -AA only turns additional features compared to -Aa, I suggest that you (re)compile your application with -AA. > I have tried to compile with both options separately and together but in > each case it fails . > When I give both -Aa and -AA options together its giving preference to -AA > and ultimately at run time it fails . Right, HP manual states that executables and libraries compiled with different -A? options are not compatible. > Is it possible for you to provide your contact number? Yes, our contact number is +27 76 1672134 (9:00 - 18:00 GMT+2). Note however that we provide technical support over the phone only for organizations with priority support contracts on commercial basis. If you would like to discuss this further, please contact me off list. hth, -boris From boris at codesynthesis.com Tue Jun 26 11:13:45 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] XSD 3.0.0.b2 released Message-ID: <20070626151345.GE29591@karelia> Hi, We have released XSD 3.0.0.b2 which is the second and final beta for the upcoming 3.0.0 major release. This beta is mostly focused on the C++/Parser mapping though there are some changes to C++/Tree since the previous beta (see the second and fifth points in the C++/Tree category below). The NEWS file entries so far are as follows: * Anonymous type morphing (automatic type naming) is now performed by default in both mappings. The --morph-anonymous option does not have any effect but is preserved for backwards compatibility. A new option, --preserve-anonymous, disables anonymous type morphing. This option is useful together with --show-anonymous if you want to make sure your schemas do not have any anonymous types. * Number of bug fixes in both C++/Tree and C++/Parser mappings. C++/Tree * Optimizations for the generated code size and compilation time, including space optimizations for polymorphic parsing and serialization. * The type definitions for local elements and attributes in the form name::type have been changed to name_type. For example, an element bar in type foo with maxOccurs="unbounded" used to have its iterator type defined as foo::bar::iterator. With this change it becomes foo::bar_iterator. Furthermore, the container type for sequence elements has changed from foo::bar::container to foo::bar_sequence and for optional elements and attributes from foo::bar::container to foo::bar_optional. This is a backwards incompatible change and may require the application code adjustments (the C++ compiler will pinpoint the affected places). * New option, --generate-wildcard, triggers generation of the new wildcard (any and anyAttribute) mapping. This mapping represents the content matched by wildcards as DOM fragments. For more information on the new mapping see Section 2.12, "Mapping for any and anyAttribute" in the C++/Tree Mapping User Manual as well as the wildcard example in the examples/cxx/tree/ directory. * New option, --generate-comparison, triggers generation of comparison operators (== and !=) for complex types. Comparison is performed memberwise. * New constructor is generated for complex types with ultimate bases that are simple types and can be default-initialized. This constructor includes initializers for all required members but omits the initializer for the base type. See Section 2.7, "Mapping for Complex Types" in the C++/Tree Mapping User Manual for more information. * Support for polymorphic binary serialization and extraction. Note that the semantics of the --generate-insertion and --generate-extraction options has changed. See the XSD Compiler Command Line Manual (man pages) for details. * New parsing function with the DOMDocument* argument and the own_dom flag allow the tree to assume the DOM document ownership when when DOM association is used (keep_dom flag). See the C++/Tree Mapping User Manual for more information. * The mapping of built-in XML Schema type decimal has changed from long double to double. The old mapping can be obtained by providing a custom mapping for this type. * The xml_schema::errors type which is used in the xml_schema::parsing and xml_schema::serialization exceptions has been renamed to xml_schema::diagnostics and extended to include warnings in addition to errors. * Serialization operators now clear the element being serialized to from existing child nodes and attributes (except for special attributes such as prefix-namespace mappings, etc.). * Improved built-in type parsing, including support for normalization and whitespace collapsing. C++/Parser * The C++/Parser mapping have been significantly redesigned. See the new Getting Started Guide in documentation/cxx/parser/guide/ for details. * The new C++/Parser Mapping Getting Started Guide is available in the documentation/cxx/parser/guide/ directory. * The mapping now provides parser implementations for all built-in XML Schema types. See Chapter 6 in the C++/Parser Mapping Getting Started Guide for more information. * The mapping now supports automatic generation of sample parser implementations and a test driver. The --generate-noop-impl option triggers generation of a sample implementation with empty function bodies. The --generate-print-impl option triggers generation of a sample implementation that prints the data stored in XML to STDOUT. The --generate-test-driver trigger generation of a test driver. For more information on this feature see the XSD Compiler Command Line Manual and the 'generated' example in the example/cxx/parser directory. Other relevant options include: --force-overwrite, --root-element-first, --root-element-last, and --root-element. * The xml_schema::errors type which is used in the xml_schema::parsing exception has been renamed to xml_schema::diagnostics and extended to include warnings in addition to errors. Thanks to the following individuals for reporting bugs as well as suggesting fixes and improvements: Ray Lischner Bradley Beddoes Mark Hoffmann Thomas M?ller Mark Lofdahl Fukasawa Mitsuo Mark Watson Sergei V. Firsov Paolo Volpi Mark Kinzie Arthur Eelko de Groot Thomas Maenner Gerard Lanois Glenn Nieuwenhuyse Mark Kinzie Precompiled binary distributions are available from the product's download page: http://www.codesynthesis.com/products/xsd/download.xhtml Source code for this release is available from the project's web page: http://www.codesynthesis.com/projects/xsd/ SHA1 checksums for the files: 50008c0ecbcd07313a191044404650c7b9478e3e xsd-3.0.0.b2.tar.bz2 3133d0c56f01a7901f9f8f40855af1a0efe27d2a xsd-3.0.0.b2-i686-linux-gnu.tar.bz2 9c0a76dd18a00b58aa6004400d1d544f678d646e xsd-3.0.0.b2-x86_64-linux-gnu.tar.bz2 426851e581690b1f958af35ea233b70fde77e6ee xsd-3.0.0.b2-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/20070626/27c4f8d2/attachment.pgp From boris at codesynthesis.com Tue Jun 26 11:41:26 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Re: problem while compiling the class generated by codesynthesis XSD2.2.3 In-Reply-To: References: <20070625151209.GD25720@karelia> <20070626112927.GC29591@karelia> Message-ID: <20070626154126.GG29591@karelia> Hi Pratik, [I've CC'ed xsd-users to my reply in case someone else is/will be wrestling with these schemas (http://www.dmpf.org/schemas/index.html).] I've tried to compile these schemas with just-released 3.0.0.b2. Compiling the code generated with this version also results in an error. The problem is in the cyclic importing of the schemas. For example, dmp2rdm-2006-02.xsd imports dmp2ipmpinfo.xsd and dmp2ipmpinfo.xsd imports dmp2rdm-2006-02.xsd. XSD can generate compilable code for such a situation but only if there is no inheritance between types in the separate files. Unfortunately, there is such inheritance in your case. The only way to work around this problem is to break the cyclic dependency by factoring out a subset of one of the files into a separate schema and including that "base" into the other file. In other word, right now you have: "a.xsd" <==> "b.xsd" After the refactoring you will have: "a-base.xsd" ^ ^ | | | | "a.xsd" --> "b.xsd" The idea is to move to "a-base.xsd" declarations which a necessary for "b.xsd". In the future we are planning to add an option to XSD to "merge" such cyclic schemas into a single "blob" and generate the code into a single file. hth, -boris From david.r.moss at selex-comms.com Tue Jun 26 12:32:09 2007 From: david.r.moss at selex-comms.com (david.r.moss@selex-comms.com) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] list construction from std::iterators. In-Reply-To: <20070626154126.GG29591@karelia> Message-ID: Boris, Can you construct a list type using std::iterators (cxx-tree-manual 2.6.3 "Practically, this means that you can treat such a sequence as if it was std::vector"). If not, is there an alternative? I'm using xsd-3.0.0.b2-i686-windows. I don't think this working depends on any command line arguments?! The sequence base class seems to have the required interface but not the list class that derives from it. See attached schema and the following: // Setup some input as a vector. vector v; { v.push_back("one"); v.push_back("two"); } // Standard vector construction from iterators -- ok. vector y( v.begin(), v.end() ); // list-type construction -- not ok; no valid constructor. string_list_t nl( v.begin(), v.end() ); // Especially useful where an object wants the data on construction! object_t o( string_list_t( v.begin(), v.end() ) ); Cheers, Dave. Dave Moss SELEX Communications Grange Road Christchurch Dorset BH23 4JE United Kingdom Tel: + 44 (0) 1202 404841 Email: david.r.moss@selex-comms.com ------------------------------------------------------------ This email and any attached files contains company confidential information which may be legally privileged. It is intended only for the person(s) or entity to which it is addressed and solely for the purposes set forth therein. If you are not the intended recipient or have received this email in error please notify the sender by return, delete it from your system and destroy any local copies. It is strictly forbidden to use the information in this email including any attachment or part thereof including copying, disclosing, distributing, amending or using for any other purpose. In addition the sender excludes all liabilities (whether tortious or common law) for damage or breach arising or related to this email including but not limited to viruses and libel. SELEX Communications Limited is a Private Limited Company registered in England and Wales under Company Number 964533 and whose Registered Office is Marconi House, New Street, CHELMSFORD, Essex. CM1 1PL. England. -------------- next part -------------- A non-text attachment was scrubbed... Name: list-construction-test.xsd Type: application/octet-stream Size: 360 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070626/ad1c6b4c/list-construction-test.obj From boris at codesynthesis.com Tue Jun 26 12:58:08 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Re: list construction from std::iterators. In-Reply-To: References: <20070626154126.GG29591@karelia> Message-ID: <20070626165808.GH29591@karelia> Hi David, david.r.moss@selex-comms.com writes: > The sequence base class seems to have the required interface but not > the list class that derives from it. Actually it is the generated type that inherits from list that does not provide the necessary constructors. I've added this to my TODO list. > // Setup some input as a vector. > vector v; > { > v.push_back("one"); > v.push_back("two"); > } > > // Standard vector construction from iterators -- ok. > vector y( v.begin(), v.end() ); > > // list-type construction -- not ok; no valid constructor. > string_list_t nl( v.begin(), v.end() ); The workaround would be to use assign(): string_list_t nl; nl.assign (v.begin(), v.end()); > // Especially useful where an object wants the data on construction! > object_t o( string_list_t( v.begin(), v.end() ) ); The workaround here is actually faster than the original (less copying): object_t o (string_list_t ()); o.someList ().assign (v.begin(), v.end()); Thanks for reporting this! -boris From samiksha.rajput at tcs.com Wed Jun 27 02:01:16 2007 From: samiksha.rajput at tcs.com (Samiksha Rajput) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] New versions of xsd In-Reply-To: <20070626165808.GH29591@karelia> Message-ID: Hi Boris, I am currently using xsd-2.3.1-hppa-hpux . Can you please tell me the difference in new version of xsd. Also please give me the url for downloading the xsd new versions for following configuration I have HP UX 11.11 and Compiler aCC 3.63 64 bit Please give me advanced suitable xsd version links for download. Thanks and Regards. Samiksha Vijaysinha Rajput Tata Consultancy Services Mailto: samiksha.rajput@tcs.com Website: http://www.tcs.com Boris Kolpackov Sent by: xsd-users-bounces@codesynthesis.com 06/26/2007 10:28 PM To david.r.moss@selex-comms.com cc xsd-users@codesynthesis.com Subject [xsd-users] Re: list construction from std::iterators. Hi David, david.r.moss@selex-comms.com writes: > The sequence base class seems to have the required interface but not > the list class that derives from it. Actually it is the generated type that inherits from list that does not provide the necessary constructors. I've added this to my TODO list. > // Setup some input as a vector. > vector v; > { > v.push_back("one"); > v.push_back("two"); > } > > // Standard vector construction from iterators -- ok. > vector y( v.begin(), v.end() ); > > // list-type construction -- not ok; no valid constructor. > string_list_t nl( v.begin(), v.end() ); The workaround would be to use assign(): string_list_t nl; nl.assign (v.begin(), v.end()); > // Especially useful where an object wants the data on construction! > object_t o( string_list_t( v.begin(), v.end() ) ); The workaround here is actually faster than the original (less copying): object_t o (string_list_t ()); o.someList ().assign (v.begin(), v.end()); Thanks for reporting this! -boris ForwardSourceID:NT00007DEA =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you From boris at codesynthesis.com Wed Jun 27 02:10:41 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Re: New versions of xsd Message-ID: <20070627061041.GI29591@karelia> Hi Samiksha, Samiksha Rajput writes: > I am currently using xsd-2.3.1-hppa-hpux . > Can you please tell me the difference in new version of xsd. > Also please give me the url for downloading the xsd new versions for > following configuration > I have HP UX 11.11 and Compiler aCC 3.63 64 bit XSD-2.3.1 is the latest stable version. The latest beta version (3.0.0.b2) is only available on GNU/Linux and Windows. When we release 3.0.0 (in a couple of weeks, if everything goes well), it will be available on all supported platforms, including HP-UX. hth, -boris From samiksha.rajput at tcs.com Wed Jun 27 02:30:38 2007 From: samiksha.rajput at tcs.com (Samiksha Rajput) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Re: Compilation options -Aa and -AA In-Reply-To: <20070626133854.GD29591@karelia> Message-ID: Hi Boris, Sorry to bother you so much but I still have problem in using the xsd along with my application. As per your below attached solution you suggested that to (re)compile my application with -AA. But as my application is huge and is distributed at various places changing my application will have very huge impact. So is there any older version of xsd tool available with build option as -Aa or which can support the -Aa build option? Or Is there any workaround going on for supporting -Aa building option ? Thanks and Regards. Samiksha Vijaysinha Rajput Tata Consultancy Services Mailto: samiksha.rajput@tcs.com Website: http://www.tcs.com Boris Kolpackov 06/26/2007 07:08 PM To Samiksha Rajput cc xsd-users@codesynthesis.com Subject Re: Compilation options -Aa and -AA Hi Samiksha, Samiksha Rajput writes: > I have one problem in compiling the xsd . > My application needs the -Aa option for the build and xsd requires -AA > option for build . > So in such case can you please tell me how to handle both requirements of > compilation options? XSD requires -AA since this option switches the compiler into ANSI C++ mode. Since -AA only turns additional features compared to -Aa, I suggest that you (re)compile your application with -AA. > I have tried to compile with both options separately and together but in > each case it fails . > When I give both -Aa and -AA options together its giving preference to -AA > and ultimately at run time it fails . Right, HP manual states that executables and libraries compiled with different -A? options are not compatible. > Is it possible for you to provide your contact number? Yes, our contact number is +27 76 1672134 (9:00 - 18:00 GMT+2). Note however that we provide technical support over the phone only for organizations with priority support contracts on commercial basis. If you would like to discuss this further, please contact me off list. hth, -boris ForwardSourceID:NT00007DCA =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you From boris at codesynthesis.com Wed Jun 27 03:18:30 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Re: Compilation options -Aa and -AA Message-ID: <20070627071830.GE22060@karelia> Hi Samiksha, Samiksha Rajput writes: > As per your below attached solution you suggested that to (re)compile my > application with -AA. > But as my application is huge and is distributed at various places > changing my application will have very huge impact. I am not entirely sure, but from the aCC man pages it sounds like all you may need is to recompile your code with -AA instead of -Aa. At least you could give it a try and see if any source code changes are necessary. > So is there any older version of xsd tool available with build option as > -Aa or which can support the -Aa build option? > Or Is there any workaround going on for supporting -Aa building option ? No, I am afraid not. XSD was designed from the beginning to rely on ANSI C++ (that is the reason why it works with such a wide range of C++ compilers). If we change it to support -Aa it will automatically break support for all other compilers. The only other option that I can think of is to use XSD/e[1], our embedded systems offering. I am sure it can work with -Aa in minimal configuration (without STL, etc.). However, XSD/e only supports the stream-oriented C++/Parser mapping. If you would like to explore this venue then I suggest that you read through the Getting Started Guide[2] and see if it will be appropriate for your application: [1] http://www.codesynthesis.com/products/xsde/ [2] http://www.codesynthesis.com/projects/xsde/documentation/cxx/parser/guide/ hth, -boris From steinar at viz.no Wed Jun 27 06:26:39 2007 From: steinar at viz.no (Steinar Rune Eriksen) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Setting xsi:nil=true Message-ID: Hi I am trying to use cxx_tree to generate an element of the type, example How do I do that? I have looked at the ::xsd::cxx::xml::bits::nil<> functions without understanding how to do it. If I use the MemAddress2::type as a template to that function, linking fails. Med vennlig hilsen Steinar Rune Eriksen Email: steinar@viz.no Mob: (+47) 90 52 81 48 Tel: (+47) 55 30 28 38 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 2393 bytes Desc: image002.jpg Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070627/ff7ae507/attachment.jpe From boris at codesynthesis.com Wed Jun 27 07:48:36 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Setting xsi:nil=true In-Reply-To: References: Message-ID: <20070627114836.GH22060@karelia> Hi Steinar, Steinar Rune Eriksen writes: > I am trying to use cxx_tree to generate an element of the type, example > How do I do that? Nillable elements are very rarely used (you are the first person who asked for this) and as a result are not directly supported by XSD. There is, however, a number of ways to work around this limitation. The easy way is only suitable if the MemAddress2 can have an empty value. In other words, the following is legal: If that's the case then you can use the generated code as is. The generated code will map both the empty value and the nil value cases to the same instance with empty value (XSD-generated code simply ignores the xsi:nil attribute). You can distinguish between the two by either using the DOM association feature or using type customization, as described below. The more elaborate way, that will work for any type, is to customize the generated type for MemAddress2 and to check for the xsi:nil attribute in the parsing constructor. For more information on type customization see: http://wiki.codesynthesis.com/Tree/Customization_guide For an idea about customizing the parsing constructor see the wildcard example in examples/cxx/tree/custom/wildcard/. hth, -boris From samiksha.rajput at tcs.com Thu Jun 28 00:45:11 2007 From: samiksha.rajput at tcs.com (Samiksha Rajput) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Re: Compilation options -Aa and -AA In-Reply-To: <20070627071830.GE22060@karelia> Message-ID: Hi Boris, As per your advice that we need to recompile our code components with -AA option but the problem in this is it will have huge impact and its a huge distributed model and hence changing it at my side will have impact at different sides , which is not manageable. So can support group provide us any solution for compiling xsd tool with -Aa option. Or can you give us how can we make the changes in xsd tool so that we can compile it with -Aa option and can you tell us what are the components that need to be changed or affected by this shift from -AA to -Aa compilation option. Thanks and Regards. Samiksha Vijaysinha Rajput Tata Consultancy Services Mailto: samiksha.rajput@tcs.com Website: http://www.tcs.com Boris Kolpackov 06/27/2007 12:48 PM To Samiksha Rajput cc xsd-users@codesynthesis.com Subject Re: Compilation options -Aa and -AA Hi Samiksha, Samiksha Rajput writes: > As per your below attached solution you suggested that to (re)compile my > application with -AA. > But as my application is huge and is distributed at various places > changing my application will have very huge impact. I am not entirely sure, but from the aCC man pages it sounds like all you may need is to recompile your code with -AA instead of -Aa. At least you could give it a try and see if any source code changes are necessary. > So is there any older version of xsd tool available with build option as > -Aa or which can support the -Aa build option? > Or Is there any workaround going on for supporting -Aa building option ? No, I am afraid not. XSD was designed from the beginning to rely on ANSI C++ (that is the reason why it works with such a wide range of C++ compilers). If we change it to support -Aa it will automatically break support for all other compilers. The only other option that I can think of is to use XSD/e[1], our embedded systems offering. I am sure it can work with -Aa in minimal configuration (without STL, etc.). However, XSD/e only supports the stream-oriented C++/Parser mapping. If you would like to explore this venue then I suggest that you read through the Getting Started Guide[2] and see if it will be appropriate for your application: [1] http://www.codesynthesis.com/products/xsde/ [2] http://www.codesynthesis.com/projects/xsde/documentation/cxx/parser/guide/ hth, -boris ForwardSourceID:NT00007E1A =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you From boris at codesynthesis.com Thu Jun 28 02:45:21 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Re: Compilation options -Aa and -AA In-Reply-To: References: <20070627071830.GE22060@karelia> Message-ID: <20070628064521.GA24899@karelia> Hi Samiksha, Samiksha Rajput writes: > So can support group provide us any solution for compiling xsd tool with > -Aa option. I was reading through an HP article[1] on -AA and one way that might work is to use STLPort alongside the old C++ library included with -Aa. This way there shouldn't be any conflicts between the libraries (this is what causes problems when you mix -AA and -Aa code) while your old code will use old C++ library and the XSD-generated code and runtime will use ANSI STL/iostream provided by STLPort. [1] http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=e8089099cee021109099cee02110275d6e10RCRD hth, -boris From steinar at viz.no Thu Jun 28 03:49:00 2007 From: steinar at viz.no (Steinar Rune Eriksen) Date: Sun Oct 11 15:33:57 2009 Subject: SV: [xsd-users] Setting xsi:nil=true References: <20070627114836.GH22060@karelia> Message-ID: Thank you for the feedback. I will look into the example for how to create custom validation. My initial problem was however how to actually create documents with this attribute. Example Looking at the I am constructing the XML by creating elements MyMessage::ChildElement::type childElement("Content String"); (.. etc constructing the MyMessage with childElement in constructor) If I wanted to specify a NULL value instead for ChildElement, this is where my problems are. Is there anyway to get access to the xerces Dom model during construction of the tree? Then I could manually add the xsi:nil part. I have tried the following: MyMessage::ChildElement::type childElement; xercesc::DOMNode* n = childElement._node(); // FAILS here since n is NULL when returned from _node() if(n->getNodeType() == xercesc::DOMNode::ELEMENT_NODE){ xercesc::DOMElement* xelTest = (xercesc::DOMElement*)n; xelTest ->setAttribute(std::c2w("xsi:nil").c_str(), std::s2w("true").c_str()); } ________________________________ Fra: Boris Kolpackov [mailto:boris@codesynthesis.com] Sendt: on 27.06.2007 13:48 Til: Steinar Rune Eriksen Kopi: xsd-users@codesynthesis.com Emne: Re: [xsd-users] Setting xsi:nil=true Hi Steinar, Steinar Rune Eriksen writes: > I am trying to use cxx_tree to generate an element of the type, example > How do I do that? Nillable elements are very rarely used (you are the first person who asked for this) and as a result are not directly supported by XSD. There is, however, a number of ways to work around this limitation. The easy way is only suitable if the MemAddress2 can have an empty value. In other words, the following is legal: If that's the case then you can use the generated code as is. The generated code will map both the empty value and the nil value cases to the same instance with empty value (XSD-generated code simply ignores the xsi:nil attribute). You can distinguish between the two by either using the DOM association feature or using type customization, as described below. The more elaborate way, that will work for any type, is to customize the generated type for MemAddress2 and to check for the xsi:nil attribute in the parsing constructor. For more information on type customization see: http://wiki.codesynthesis.com/Tree/Customization_guide For an idea about customizing the parsing constructor see the wildcard example in examples/cxx/tree/custom/wildcard/. hth, -boris From boris at codesynthesis.com Thu Jun 28 04:22:22 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Setting xsi:nil=true In-Reply-To: References: <20070627114836.GH22060@karelia> Message-ID: <20070628082222.GC24899@karelia> Hi Steinar, Steinar Rune Eriksen writes: > My initial problem was however how to actually create documents with > this attribute. > > Example > > > > I see. I think the easiest way is to use type customization and "override" the serialization operator to set this attribute if the value is NULL. The wildcard example in examples/cxx/tree/custom/wildcard/ shows how to do that as well. One way to wrap this all nicely is to make your custom type a "smart pointer" for the original type, so that when xsi:nil is set to true, the value of the pointer is 0, and when the value of the pointer is 0, the serialization operator sets xsi:nil. Here is the outline of this approach. Let's say the type for ChildElement is ChildType. As in the wildcard example we will generate the original type, but will name it ChildTypeImpl (in the wildcard example it is called date_base). So we will use this option: --custom-type ChildType=/ChildTypeImpl Then we provide implementation for ChildType which is a smart pointer for ChildTypeImpl (pseudo-code): class ChildType: xml_schema::type { public: ~ChildType () { delete impl_; } // Parsing c-tor. // ChildType (const DOMElement& e) : impl_ (0) { if (!xsi_nil_set (e)) { impl_ = new ChildTypeImpl (e); } } ChildTypeImpl* operator-> () { return impl_; } ChildTypeImpl& operator* () { return *impl_; } bool is_nil () const { return impl_ == 0; } private: ChildTypeImpl* impl_; }; // Serialization operator. // void operator<< (DOMElement& e, const ChildType& x) { if (x.is_nil ()) { // set xsi:nil } else { s << *x; } } > If I wanted to specify a NULL value instead for ChildElement, this is > where my problems are. Is there anyway to get access to the xerces > Dom model during construction of the tree? Then I could manually add > the xsi:nil part. Yes, that would be the serialization operator. > I have tried the following: > > MyMessage::ChildElement::type childElement; > > xercesc::DOMNode* n = childElement._node(); > > // FAILS here since n is NULL when returned from _node() Right, _node() returns a DOM node that was associated with this tree node during parsing. Since you are constructing the tree from scratch, there is no DOM association. hth, -boris From kroiz at hyperroll.com Thu Jun 28 05:50:10 2007 From: kroiz at hyperroll.com (Kroizman Guy) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Re: Compilation options -Aa and -AA In-Reply-To: <20070628064521.GA24899@karelia> References: <20070627071830.GE22060@karelia> <20070628064521.GA24899@karelia> Message-ID: <1183024210.23486.2.camel@localhost.localdomain> When we add a compilation flag that conflicted we simply moved the generated code from the xsd to another library. wont that help Samiksha Rajput too? On Thu, 2007-06-28 at 08:45 +0200, Boris Kolpackov wrote: > Hi Samiksha, > > Samiksha Rajput writes: > > > So can support group provide us any solution for compiling xsd tool with > > -Aa option. > > I was reading through an HP article[1] on -AA and one way that might work > is to use STLPort alongside the old C++ library included with -Aa. This > way there shouldn't be any conflicts between the libraries (this is what > causes problems when you mix -AA and -Aa code) while your old code will > use old C++ library and the XSD-generated code and runtime will use ANSI > STL/iostream provided by STLPort. > > [1] http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=e8089099cee021109099cee02110275d6e10RCRD > > hth, > -boris > From boris at codesynthesis.com Thu Jun 28 06:23:09 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Re: Compilation options -Aa and -AA In-Reply-To: <1183024210.23486.2.camel@localhost.localdomain> References: <20070627071830.GE22060@karelia> <20070628064521.GA24899@karelia> <1183024210.23486.2.camel@localhost.localdomain> Message-ID: <20070628102309.GB25278@karelia> Hi, Kroizman Guy writes: > When we add a compilation flag that conflicted we simply moved the > generated code from the xsd to another library. > wont that help Samiksha Rajput too? Unfortunately this won't work for Samiksha's case. The two options (-Aa and -AA) trigger linking to different versions of the C++ library which are incompatible. These libraries cannot coexist in the same process so this rules out factoring out to a static or dynamic library. According to HP, the only way to make two sets of code one compiled with -Aa and the other with -AA work together is to put them in separate processes. hth, -boris From jerome.martinet at mpsa.com Thu Jun 28 07:21:24 2007 From: jerome.martinet at mpsa.com (jerome.martinet@mpsa.com) Date: Sun Oct 11 15:33:57 2009 Subject: =?ISO-8859-1?Q?R=E9f=2E_=3A_Re=3A_[xsd-users]_help_about_XSD?= In-Reply-To: <20070611143010.GA23782@karelia> Message-ID: Hi, My project is now finish , thanks for you help (my metamodel was too difficult I think for a first project with your software but with a lot of effort I reach my goal). I can rebuild the XML (elements I need) with the code. Now I have to explain what I have done ! That's why I'm looking explanations : how , with xerces help , the util can build c++ code. Have you some informations to help me ? I'm looking for diagramms for example on theory. I haven't found any on your website thanks J?r?me Boris Kolpackov Pour jerome.martinet@mpsa.com 11/06/2007 16:30 cc xsd-users@codesynthesis.com Objet Re: [xsd-users] help about XSD Hi J?r?me, jerome.martinet@mpsa.com writes: > I'm working on a project named Autosar. I have the XSD file (which you can > find here :http://autosar.org/download/AUTOSAR_xsd.zip) and I want to > generate C++ code using your tools XSD with Visual studio 2005 express. Uh, quite a big schema. > > I generated the code but I can't access to elements I need > (ATOMiC-SOFTWARE-COMPONENT for example) > > I have a constructor on the class AUTOSAR but nothing on ELEMENTS , how can > I use a link between this two elements ? The root element of your vocabulary is element AUTOSAR and its type is AUTOSAR. So you get an instance of this type AUTOSAR when you parse you XML document, e.g., using namespace NS_AUTOSAR; std::auto_ptr autosar (AUTOSAR_ ("autosar.xml")); Looking at the definition of type AUTOSAR in the schema we see that its content is defined as a reference to a group (xsd:group) named AUTOSAR. When a group is referenced somewhere in the schema it is as if the contents of the group were copied to the place of reference. So we look at the AUTOSAR group and see that it contains a single optional (minOccurs="0") element TOP-LEVEL-PACKAGES. Since this element is optional, the generated code will follow the rules for the optional cardinality class as described in the manual. So we can test for presence of this element and get its content like so: if (autosar->TOP_LEVEL_PACKAGES ().present ()) { TOP_LEVEL_PACKAGES& tlp = autosar->TOP_LEVEL_PACKAGES ().get (); Looking at the type for TOP-LEVEL-PACKAGES we see that it is a sequence of AR-PACKAGE elements of type AR-PACKAGE. To iterate over them we can do this: TOP_LEVEL_PACKAGES::AR_PACKAGE::container& c = tlp.AR_PACKAGE (); for (TOP_LEVEL_PACKAGES::AR_PACKAGE::iterator i (c.begin ()); i != c.end (); ++i) { AR_PACKAGE& arp = *i; } } Next you can figure out the contents of AR_PACKAGE, etc. You can also look into the generated header file to figure out to which cardinality class a particular element belongs if it is not immediately obvious from studying the schema. hth, -boris [rattachement "signature.asc" supprim? par JEROME MARTINET - U278752/users/PSA] From boris at codesynthesis.com Thu Jun 28 08:37:13 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: =?iso-8859-1?B?Uulm?= =?iso-8859-1?Q?=2E?= : Re: [xsd-users] help about XSD In-Reply-To: References: <20070611143010.GA23782@karelia> Message-ID: <20070628123713.GC25278@karelia> Hi Jerome, jerome.martinet@mpsa.com writes: > Now I have to explain what I have done ! That's why I'm looking > explanations : how , with xerces help , the util can build c++ code. > Have you some informations to help me ? I'm looking for diagramms for > example on theory. I haven't found any on your website I don't quite understand what you are asking for. Do you want more information on how XSD compiles XML Schemas to C++? If so, I am not sure there is any theory to it besides standard compiler design stuff. I also don't understand why would you want to know this besides simple curiosity. hth, -boris From a.keutterling at geosystems.de Thu Jun 28 06:10:48 2007 From: a.keutterling at geosystems.de (A. Keutterling, GEOSYSTEMS) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] support needed Message-ID: <46838928.7070800@geosystems.de> Hello Support team, Currently I try out your XML-binding mechanism. I am really surprised how simple it appears to read a xml file. On the other hand it seems to me I have forgotten something in my workflow. Can you show me what's missing. Here is my code fragment: void DialogController::Test_ReadProject() { std::ifstream ifs ("D:/IDK/designs/INTERFEROMETRY/XML/Beispiel_validiert.xml"); auto_ptr ptr = ORIDATA_ID (ifs); }; All I did in my VS project was linking against xerces-c_2D.lib. The error message is o:\sources_imagine\interferometry\dialogController.cpp(1297): error C2065: 'ORIDATA_ID' : undeclared identifier o:\sources_imagine\interferometry\dialogController.cpp(1297): error C2955: 'std::auto_ptr' : use of class template requires template argument list C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\include\memory(518) : see declaration of 'std::auto_ptr' o:\sources_imagine\interferometry\dialogController.cpp(1297): error C3861: 'ORIDATA_ID': identifier not found, even with argument-dependent lookup o:\sources_imagine\interferometry\dialogController.cpp(1297): error C2514: 'std::auto_ptr' : class has no constructors C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\include\memory(518) : see declaration of 'std::auto_ptr' o:\sources_imagine\interferometry\dialogController.cpp(1297): error C2262: 'ptr' : cannot be destroyed How can I make the data binding compiler run? Best regards, Andreas -- Andreas Keutterling Software-Entwicklung Software Development ---------------------------------------------------------------------- GEOSYSTEMS GmbH Riesstra?e 10, 82110 Germering, GERMANY www.geosystems.de E: a.keutterling@geosystems.de T: +49 - (0)89 - 89 43 43 0 (Ext. 19) F: +49 - (0)89 - 89 43 43 99 ---------------------------------------------------------------------- Abonnieren Sie unseren Newsletter, um immer auf dem Laufenden zu sein: www.geosystems.de/newsletter -------------- next part -------------- A non-text attachment was scrubbed... Name: Beispiel_validiert.xml Type: text/xml Size: 4381 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070628/3b7a7434/Beispiel_validiert.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Beispiel_validiert.xsd Type: text/xml Size: 11360 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070628/3b7a7434/Beispiel_validiert-0001.bin From boris at codesynthesis.com Thu Jun 28 09:18:52 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] support needed In-Reply-To: <46838928.7070800@geosystems.de> References: <46838928.7070800@geosystems.de> Message-ID: <20070628131852.GD25278@karelia> Hi Andreas, A. Keutterling, GEOSYSTEMS writes: > Currently I try out your XML-binding mechanism. I am really surprised > how simple it appears to read a xml file. On the other hand it seems to > me I have forgotten something in my workflow. Can you show me what's > missing. Here is my code fragment: > > void DialogController::Test_ReadProject() > { > std::ifstream ifs > ("D:/IDK/designs/INTERFEROMETRY/XML/Beispiel_validiert.xml"); > auto_ptr ptr = ORIDATA_ID (ifs); > > }; I think you did not provide a correct type in the auto_ptr declaration. I suggest that you do the following: 1. Compile your schema with the --morph-anonymous option (unless you are using one of the betas for 3.0.0). 2. Include the generated header file into your dialogController.cpp 3. Change your code to read like this: auto_ptr ptr = ORIDATA_ID_ (ifs); Here ORIDATA_ID is the type for the root element in your schema and ORIDATA_ID_ is the corresponding parsing function (its name is escaped with the trailing '_' to avoid the conflict with the type name). hth, -boris From Ryan.Prather at afspc.af.mil Thu Jun 28 14:48:13 2007 From: Ryan.Prather at afspc.af.mil (Prather, Ryan C SSgt DMSG/WMTS) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] examples Message-ID: The library example that is included with the current XSD build is closer to the implementation that I am trying to build. The problem is that when the library example was created it has the "library-parser.hxx" and "library-parser-templates.hxx" files. I tried to find any options to the XSD program to build those additional files. The only thing that I thought might work was "--generate-validation", but it didn't work. The probably is that I have several levels of hierarchy and I need to make sure that these get populated correctly. If anybody has any ideas it would be appreciated. Thanks. Ryan From tyrecius13 at yahoo.com Fri Jun 29 04:23:43 2007 From: tyrecius13 at yahoo.com (Jon D) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Lines numbers after parsing Message-ID: <192640.48013.qm@web54604.mail.re2.yahoo.com> Hi, I'm looking into using the C++/Tree xsd parser for configuration files. It does prevent many of the awkward error-prone code that you often have to write in C++ to manage the parser. I still have one serious reservation that I was hoping that y'all might help me resolve. In my particular case, the configuration files are hand-crafted and modified. And others, perhaps with no computer programming experience, might need to modify them in the future. Given this, good error messages are crucial. Looking over the error-handling documentation for C++/Tree, it seems that it does or soon will perform all of the syntactic checking necessary. My problem comes when I want to do semantic checks after the parsing is done. At that point, all of the diagnostic information (line numbers, and the text of the lines themselves) seems to disappear. This information is a crucial pre-condition if I want to give helpful error messages. The question is, how do I get line numbers after parsing is done? If I can't, how hard would it be to modify the compiler to save that information and make it available? Thanks for any help. I have searched through the mailing-list, the wiki, and the documenation and I can't find a mention of this issue. To conclude, here is a simple motivating example of the kinds of errors that I would like to print out: Suppose I wanted to do a simple html-like language with style-sheets. I might have documents that have elements like:

Some text

And I might have stylesheets that have elements that look like this: Now the semantic error that I'm talking about is when a class used in the document file doesn't match a class defined in the stylesheet file. Both files would parse successfully. But after I created a table of class names, one of the lookups would fail. And when that happens, I'd like to be able to print out something like: Line 37: "

" tag uses non-existant class "foo":

Some text

Thanks again for any help. -D --------------------------------- Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. From boris at codesynthesis.com Fri Jun 29 06:50:11 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] examples In-Reply-To: References: Message-ID: <20070629105011.GD32198@karelia> Hi Ryan, Prather, Ryan C SSgt DMSG/WMTS writes: > The library example that is included with the current XSD build is > closer to the implementation that I am trying to build. The problem is > that when the library example was created it has the > "library-parser.hxx" and "library-parser-templates.hxx" files. I tried > to find any options to the XSD program to build those additional files. The library-parser-templates.hxx and library-parser-templates.txx files are generated by XSD. Normally when you compile a schema in the form library.xsd, the generated parser template files are in the form library.hxx and library.txx. This example changes their names to library-parser-templates.hxx and library-parser-templates.txx using the "--hxx-suffix -parser-template.hxx" and "-txx-suffix -parser-template.txx" options. The library-parser.hxx file is hand-written and contains parser implementations. BTW, the README file in the example directory describes the origin and purpose of each file. > The only thing that I thought might work was "--generate-validation", > but it didn't work. The probably is that I have several levels of > hierarchy and I need to make sure that these get populated correctly. > If anybody has any ideas it would be appreciated. If you are considering using the C++/Parser mapping, I strongly recommend that you upgrade to the latest beta for 3.0.0 (the release should be out in a couple of weeks). In this release, the C++/Parser mapping was significantly redesigned so the architecture in 2.x.y series is essentially a dead end. The new version has a much better documentation (can be found in documentation/cxx/parser/guide/ directory of XSD distribution). It also has a new feature that allows you to auto-generate a sample parser implementation and a test driver for your vocabulary. hth, -boris From boris at codesynthesis.com Fri Jun 29 07:29:22 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Lines numbers after parsing In-Reply-To: <192640.48013.qm@web54604.mail.re2.yahoo.com> References: <192640.48013.qm@web54604.mail.re2.yahoo.com> Message-ID: <20070629112922.GE32198@karelia> Hi Jon, Jon D writes: > My problem comes when I want to do semantic checks after the parsing > is done. At that point, all of the diagnostic information (line > numbers, and the text of the lines themselves) seems to > disappear. This information is a crucial pre-condition if I want to > give helpful error messages. > > The question is, how do I get line numbers after parsing is done? If I > can't, how hard would it be to modify the compiler to save that > information and make it available? The most natural way to access this information if by using the DOM association. This feature allows you to keep the DOM tree of your XML document around. You can call the _node () function on a C++/Tree node and get the corresponding DOM node. From there you can get the actual element/attribute name (those are not kept in the C++/Tree nodes) as well as possibly reconstruct the XML fragment to show to the user. Line and column numbers pose a bit of a problem since Xerces-C++ DOM tree does not store them (for practical reasons). This, however, is relatively easy to overcome by customizing the XercesDOMParser and storing the line/column information as user data. One example of this approach is available in the Xerces-C++ mailing list archives: http://marc.info/?l=xerces-c-users&m=115531248220918&w=2 It is a bit convoluted and can be significantly simplified if you don't need to keep the file information with each node (in that case you can just store line and column numbers directly as void* and get rid of all the allocations, etc.). If you are interested, I can post a simpler version here. If you are using the custom DOM parser, you will need to set up your own XML-DOM stage. This is described in the Wiki FAQ Section 2, "Parsing": http://wiki.codesynthesis.com/Tree/FAQ For more information about the DOM association feature, see the "mixed" example in examples/cxx/tree/mixed/ as well as the Section 3.2, "Flags and Properties" in the C++/Tree Mapping User Manual: http://codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#3.2 hth, -boris From Ryan.Prather at afspc.af.mil Fri Jun 29 11:02:40 2007 From: Ryan.Prather at afspc.af.mil (Prather, Ryan C SSgt DMSG/WMTS) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] examples In-Reply-To: <20070629105011.GD32198@karelia> References: <20070629105011.GD32198@karelia> Message-ID: Great. We are primarily deploying to Sun...is there going to be a 3.0 release version for Sun? If not will the Linux version work on Solaris 10? Also I am getting the following compile time error Creating DataSet class using XSD ... error: unknown command '/nologo' info: try 'xsd help' for the list of commands 'cl' is not recognized as an internal or external command, operable program or batch file. I went in and turn "off" the "/nologo" flag in all locations in the project, but still get the same error...here is the command argument that VS generates. xsd /nologo /d /l:"Microsoft.MCpp.MCppCodeProvider, MCppCodeDomProvider, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, Custom=null" /namespace:Data .\Data.xsd cl /nologo /TP /FU System.dll /FU System.XML.dll /FU System.Data.dll "Data.h" /clr /Fo"Debug" /link /dll /out:"Data.dll" Any suggestions? Thanks. Ryan -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Friday, June 29, 2007 4:50 AM To: Prather, Ryan C SSgt DMSG/WMTS Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] examples Hi Ryan, Prather, Ryan C SSgt DMSG/WMTS writes: > The library example that is included with the current XSD build is > closer to the implementation that I am trying to build. The problem is > that when the library example was created it has the > "library-parser.hxx" and "library-parser-templates.hxx" files. I > tried to find any options to the XSD program to build those additional files. The library-parser-templates.hxx and library-parser-templates.txx files are generated by XSD. Normally when you compile a schema in the form library.xsd, the generated parser template files are in the form library.hxx and library.txx. This example changes their names to library-parser-templates.hxx and library-parser-templates.txx using the "--hxx-suffix -parser-template.hxx" and "-txx-suffix -parser-template.txx" options. The library-parser.hxx file is hand-written and contains parser implementations. BTW, the README file in the example directory describes the origin and purpose of each file. > The only thing that I thought might work was "--generate-validation", > but it didn't work. The probably is that I have several levels of > hierarchy and I need to make sure that these get populated correctly. > If anybody has any ideas it would be appreciated. If you are considering using the C++/Parser mapping, I strongly recommend that you upgrade to the latest beta for 3.0.0 (the release should be out in a couple of weeks). In this release, the C++/Parser mapping was significantly redesigned so the architecture in 2.x.y series is essentially a dead end. The new version has a much better documentation (can be found in documentation/cxx/parser/guide/ directory of XSD distribution). It also has a new feature that allows you to auto-generate a sample parser implementation and a test driver for your vocabulary. hth, -boris From boris at codesynthesis.com Fri Jun 29 13:48:15 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] examples In-Reply-To: References: <20070629105011.GD32198@karelia> Message-ID: <20070629174815.GI32198@karelia> Hi Ryan, Prather, Ryan C SSgt DMSG/WMTS writes: > Great. We are primarily deploying to Sun...is there going to be a 3.0 > release version for Sun? If not will the Linux version work on Solaris > 10? The final release will be test on and have binaries for Solaris. > Also I am getting the following compile time error > > Creating DataSet class using XSD ... > error: unknown command '/nologo' > info: try 'xsd help' for the list of commands > 'cl' is not recognized as an internal or external command, > operable program or batch file. > > ... > > xsd /nologo /d /l:"Microsoft.MCpp.MCppCodeProvider, MCppCodeDomProvider, > Version=7.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, > Custom=null" /namespace:Data .\Data.xsd > cl /nologo /TP /FU System.dll /FU System.XML.dll /FU System.Data.dll > "Data.h" /clr /Fo"Debug" /link /dll /out:"Data.dll" When you add a schema file to your project, Visual Studio assumes you want it compiled with their .NET data binding tool and generates the above command line. You will need to change this by right-clicking on the schema file in Visual Studio, selecting properties, and setting a custom build step for it. You will need to provide the new command line which should look along these lines: xsd cxx-parser your-schema.xsd as well as the output files (for 3.0.0 they will be in the form: your-schema-pskel.hxx and your-schema-pskel.cxx). You can look into one of the examples in examples/cxx/parser/ for ideas. Alternatively (or at the beginning) you can compile your schemas manually from the command prompt without involving the IDE. hth, -boris From Ryan.Prather at afspc.af.mil Sat Jun 30 10:44:41 2007 From: Ryan.Prather at afspc.af.mil (Prather, Ryan C SSgt DMSG/WMTS) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] examples In-Reply-To: <20070629174815.GI32198@karelia> References: <20070629105011.GD32198@karelia> <20070629174815.GI32198@karelia> Message-ID: Ok, got that. Now I am having a problem with the rest of the compiling. I am getting 23 errors. It is saying "type_pimpl", "type_pskel", and the "global namespace" "is not a member of xml_schema". Any suggestions? Thanks. Ryan -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Friday, June 29, 2007 11:48 AM To: Prather, Ryan C SSgt DMSG/WMTS Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] examples Hi Ryan, Prather, Ryan C SSgt DMSG/WMTS writes: > Great. We are primarily deploying to Sun...is there going to be a 3.0 > release version for Sun? If not will the Linux version work on > Solaris 10? The final release will be test on and have binaries for Solaris. > Also I am getting the following compile time error > > Creating DataSet class using XSD ... > error: unknown command '/nologo' > info: try 'xsd help' for the list of commands 'cl' is not recognized > as an internal or external command, operable program or batch file. > > ... > > xsd /nologo /d /l:"Microsoft.MCpp.MCppCodeProvider, > MCppCodeDomProvider, Version=7.0.5000.0, Culture=neutral, > PublicKeyToken=b03f5f7f11d50a3a, Custom=null" /namespace:Data > .\Data.xsd cl /nologo /TP /FU System.dll /FU System.XML.dll /FU > System.Data.dll "Data.h" /clr /Fo"Debug" /link /dll /out:"Data.dll" When you add a schema file to your project, Visual Studio assumes you want it compiled with their .NET data binding tool and generates the above command line. You will need to change this by right-clicking on the schema file in Visual Studio, selecting properties, and setting a custom build step for it. You will need to provide the new command line which should look along these lines: xsd cxx-parser your-schema.xsd as well as the output files (for 3.0.0 they will be in the form: your-schema-pskel.hxx and your-schema-pskel.cxx). You can look into one of the examples in examples/cxx/parser/ for ideas. Alternatively (or at the beginning) you can compile your schemas manually from the command prompt without involving the IDE. hth, -boris From boris at codesynthesis.com Sat Jun 30 13:16:12 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] examples In-Reply-To: References: <20070629105011.GD32198@karelia> <20070629174815.GI32198@karelia> Message-ID: <20070630171612.GA6706@karelia> Hi Ryan, Prather, Ryan C SSgt DMSG/WMTS writes: > Ok, got that. Now I am having a problem with the rest of the compiling. > I am getting 23 errors. It is saying "type_pimpl", "type_pskel", and > the "global namespace" "is not a member of xml_schema". Any > suggestions? The "type_pimpl" and "type_pskel" "is not a member of xml_schema" error is due to your schema using anyType. We are going to provide skeleton and implementation for this type in the final release. Most of the time you get this type assigned to an element when you forget the type="" attribute (XSD warns about an element being implicitly of anyType). If that's the case and you don't really mean to use anyType in your schema, then you can get rid of this problem by adding the type="" attribute to the element(s). I am not sure about the "global namespace" part. Can you provide the complete error message as well as the code fragment it points to? thanks, -boris