From boris at codesynthesis.com Wed Aug 1 06:25:27 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] XSD 3.0.0 released Message-ID: <20070801102527.GB8604@karelia> Hi, We have released XSD 3.0.0. This is a major release which includes a number of backwards-incompatible changes with respect to the XSD-2.3 series. The NEWS file entries for this release 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. * A number of bugs fixed in both C++/Tree and C++/Parser mappings. C++/Tree * The new C++/Tree Mapping Getting Started Guide is available in the documentation/cxx/tree/guide/ directory. * 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 name 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 application code adjustments (the C++ compiler will pinpoint the affected places). * New option, --generate-doxygen, triggers generation of documentation comments suitable for extraction by the Doxygen documentation system. Documentation from annotations is added to the comments if present in the schema. * 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 the RPC XDR binary stream in addition to ACE CDR. * 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 ownership of the DOM document being parsed when DOM association is requested (keep_dom flag). See the C++/Tree Mapping User Manual for more information. * New example, multiroot, shows how to handle XML vocabularies with multiple root elements. * New example, caching, shows how to parse several XML documents while reusing the underlying XML parser and caching the schemas used for validation. * 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. * Optimizations for the generated code size and compilation time, including space optimizations for polymorphic parsing and serialization. Optimizations for XML parsing speed. 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, "Built-In XML Schema Type Parsers" 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 option 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. * New example, wildcard, shows how to parse the XML data matched by XML Schema wildcards (any and anyAttribute). * The xml_schema::document parser has been extended with overridable virtual functions start_root_element and end_root_element to support parsing of XML vocabularies with multiple document roots. See the multiroot example in the example/cxx/parser/ directory for more information. * 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 David Moss Jon D Matt Burnham Shiva Balasubramanyam James Frullo 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: e2289e4407cbb0507604107012216ad74abb3379 xsd-3.0.0.tar.bz2 338729e6c750380818764dc6a48422919dfbc53e xsd-3.0.0-powerpc-aix.tar.gz 8e273ce0557625384df067aa6d2d2f4757bc48ed xsd_3.0.0-1_i386.deb 10110278c56acbd75ed3c4756860d387b34b929d xsd-3.0.0-1.i686.rpm dcdd636d52e62ce209e006cb50d8e6c26abfca8d xsd-3.0.0-i686-linux-gnu.tar.bz2 4eb3400c94c3c0b1c88120f88b6709a2e8bd0310 xsd_3.0.0-1_amd64.deb 3417476fae1f05955a66a190ef8eb86e93850dd7 xsd-3.0.0-1.x86_64.rpm 1df636cca463e24fbdf3c08c49489267c44aa35f xsd-3.0.0-x86_64-linux-gnu.tar.bz2 978a34dd146d8eb337f1ff8154d16dd86792daa8 xsd-3.0.0-powerpc-linux-gnu.tar.bz2 fa04a8b0e72e6046aa8a13e9f14c1062294d4f20 xsd-3.0.0-ia64-linux-gnu.tar.bz2 e13e239610f888d7f56dce2ecfa2c30a23f343e0 xsd-3.0.0-hppa-hpux.tar.gz f52651c56b2750d76fc81d6cecacd2acf12e4f6c xsd-3.0.0-hppa-hpux.tar.bz2 3591d76a8515ffe1a644ac4708ba56559e8118fc xsd-3.0.0-powerpc-macosx.tar.bz2 659b86160677f8c42bc6b7f41942859b674ecd3a xsd-3.0.0-sparc-solaris.tar.gz 981aff54149a459c3d4b7d29af0fd7d383eb49b2 xsd-3.0.0-sparc-solaris.tar.bz2 3e0130bc28f3730a21a48f98cf252422720552c5 xsd-3.0.0-i686-solaris.tar.gz 97c74e5533033b998b1ae2d7b0260eec41e785d1 xsd-3.0.0-i686-solaris.tar.bz2 04fd710df68dfa4f94d61f9a9c6a09c9e1bf842f xsd-3.0.0-i686-windows.zip 69ce99e13d02352de34d28b486ce8bc4cb39ea30 xsd-3.0.msi Enjoy, -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/20070801/d2b443e8/attachment.pgp From sbalasub at qualcomm.com Fri Aug 10 01:48:54 2007 From: sbalasub at qualcomm.com (Balasubramanyam, Shivakumar) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Custom Serializer Message-ID: Hi, I understand that XSD provides XML, ACE and XDR serialization. Does it also support providing our custom serializable library? Thanks, Shiva From boris at codesynthesis.com Fri Aug 10 02:55:04 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Custom Serializer In-Reply-To: References: Message-ID: <20070810065504.GA27561@karelia> Hi Shiva, Balasubramanyam, Shivakumar writes: > I understand that XSD provides XML, ACE and XDR serialization. > > Does it also support providing our custom serializable library? Yes, you can add support for your own representation streams by implementing insertion/extraction for fundamental types and then using the --generate-insertion and --generate-extraction options to generate insertion operators and extraction constructors for your streams. For an example on how to implement insertion/extraction for fundamental types, see the following files in libxsd/xsd/cxx/tree: ace-cdr-stream-insertion.hxx ace-cdr-stream-extraction.hxx xdr-stream-insertion.hxx xdr-stream-extraction.hxx For more information on the --generate-insertion and --generate-extraction options, see the XSD Compiler Command Line Manual: http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml Let me know if you have any problems. Boris From sbalasub at qualcomm.com Fri Aug 10 04:13:49 2007 From: sbalasub at qualcomm.com (Balasubramanyam, Shivakumar) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Errors obtained when parsing from istringstream Message-ID: Hi, I have a case where the parsing works fine when I use the file URI but fails with a lot of error messages specifying the following, An runtime exception occurred for all the schemas that was included using the relative path. The error is (The primary document entity could not be opened ../) Any ideas? I read the following from the user manual but could not understand what and how to specify the resource id as? 3.5 Reading from std::istream When using an std::istream instance, you may also pass an optional resource id. This id is used to identify the resource (for example in error messages) as well as to resolve relative paths. For instance: using std::auto_ptr; { std::ifstream ifs ("test.xml"); auto_ptr r (name (ifs, "test.xml")); } { std::string str ("..."); // Some XML fragment. std::istringstream iss (str); auto_ptr r (name (iss)); } Thanks, Shiva From boris at codesynthesis.com Fri Aug 10 04:28:57 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Errors obtained when parsing from istringstream In-Reply-To: References: Message-ID: <20070810082857.GB27561@karelia> Hi Shiva, Balasubramanyam, Shivakumar writes: > I have a case where the parsing works fine when I use the file URI but > fails with a lot of error messages specifying the following, You mean it fails when you parse something other than a file URI? Are you parsing a stream? The schema path specified in the XML document are treated as relative to the document itself unless they are absolure URIs (that is start with http://, file://, etc). If you are parsing a stream, then you will need to specify some (perhaps non-existent) path as a resource id in order to allow the parser to locate the schemas. Alternatively you can override the schema locations specified in the XML document with your own paths. For more information on this topic see: Section 5.1, "XML Schema Validation and Searching" in the C++/Tree Mapping Getting Started Guide: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#5.1 hth, -boris From sbalasub at qualcomm.com Tue Aug 14 01:43:26 2007 From: sbalasub at qualcomm.com (Balasubramanyam, Shivakumar) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] xsd::date Message-ID: Hi, I understand that the xsd::date is mapped to a C++ std::string. I am looking for an easier access to various elements of a date item. Is there one already or do we have to do use something like boost::Gregorian_date as nicely provided in one of the calendar examples. Thanks, Shiva From boris at codesynthesis.com Tue Aug 14 03:13:52 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] xsd::date In-Reply-To: References: Message-ID: <20070814071352.GB11516@karelia> Hi Shiva, Balasubramanyam, Shivakumar writes: > Is there one already or do we have to do use something like > boost::Gregorian_date as nicely provided in one of the calendar > examples. Yes, this is probably the easiest option if you are already using Boost. The reason why we do not provide anything more sophisticated by default is that (1) we don't want to add extra dependencies (e.g., on Boost) and (2) we don't want to re-implement a date/time library in libxsd especially since in most cases it won't be something application developers use anyway (that is, they will most likely convert it to their own date/time types). So instead we provide a mechanism, as shown in the custom/calendar example, to re-map the date type (or any built-in XML Schema type) to your own type. hth, -boris From sbalasub at qualcomm.com Tue Aug 14 06:13:38 2007 From: sbalasub at qualcomm.com (Balasubramanyam, Shivakumar) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] xsd::date In-Reply-To: <20070814071352.GB11516@karelia> References: <20070814071352.GB11516@karelia> Message-ID: Boris, I appreciate your detailed response and I agree with your reasoning. Thanks, Shiva -----Original Message----- From: xsd-users-bounces@codesynthesis.com [mailto:xsd-users-bounces@codesynthesis.com] On Behalf Of Boris Kolpackov Sent: Tuesday, August 14, 2007 12:14 AM To: Balasubramanyam, Shivakumar Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] xsd::date Hi Shiva, Balasubramanyam, Shivakumar writes: > Is there one already or do we have to do use something like > boost::Gregorian_date as nicely provided in one of the calendar > examples. Yes, this is probably the easiest option if you are already using Boost. The reason why we do not provide anything more sophisticated by default is that (1) we don't want to add extra dependencies (e.g., on Boost) and (2) we don't want to re-implement a date/time library in libxsd especially since in most cases it won't be something application developers use anyway (that is, they will most likely convert it to their own date/time types). So instead we provide a mechanism, as shown in the custom/calendar example, to re-map the date type (or any built-in XML Schema type) to your own type. hth, -boris From cyril.monpellier at platespin.com Thu Aug 16 14:04:03 2007 From: cyril.monpellier at platespin.com (Cyril Monpellier) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Support for Solaris 2.5, Solaris 2.5.1, Solaris 2.6 Message-ID: <00C7AEC2785D004FAC718953A4040222040F603A@IT-BEX2.platespin.com> Hi, I'm looking for a code generation tool to generate C++ from XSD. I need the generated code to run on Solaris 2.5, Solaris 2.5.1 and Solaris 2.6. Do you support those platforms? It's not listed on your web site but was wondering if you have tried it before. Thanks, Cyril Monpellier From boris at codesynthesis.com Thu Aug 16 16:46:30 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] Support for Solaris 2.5, Solaris 2.5.1, Solaris 2.6 In-Reply-To: <00C7AEC2785D004FAC718953A4040222040F603A@IT-BEX2.platespin.com> References: <00C7AEC2785D004FAC718953A4040222040F603A@IT-BEX2.platespin.com> Message-ID: <20070816204630.GB371@karelia> Hi Cyril, Cyril Monpellier writes: > I'm looking for a code generation tool to generate C++ from XSD. I need > the generated code to run on Solaris 2.5, Solaris 2.5.1 and Solaris 2.6. > > Do you support those platforms? It's not listed on your web site but was > wondering if you have tried it before. It is not so much an OS as a C++ compiler issue. Which make and version are you using to compile your code? -Boris From uri at hyperroll.com Sun Aug 19 01:43:32 2007 From: uri at hyperroll.com (Uri Karagila) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] anonymous types in XSD Message-ID: <783879783B65E44995520FEF376C4538158E5A@ilexch1.int.hyperroll.com> Hi, While building our application on Linux (it was already built on Win) we've encountered a new problem. It seems that all "_containers" are now being called as "_optional". The main problem seen is that anonymous types in XSD are converted differently on Windows vs. UNIX. What can be done to avoid this problem? Regards Uri From boris at codesynthesis.com Sun Aug 19 03:32:34 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] anonymous types in XSD In-Reply-To: <783879783B65E44995520FEF376C4538158E5A@ilexch1.int.hyperroll.com> References: <783879783B65E44995520FEF376C4538158E5A@ilexch1.int.hyperroll.com> Message-ID: <20070819073234.GA17555@karelia> Hi Uri, Uri Karagila writes: > While building our application on Linux (it was already built on Win) > we've encountered a new problem. It seems that all "_containers" are now > being called as "_optional". The main problem seen is that anonymous > types in XSD are converted differently on Windows vs. UNIX. The names of containers as well as handling of anonymous types has changed in 3.0.0 compared to the XSD 2.x.y series. I think you are using 3.0.0 on GNU/Linux and 2.x.y on Windows. To make the two platforms behave the same you will need to use the same version of XSD on both. You can get older version of XSD here: http://www.codesynthesis.com/download/xsd/ hth, -boris From inna at hyperroll.com Wed Aug 22 04:53:42 2007 From: inna at hyperroll.com (Inna Grois) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] keeping annotations/comments in xml file Message-ID: <783879783B65E44995520FEF376C4538158F09@ilexch1.int.hyperroll.com> Hi, I would like to update xml file while keeping the annotations if they exist in xml. Is it possible? And if yes, how should I work in order to keep the annotations? As I understand, If I will delete the node and create the new one with the updates I will definitely lose the annotations. But if I will check that the node already exists and if yes I will only update it, will I keep the annotations in that way? Thank you, Inna From boris at codesynthesis.com Wed Aug 22 05:32:11 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] keeping annotations/comments in xml file In-Reply-To: <783879783B65E44995520FEF376C4538158F09@ilexch1.int.hyperroll.com> References: <783879783B65E44995520FEF376C4538158F09@ilexch1.int.hyperroll.com> Message-ID: <20070822093211.GA29954@karelia> Hi Inna, Inna Grois writes: > I would like to update xml file while keeping the annotations if they > exist in xml. > > Is it possible? There is no automatic way to preserve comments in the resulting documents. The serialization operators remove any child nodes (including comments) from DOM elements before creating new content. The straightforward way to achieve what you want would probably be to traverse the old DOM document and copy any comments to the correct places in the new one. The tricky part could be figuring out when to copy a comment and when not to. Here is a quick example to illustrate what I am talking about. Let's say you start with the following document: John Doe 21 Now you load it into the object model, modify the data and write it out to the updated document (in DOM): Jane Doe 18 Message-ID: <783879783B65E44995520FEF376C4538158F15@ilexch1.int.hyperroll.com> Hi, While mapping xml trees 2 issues emerged: 1. can I manipulate (e.g., create new) annotations while creating\mapping my xml tree? 2. in case xml file (which includes annotations) was "loaded" into memory, I assume comments are not going to lost while tree is being "flushed" back into an xml file. Correct? Regards Uri From inna at hyperroll.com Thu Aug 23 02:45:31 2007 From: inna at hyperroll.com (Inna Grois) Date: Sun Oct 11 15:33:57 2009 Subject: [xsd-users] RE: keeping annotations/comments in xml file In-Reply-To: <200708221600.l7MG06B0026244@codesynthesis.com> Message-ID: <783879783B65E44995520FEF376C4538158F31@ilexch1.int.hyperroll.com> Hi, Boris Thank you for your answer. I would like to get more details about the second possibility. You wrote: > Another, more elegant, way to do this would be to customize the > xml_schema::type type (a base type for all generated classes) with a > new DOMElement serialization operator that will copy the comments from > the old DOM tree (that should be associated with the object model > using the keep_dom flag) to the new one. I have a couple of questions: If I use Keep_dom flag, then after parsing an xml node, the DOMElement of this node contains the DOM info of this node? Is it means that the DOMElement in xml_schema::type type contains all the DOM info about current node including the comments of current node? If so, what exactly should I do to copy the comments from the DOMElement to the output document? if you can give me some simple example I will appreciate it very much. Thanks a lot, Inna -----Original Message----- From: xsd-users-bounces@codesynthesis.com [mailto:xsd-users-bounces@codesynthesis.com] On Behalf Of xsd-users-request@codesynthesis.com Sent: Wednesday, August 22, 2007 7:00 PM To: xsd-users@codesynthesis.com Subject: xsd-users Digest, Vol 26, Issue 6 Send xsd-users mailing list submissions to xsd-users@codesynthesis.com To subscribe or unsubscribe via the World Wide Web, visit http://codesynthesis.com/mailman/listinfo/xsd-users or, via email, send a message with subject or body 'help' to xsd-users-request@codesynthesis.com You can reach the person managing the list at xsd-users-owner@codesynthesis.com When replying, please edit your Subject line so it is more specific than "Re: Contents of xsd-users digest..." Today's Topics: 1. keeping annotations/comments in xml file (Inna Grois) 2. Re: keeping annotations/comments in xml file (Boris Kolpackov) ---------------------------------------------------------------------- Message: 1 Date: Wed, 22 Aug 2007 11:53:42 +0300 From: "Inna Grois" Subject: [xsd-users] keeping annotations/comments in xml file To: Message-ID: <783879783B65E44995520FEF376C4538158F09@ilexch1.int.hyperroll.com> Content-Type: text/plain; charset="us-ascii" Hi, I would like to update xml file while keeping the annotations if they exist in xml. Is it possible? And if yes, how should I work in order to keep the annotations? As I understand, If I will delete the node and create the new one with the updates I will definitely lose the annotations. But if I will check that the node already exists and if yes I will only update it, will I keep the annotations in that way? Thank you, Inna ------------------------------ Message: 2 Date: Wed, 22 Aug 2007 11:32:11 +0200 From: Boris Kolpackov Subject: Re: [xsd-users] keeping annotations/comments in xml file To: Inna Grois Cc: xsd-users@codesynthesis.com Message-ID: <20070822093211.GA29954@karelia> Content-Type: text/plain; charset=us-ascii Hi Inna, Inna Grois writes: > I would like to update xml file while keeping the annotations if they > exist in xml. > > Is it possible? There is no automatic way to preserve comments in the resulting documents. The serialization operators remove any child nodes (including comments) from DOM elements before creating new content. The straightforward way to achieve what you want would probably be to traverse the old DOM document and copy any comments to the correct places in the new one. The tricky part could be figuring out when to copy a comment and when not to. Here is a quick example to illustrate what I am talking about. Let's say you start with the following document: John Doe 21 Now you load it into the object model, modify the data and write it out to the updated document (in DOM): Jane Doe 18 References: <200708221600.l7MG06B0026244@codesynthesis.com> <783879783B65E44995520FEF376C4538158F31@ilexch1.int.hyperroll.com> Message-ID: <20070823071054.GB2194@karelia> Hi Inna, 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. Inna Grois writes: > I would like to get more details about the second possibility. > You wrote: > > > Another, more elegant, way to do this would be to customize the > > xml_schema::type type (a base type for all generated classes) with a > > new DOMElement serialization operator that will copy the comments from > > > the old DOM tree (that should be associated with the object model > > using the keep_dom flag) to the new one. > > I have a couple of questions: > > If I use Keep_dom flag, then after parsing an xml node, the DOMElement > of this node contains the DOM info of this node? Yes, with the keep_dom flag, the corresponding DOM nodes and object model nodes are associated. You can obtain a DOM node from an object model by calling the _node() function. See Section 3.2, "Flags and Properties" in the C++/Tree Mapping User Manual: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#3.2 > Is it means that the DOMElement in xml_schema::type type contains all > the DOM info about current node including the comments of current node? It contains the original content so if there were comments, then yes, they are preserved. Actually, I just checked and the default behavior of the parsing functions appears to be to discard comments. This means that you will need to do the XML-to-DOM parsing yourself. For more information on how to do this see the multiroot example in 3.0.0 distribution and/or the C++/Tree mapping FAQ: http://wiki.codesynthesis.com/Tree/FAQ > If so, what exactly should I do to copy the comments from the DOMElement > to the output document? > > if you can give me some simple example I will appreciate it very much. You will need to do the following: 1. Customize the xml_schema::type. For more information on how to do this see the C++/Tree Mapping Customization Guide, particularly sections 1 and 4: http://wiki.codesynthesis.com/Tree/Customization_guide In your customization, you should simply inherit from the original xml_schema::type, provide all the constructors that are found in the original xml_schema::type (see the custom/calendar example), and add your own operator<< (DOMElement, const xml_schema::type&) (see the custom/wildcard example). 2. In your implementation of operator<< (DOMElement, xml_schema::type), you will first call the original operator<< and then call _node() to obtain the original node and copy any comments to the new node. 3. You will need to parse your XML to DOM and preserve comments (parser->setFeature (XMLUni::fgDOMComments, true)). Then parse the DOM document to the object model with the keep_dom flag. Hopefully in the next release of XSD we will add an example that shows how to do all this. hth, -boris From boris at codesynthesis.com Thu Aug 23 03:18:11 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] annotations In-Reply-To: <783879783B65E44995520FEF376C4538158F15@ilexch1.int.hyperroll.com> References: <20070722150603.GE31233@karelia> <783879783B65E44995520FEF376C4538158F15@ilexch1.int.hyperroll.com> Message-ID: <20070823071811.GC2194@karelia> Hi Uri, Uri Karagila writes: > While mapping xml trees 2 issues emerged: > 1. can I manipulate (e.g., create new) annotations while > creating\mapping my xml tree? You can serialize the object model to a DOM document, create comments and then serialize the DOM document to XML. Alternatively you can customize your types (or xml_schema::type) to add comments. > 2. in case xml file (which includes annotations) was "loaded" into > memory, I assume comments are not going to lost while tree is being > "flushed" back into an xml file. Correct? No, comments will be discarded. This questions was already raised by Inna Grois, see the "Keeping annotations/comments in xml file" thread for more information on how you can preserve comments: http://www.codesynthesis.com/pipermail/xsd-users/2007-August/thread.html hth, -boris From inna at hyperroll.com Thu Aug 23 04:27:56 2007 From: inna at hyperroll.com (Inna Grois) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] RE: keeping annotations/comments in xml file In-Reply-To: <20070823071054.GB2194@karelia> Message-ID: <783879783B65E44995520FEF376C4538158F41@ilexch1.int.hyperroll.com> I am sorry, but I cannot find "custom/wildcard example". Can you lease give me a link to it. Thanks, -Inna -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Thursday, August 23, 2007 10:11 AM To: Inna Grois Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] RE: keeping annotations/comments in xml file Hi Inna, 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. Inna Grois writes: > I would like to get more details about the second possibility. > You wrote: > > > Another, more elegant, way to do this would be to customize the > > xml_schema::type type (a base type for all generated classes) with a > > new DOMElement serialization operator that will copy the comments from > > > the old DOM tree (that should be associated with the object model > > using the keep_dom flag) to the new one. > > I have a couple of questions: > > If I use Keep_dom flag, then after parsing an xml node, the DOMElement > of this node contains the DOM info of this node? Yes, with the keep_dom flag, the corresponding DOM nodes and object model nodes are associated. You can obtain a DOM node from an object model by calling the _node() function. See Section 3.2, "Flags and Properties" in the C++/Tree Mapping User Manual: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/ #3.2 > Is it means that the DOMElement in xml_schema::type type contains all > the DOM info about current node including the comments of current node? It contains the original content so if there were comments, then yes, they are preserved. Actually, I just checked and the default behavior of the parsing functions appears to be to discard comments. This means that you will need to do the XML-to-DOM parsing yourself. For more information on how to do this see the multiroot example in 3.0.0 distribution and/or the C++/Tree mapping FAQ: http://wiki.codesynthesis.com/Tree/FAQ > If so, what exactly should I do to copy the comments from the DOMElement > to the output document? > > if you can give me some simple example I will appreciate it very much. You will need to do the following: 1. Customize the xml_schema::type. For more information on how to do this see the C++/Tree Mapping Customization Guide, particularly sections 1 and 4: http://wiki.codesynthesis.com/Tree/Customization_guide In your customization, you should simply inherit from the original xml_schema::type, provide all the constructors that are found in the original xml_schema::type (see the custom/calendar example), and add your own operator<< (DOMElement, const xml_schema::type&) (see the custom/wildcard example). 2. In your implementation of operator<< (DOMElement, xml_schema::type), you will first call the original operator<< and then call _node() to obtain the original node and copy any comments to the new node. 3. You will need to parse your XML to DOM and preserve comments (parser->setFeature (XMLUni::fgDOMComments, true)). Then parse the DOM document to the object model with the keep_dom flag. Hopefully in the next release of XSD we will add an example that shows how to do all this. hth, -boris From boris at codesynthesis.com Thu Aug 23 04:42:05 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] RE: keeping annotations/comments in xml file In-Reply-To: <783879783B65E44995520FEF376C4538158F41@ilexch1.int.hyperroll.com> References: <20070823071054.GB2194@karelia> <783879783B65E44995520FEF376C4538158F41@ilexch1.int.hyperroll.com> Message-ID: <20070823084205.GF2194@karelia> Hi Inna, Inna Grois writes: > I am sorry, but I cannot find "custom/wildcard example". > Can you lease give me a link to it. It is in examples/cxx/tree/custom/wildcard. Also make sure you have the latest release in the series (i.e., either 2.3.1 or 3.0.0). Also note that the multiroot example was added only in 3.0.0. -boris From boris at codesynthesis.com Thu Aug 23 07:15:29 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Re: help,how can i get the element name? In-Reply-To: <200708231856490931804@126.com> References: <200708231856490931804@126.com> Message-ID: <20070823111529.GG2194@karelia> Hi Jordanma, In the future please send technical questions like these to the xsd-users mailing list (which I've CC'ed) instead of to me directly. 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. god_nirvana writes: > I used the xsd generate the cxx & hxx file from a xsd file. > when i pass the xml file,there is a question, how can i get the > element or the attributes name ,value. they are not the string type. Please read the C++/Tree Mapping Getting Started Guide, it is all explained there: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/ -boris From Dean.Gaudet at vac-acc.gc.ca Thu Aug 23 10:16:00 2007 From: Dean.Gaudet at vac-acc.gc.ca (Dean Gaudet) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Problem Compiling Example on HP-11 Using aCC Message-ID: <46CD6C70020000B000008F76@mailhost.vac-acc.gc.ca> I cannot seem to get past the following compiler errors when trying to compile the hello.cxx tree example. Here is some info: O/S : HP-11 B.11.11 C++ : aCC (HP ANSI C++ B3910B A.03.50) I have compiled Xerces C++ on my system using the following options: -p hp-11 -x aCC -b 32 When I try to compile the XSD hello tree example like so: gmake CXX=aCC CXXFLAGS="-I $XERCESCROOT/include" CPPFLAGS="-AA" I get the following: aCC -AA -I../../../../libxsd -I /home/dfgaudet/xerces-c-src_2_7_0/include -c driver.cxx -o driver.o Warning 930: "/home/dfgaudet/xerces-c-src_2_7_0/include/xercesc/util/PlatformUtils.hpp", line 793 # Placement operator delete invocation is not yet implemented. MakeXMLException(XMLPlatformUtilsException, XMLUTIL_EXPORT) ^^^^^^^^^^^^^^^^ Warning 930: "/home/dfgaudet/xerces-c-src_2_7_0/include/xercesc/util/ArrayIndexOutOfBoundsException.hpp", line 28 # Placement operator delete invocation is not yet implemented. MakeXMLException(ArrayIndexOutOfBoundsException, XMLUTIL_EXPORT) ^^^^^^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 556: "../../../../libxsd/xsd/cxx/tree/list.hxx", line 34 # Unable to generate specialization class sequence<#1,(bool)xsd::cxx::tree::fundamental_p::r> due to errors during generation. class list: public sequence ^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 556: "../../../../libxsd/xsd/cxx/tree/list.hxx", line 44 # Unable to generate specialization class sequence<#1,(bool)xsd::cxx::tree::fundamental_p::r> due to errors during generation. list (typename sequence::size_type n) ^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 556: "../../../../libxsd/xsd/cxx/tree/list.hxx", line 49 # Unable to generate specialization class sequence<#1,(bool)xsd::cxx::tree::fundamental_p::r> due to errors during generation. list (typename sequence::size_type n, const X& x) ^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 556: "../../../../libxsd/xsd/cxx/tree/list.hxx", line 45 # Unable to generate specialization class sequence<#1,(bool)xsd::cxx::tree::fundamental_p::r> due to errors during generation. : sequence (n, X ()) ^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 556: "../../../../libxsd/xsd/cxx/tree/list.hxx", line 50 # Unable to generate specialization class sequence<#1,(bool)xsd::cxx::tree::fundamental_p::r> due to errors during generation. : sequence (n, x) ^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 556: "../../../../libxsd/xsd/cxx/tree/list.hxx", line 56 # Unable to generate specialization class sequence<#1,(bool)xsd::cxx::tree::fundamental_p::r> due to errors during generation. : sequence (b, e) ^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 556: "../../../../libxsd/xsd/cxx/tree/list.hxx", line 64 # Unable to generate specialization class sequence<#1,(bool)xsd::cxx::tree::fundamental_p::r> due to errors during generation. : sequence (v, f, container) ^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 556: "../../../../libxsd/xsd/cxx/tree/list.hxx", line 39 # Unable to generate specialization class sequence<#1,(bool)xsd::cxx::tree::fundamental_p::r> due to errors during generation. : sequence (f, container) ^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 556: "../../../../libxsd/xsd/cxx/tree/list.hxx", line 87 # Unable to generate specialization class sequence<#1,(bool)xsd::cxx::tree::fundamental_p::r> due to errors during generation. class list: public sequence ^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 556: "../../../../libxsd/xsd/cxx/tree/list.hxx", line 97 # Unable to generate specialization class sequence<#1,(bool)xsd::cxx::tree::fundamental_p::r> due to errors during generation. list (typename sequence::size_type n, const X& x = X ()) ^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 556: "../../../../libxsd/xsd/cxx/tree/list.hxx", line 92 # Unable to generate specialization class sequence<#1,(bool)xsd::cxx::tree::fundamental_p::r> due to errors during generation. : sequence (f, container) ^^^^^^^^^^^ Error 331: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Illegal cast expression; cannot cast expression type '' to 'bool'. template ::r> ^^^^^^^^^^^^^^^^^^^ Error 699: "../../../../libxsd/xsd/cxx/tree/containers.hxx", line 506 # Error limit reached; halting compilation. template ::r> ^^^^^^^^^^^^^^^^^^^ gmake: *** [driver.o] Error 2 Dean Gaudet From boris at codesynthesis.com Thu Aug 23 10:35:57 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Problem Compiling Example on HP-11 Using aCC In-Reply-To: <46CD6C70020000B000008F76@mailhost.vac-acc.gc.ca> References: <46CD6C70020000B000008F76@mailhost.vac-acc.gc.ca> Message-ID: <20070823143557.GA8070@karelia> Hi Dean, Dean Gaudet writes: > I cannot seem to get past the following compiler errors when trying > to compile the hello.cxx tree example. Here is some info: > > O/S : HP-11 B.11.11 > C++ : aCC (HP ANSI C++ B3910B A.03.50) > > I have compiled Xerces C++ on my system using the following options: > > -p hp-11 > -x aCC > -b 32 > > When I try to compile the XSD hello tree example like so: > > gmake CXX=aCC CXXFLAGS="-I $XERCESCROOT/include" CPPFLAGS="-AA" Your options look Ok. I think the problem is in the compiler version. We have tested our code with A.03.63 and later and it compiles and works fine. Is upgrading the compiler an option in your situation? -Boris From Dean.Gaudet at vac-acc.gc.ca Thu Aug 23 10:47:52 2007 From: Dean.Gaudet at vac-acc.gc.ca (Dean Gaudet) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Problem Compiling Example on HP-11 Using aCC In-Reply-To: <20070823143557.GA8070@karelia> References: <46CD6C70020000B000008F76@mailhost.vac-acc.gc.ca> <20070823143557.GA8070@karelia> Message-ID: <46CD73E8020000B000008F7E@mailhost.vac-acc.gc.ca> Hi Boris, Upgrading our compiler is certainly something we will have to get to at some point, but it means recompiling and retesting all of our other code, which is not an option right now. Is there a way to get around this, without having to immediately upgrade our compiler? Dean >>> Boris Kolpackov August 23, 2007 11:35:57 am >>> Hi Dean, Dean Gaudet writes: > I cannot seem to get past the following compiler errors when trying > to compile the hello.cxx tree example. Here is some info: > > O/S : HP-11 B.11.11 > C++ : aCC (HP ANSI C++ B3910B A.03.50) > > I have compiled Xerces C++ on my system using the following options: > > -p hp-11 > -x aCC > -b 32 > > When I try to compile the XSD hello tree example like so: > > gmake CXX=aCC CXXFLAGS="-I $XERCESCROOT/include" CPPFLAGS="-AA" Your options look Ok. I think the problem is in the compiler version. We have tested our code with A.03.63 and later and it compiles and works fine. Is upgrading the compiler an option in your situation? -Boris From boris at codesynthesis.com Thu Aug 23 11:00:28 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Problem Compiling Example on HP-11 Using aCC In-Reply-To: <46CD73E8020000B000008F7E@mailhost.vac-acc.gc.ca> References: <46CD6C70020000B000008F76@mailhost.vac-acc.gc.ca> <20070823143557.GA8070@karelia> <46CD73E8020000B000008F7E@mailhost.vac-acc.gc.ca> Message-ID: <20070823150028.GB8070@karelia> Hi Dean, Dean Gaudet writes: > Upgrading our compiler is certainly something we will have to get > to at some point, but it means recompiling and retesting all of > our other code, which is not an option right now. I don't think you will need to recompile anything since it is not a major upgrade (I can confirm this on the HP aCC mailing list if you would like). > Is there a way to get around this, without having to immediately > upgrade our compiler? Well, we could try to get rid of the metaprogramming bit (the fundamental_p<> test). This will disable built-in type customization feature but should be Ok for the general use. But then it is not clear if there will be more errors. Are you considering to purchase a proprietary license or a support contract? We can try to work around of this problem and create a custom version of XSD for you but this will have to be on the commercial basis. -boris From jnw at xs4all.nl Thu Aug 23 15:28:53 2007 From: jnw at xs4all.nl (Jeroen N. Witmond [Bahco]) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Attempting to access attribute xml:base. In-Reply-To: <20070116213700.GB16367@karelia> References: <8644.194.109.230.85.1166735973.squirrel@webmail.xs4all.nl> <20061222093548.GB20058@karelia> <19842.194.109.230.85.1167412462.squirrel@webmail.xs4all.nl> <20061230175234.GB15258@karelia> <23487.194.109.230.85.1168705493.squirrel@webmail.xs4all.nl> <20070116213700.GB16367@karelia> Message-ID: <20371.194.109.230.85.1187897333.squirrel@webmail.xs4all.nl> Hi Boris, I've updated http://www.xs4all.nl/~jnw/codesynthesis/xmlnamespace/index.html and all programs referenced by it. I intend to keep this page for a long time, so please feel free to link to it. All programs now work with both version 2.3.0 and version 3.0.0 of xsd. I may need to change them to also work with version 2.3.1. I also added a program 'attset-driver' which uses the xsd attribute_set to access xml:base when its presence is not explicit in the schema. I'm still having problems getting the customization of anyType to work. This is the program named 'custom-intended' and numbered '4' on my web page mentioned above. I'm getting compiler errors in the code generated by xsd. The first one is "lax.cxx:173: instantiated from here /home/bahco/Sandbox/xsd_2.3.0/usr/include/xsd/cxx/tree/elements.hxx:729: error: invalid conversion from 'xsd::cxx::tree::type*' to 'xml_schema::type*'". I really could use some help here. Thanks, Jeroen. From boris at codesynthesis.com Fri Aug 24 04:17:48 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Attempting to access attribute xml:base. In-Reply-To: <20371.194.109.230.85.1187897333.squirrel@webmail.xs4all.nl> References: <8644.194.109.230.85.1166735973.squirrel@webmail.xs4all.nl> <20061222093548.GB20058@karelia> <19842.194.109.230.85.1167412462.squirrel@webmail.xs4all.nl> <20061230175234.GB15258@karelia> <23487.194.109.230.85.1168705493.squirrel@webmail.xs4all.nl> <20070116213700.GB16367@karelia> <20371.194.109.230.85.1187897333.squirrel@webmail.xs4all.nl> Message-ID: <20070824081748.GA15774@karelia> Hi Jeroen, Jeroen N. Witmond [Bahco] writes: > I've updated > http://www.xs4all.nl/~jnw/codesynthesis/xmlnamespace/index.html and all > programs referenced by it. I intend to keep this page for a long time, so > please feel free to link to it. Ok, I've added the link in the "Community Resources" section in the C++/Tree mapping Wiki page: http://wiki.codesynthesis.com/Tree > > All programs now work with both version 2.3.0 and version 3.0.0 of xsd. I > may need to change them to also work with version 2.3.1. Code written for 2.3.0 shouldn't require any changes to work with 2.3.1. > I also added a program 'attset-driver' which uses the xsd attribute_set > to access xml:base when its presence is not explicit in the schema. This is probably the cleanest way to go about it. > I'm still having problems getting the customization of anyType to work. > This is the program named 'custom-intended' and numbered '4' on my web > page mentioned above. I'm getting compiler errors in the code generated by > xsd. The first one is "lax.cxx:173: instantiated from here > /home/bahco/Sandbox/xsd_2.3.0/usr/include/xsd/cxx/tree/elements.hxx:729: > error: invalid conversion from 'xsd::cxx::tree::type*' to > 'xml_schema::type*'". I really could use some help here. I took a look and it appears there are some constructs in both 2.3.1 and 3.0.0 that prevent anyType from being customized. I am going to try and fix this for the next release. I can also build you a pre- release binary if you would like to give it a try before the release. hth, -boris From boris at codesynthesis.com Fri Aug 24 04:22:40 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] RE: keeping annotations/comments in xml file In-Reply-To: <20070823071054.GB2194@karelia> References: <200708221600.l7MG06B0026244@codesynthesis.com> <783879783B65E44995520FEF376C4538158F31@ilexch1.int.hyperroll.com> <20070823071054.GB2194@karelia> Message-ID: <20070824082240.GB15774@karelia> Hi Inna, Boris Kolpackov writes: > 1. Customize the xml_schema::type. I was investigating a problem Jeroen N. Witmond had with customizing xml_schema::type. It appears there are some constructs in both 2.3.1 and 3.0.0 that prevent anyType from being customized. So this method won't work for now. I am going to try and fix this for the next release. I can also build you a pre-release binary (based on 3.0.0) if you would like to give it a try before the release. hth, -boris From jnw at xs4all.nl Sat Aug 25 05:39:26 2007 From: jnw at xs4all.nl (Jeroen N. Witmond [Bahco]) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Attempting to access attribute xml:base. In-Reply-To: <20070824081748.GA15774@karelia> References: <8644.194.109.230.85.1166735973.squirrel@webmail.xs4all.nl> <20061222093548.GB20058@karelia> <19842.194.109.230.85.1167412462.squirrel@webmail.xs4all.nl> <20061230175234.GB15258@karelia> <23487.194.109.230.85.1168705493.squirrel@webmail.xs4all.nl> <20070116213700.GB16367@karelia> <20371.194.109.230.85.1187897333.squirrel@webmail.xs4all.nl> <20070824081748.GA15774@karelia> Message-ID: <12285.194.109.230.85.1188034766.squirrel@webmail.xs4all.nl> Hi Boris, Boris Kolpackov writes: > Hi Jeroen, > > Jeroen N. Witmond [Bahco] writes: > >> I've updated >> http://www.xs4all.nl/~jnw/codesynthesis/xmlnamespace/index.html and all >> programs referenced by it. I intend to keep this page for a long time, >> so >> please feel free to link to it. > > Ok, I've added the link in the "Community Resources" section in the > C++/Tree mapping Wiki page: > > http://wiki.codesynthesis.com/Tree Nice! >> All programs now work with both version 2.3.0 and version 3.0.0 of xsd. >> I >> may need to change them to also work with version 2.3.1. > > Code written for 2.3.0 shouldn't require any changes to work with 2.3.1. OK. One question: Is the attribute_set part of 2.3.1, or was it introduced in 3.0.0? >> I also added a program 'attset-driver' which uses the xsd attribute_set >> to access xml:base when its presence is not explicit in the schema. > > This is probably the cleanest way to go about it. I agree. >> I'm still having problems getting the customization of anyType to work. >> This is the program named 'custom-intended' and numbered '4' on my web >> page mentioned above. I'm getting compiler errors in the code generated >> by >> xsd. The first one is "lax.cxx:173: instantiated from here >> /home/bahco/Sandbox/xsd_2.3.0/usr/include/xsd/cxx/tree/elements.hxx:729: >> error: invalid conversion from 'xsd::cxx::tree::type*' to >> 'xml_schema::type*'". I really could use some help here. > > I took a look and it appears there are some constructs in both 2.3.1 > and 3.0.0 that prevent anyType from being customized. I am going to > try and fix this for the next release. I can also build you a pre- > release binary if you would like to give it a try before the release. I would like that, but there is no big hurry. :) Thanks, Jeroen. From boris at codesynthesis.com Sat Aug 25 11:47:32 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Attempting to access attribute xml:base. In-Reply-To: <12285.194.109.230.85.1188034766.squirrel@webmail.xs4all.nl> References: <8644.194.109.230.85.1166735973.squirrel@webmail.xs4all.nl> <20061222093548.GB20058@karelia> <19842.194.109.230.85.1167412462.squirrel@webmail.xs4all.nl> <20061230175234.GB15258@karelia> <23487.194.109.230.85.1168705493.squirrel@webmail.xs4all.nl> <20070116213700.GB16367@karelia> <20371.194.109.230.85.1187897333.squirrel@webmail.xs4all.nl> <20070824081748.GA15774@karelia> <12285.194.109.230.85.1188034766.squirrel@webmail.xs4all.nl> Message-ID: <20070825154732.GA32408@karelia> Hi Jeroen, Jeroen N. Witmond [Bahco] writes: > OK. One question: Is the attribute_set part of 2.3.1, or was it introduced > in 3.0.0? It was introduced in 3.0.0. > > I took a look and it appears there are some constructs in both 2.3.1 > > and 3.0.0 that prevent anyType from being customized. I am going to > > try and fix this for the next release. I can also build you a pre- > > release binary if you would like to give it a try before the release. > > I would like that, but there is no big hurry. :) Good. I am in the middle of a major release right now. Hopefully will have something for you to test in a week or so. -boris From bence.magyar at gmail.com Mon Aug 27 12:47:18 2007 From: bence.magyar at gmail.com (Bence Magyar) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Compiling under VC++ 6.0 Message-ID: <38d32f090708270947r112e9994n6f6d62e11c77332@mail.gmail.com> Hi, I searched through the previous post archives hoping to find an answer to this, so please excuse this rather newbie question. Can I compile generated .cxx files output from cxx-tree under VC++ 6.0? I'm seeing the following error message: "Microsoft Visual C++ 6 is not supported." This message is thrown from this code snippet: #ifdef _MSC_VER # if (_MSC_VER >= 1400) # include # elif (_MSC_VER >= 1300) # include # else # error Microsoft Visual C++ 6 is not supported. # endif #endif from the libxsd\xsd\cxx\pre.hxx file. I've looked through these files, and it seems as though they only disable/suppress different compiler warnings depending on the platform you're compiling on. I have a VC++ 6.0-compatible version of xerces. Shouldn't I be able to compile cxx files in VC++ 6.0? From boris at codesynthesis.com Mon Aug 27 13:01:32 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Compiling under VC++ 6.0 In-Reply-To: <38d32f090708270947r112e9994n6f6d62e11c77332@mail.gmail.com> References: <38d32f090708270947r112e9994n6f6d62e11c77332@mail.gmail.com> Message-ID: <20070827170132.GF2337@karelia> Hi Bence, VC++ 6.0 is not standard-conformant enough and therefore is not supported. You have to options: 1. Upgrade to Visual Studio 7.1 or 8.0. Visual Studio 8.0 Express Edition, which includes pretty much everything your need to develop C++ application (IDE, debugger, etc.), is free: http://msdn2.microsoft.com/en-us/express/aa975050.aspx 2. Use embedded systems version of XSD, called XSD/e: http://codesynthesis.com/products/xsde/ Note that at the moment XSD/e only support event-driven C++/Parser mapping. -boris From kroiz at hyperroll.com Wed Aug 29 05:12:57 2007 From: kroiz at hyperroll.com (Kroizman Guy) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Using Doxygen on the generated code Message-ID: <1188378777.9906.6.camel@localhost.localdomain> Hi, Has anybody had any success creating documentation using Doxygen? I get a lot of warning and in the end not much gets generated. I am using version 3. I am especially interested in creating classes diagram. From boris at codesynthesis.com Wed Aug 29 06:01:35 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] Using Doxygen on the generated code In-Reply-To: <1188378777.9906.6.camel@localhost.localdomain> References: <1188378777.9906.6.camel@localhost.localdomain> Message-ID: <20070829100135.GE506@karelia> Hi Guy, Kroizman Guy writes: > Has anybody had any success creating documentation using Doxygen? Yes, I've generated documentation for several fairly large schemas. There is also sample documentation for the hello example: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/doxygen/classhello__t.html > I get a lot of warning and in the end not much gets generated. Warnings are expected since some internal functions are left undocumented. We will try to get rid of the warning for the next version of XSD. What do you mean by "not much gets generated"? Does your documentation look similar to the sample above? > I am especially interested in creating classes diagram. I believe you need to install graphviz[1] and enable graph drawing by setting HAVE_DOT to yes in your Doxygen configuration file. [1] http://www.graphviz.org/ See the Doxygen documentation for more information on all this. -Boris From kroiz at hyperroll.com Wed Aug 29 09:26:02 2007 From: kroiz at hyperroll.com (Kroizman Guy) Date: Sun Oct 11 15:33:58 2009 Subject: [Fwd: Re: [xsd-users] Using Doxygen on the generated code] Message-ID: <1188393962.5980.13.camel@localhost.localdomain> I get a lot of messages of that sort for example: C:/hdx/HyperRoll-Application.hxx:1122: Warning: Found ';' while parsing initializer list! (doxygen could be confused by a macro call without semicolon) C:/hdx/hdx.h:76: Warning: Member ColumnTypes (enumeration) of class hdxns::Hdx is not documented. C:/hdx/HyperRoll-Application.hxx:79: Warning: Member simple_type (typedef) of namespace xml_schema is not documented. What gets generated is my namespace (hdxns) with a lot of functions of type: void operator<<( all sort of things ) no sign for all the elements/classes defined in my scheme. no class diagram but probably cause nothing much gets generated. when I run Doxygen on one of the code synthesis examples everything look good. On Wed, 2007-08-29 at 12:01 +0200, Boris Kolpackov wrote: > Hi Guy, > > Kroizman Guy writes: > > > Has anybody had any success creating documentation using Doxygen? > > Yes, I've generated documentation for several fairly large schemas. > There is also sample documentation for the hello example: > > http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/doxygen/classhello__t.html > > > I get a lot of warning and in the end not much gets generated. > > Warnings are expected since some internal functions are left > undocumented. We will try to get rid of the warning for the > next version of XSD. What do you mean by "not much gets > generated"? Does your documentation look similar to the sample > above? > > > > I am especially interested in creating classes diagram. > > I believe you need to install graphviz[1] and enable graph drawing > by setting HAVE_DOT to yes in your Doxygen configuration file. > > [1] http://www.graphviz.org/ > > See the Doxygen documentation for more information on all this. > > > -Boris From boris at codesynthesis.com Wed Aug 29 09:50:47 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [Fwd: Re: [xsd-users] Using Doxygen on the generated code] In-Reply-To: <1188393962.5980.13.camel@localhost.localdomain> References: <1188393962.5980.13.camel@localhost.localdomain> Message-ID: <20070829135047.GH506@karelia> Hi Guy, Kroizman Guy writes: > C:/hdx/HyperRoll-Application.hxx:1122: Warning: Found ';' while parsing > initializer list! (doxygen could be confused by a macro call without > semicolon) Hm, never seen anything like this. Are you using the latest Doxygen release? If so, can you show the code around 1122? > C:/hdx/hdx.h:76: Warning: Member ColumnTypes (enumeration) of class > hdxns::Hdx is not documented. > > C:/hdx/HyperRoll-Application.hxx:79: Warning: Member simple_type > (typedef) of namespace xml_schema is not documented. These are harmless. Boris From kroiz at hyperroll.com Wed Aug 29 10:01:11 2007 From: kroiz at hyperroll.com (Kroizman Guy) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] multithreading crash xerces Message-ID: <1188396071.5980.22.camel@localhost.localdomain> When creating two instances of the XSD class from two different thread simultaneously I get a crash in xerces. Is there some initialization I can do before to avoid that crash? From boris at codesynthesis.com Wed Aug 29 10:15:52 2007 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] multithreading crash xerces In-Reply-To: <1188396071.5980.22.camel@localhost.localdomain> References: <1188396071.5980.22.camel@localhost.localdomain> Message-ID: <20070829141552.GJ506@karelia> Hi Kroizman, Kroizman Guy writes: > When creating two instances of the XSD class from two different thread > simultaneously I get a crash in xerces. > Is there some initialization I can do before to avoid that crash? Yes, please see http://wiki.codesynthesis.com/Tree/FAQ, question #1. -boris From sbalasub at qualcomm.com Wed Aug 29 22:33:59 2007 From: sbalasub at qualcomm.com (Balasubramanyam, Shivakumar) Date: Sun Oct 11 15:33:58 2009 Subject: [xsd-users] XSDe question Message-ID: Hi, I was evaluating the XSDe version and I when I tried to do make in examples...library, then I get the following error. {1112}> pwd /usr/local/projects/mflo/distribution/csw/shiva/xsde-1.0.0-i686-linux-gn u/examples/cxx/parser/library {1113}> make g++ -I../../../../libxsde -W -Wall -O3 -c driver.cxx -o driver.o In file included from driver.cxx:7: ../../../../libxsde/xsde/cxx/parser/document.hxx:9:25: xsde/config.h: No such file or directory In file included from library-skel.hxx:52, from library-impl.hxx:11, from driver.cxx:11: ../../../../libxsde/xsde/cxx/parser/validating/xml-schema-skel.hxx:21: error: conflicting declaration 'typedef struct xsde::cxx::parser::validating::simple_content xml_schema::simple_content' ../../../../libxsde/xsde/cxx/parser/non-validating/xml-schema-skel.hxx:2 1: error: 'xml_schema::simple_content' has a previous declaration as `typedef struct xsde::cxx::parser::non_validating::simple_content xml_schema::simple_content' ../../../../libxsde/xsde/cxx/parser/validating/xml-schema-skel.hxx:21: error: declaration of `typedef struct xsde::cxx::parser::validating::simple_content xml_schema::simple_content' ../../../../libxsde/xsde/cxx/parser/non-validating/xml-schema-skel.hxx:2 1: error: conflicts with previous declaration `typedef struct xsde::cxx::parser::non_validating::simple_content xml_schema::simple_content' ../../../../libxsde/xsde/cxx/parser/validating/xml-schema-skel.hxx:21: error: declaration of `typedef struct xsde::cxx::parser::validating::simple_content xml_schema::simple_content' ../../../../libxsde/xsde/cxx/parser/non-validating/xml-schema-skel.hxx:2 1: error: conflicts with previous declaration `typedef str Any ideas? Thanks, Shiva From kroiz at hyperroll.com Thu Aug 30 00:08:15 2007 From: kroiz at hyperroll.com (Kroizman Guy) Date: Sun Oct 11 15:33:58 2009 Subject: [Fwd: Re: [xsd-users] Using Doxygen on the generated code] In-Reply-To: <20070829135047.GH506@karelia> References: <1188393962.5980.13.camel@localhost.localdomain> <20070829135047.GH506@karelia> Message-ID: <1188446895.5956.7.camel@localhost.localdomain> Great, Thanks to you focus now it works. Those warnings was because these function had dllexport option on them, left by mistake from the days it was compiled as a dll. Once I removed from the custom build: --export-symbol __declspec(dllexport) everything went smoothly. On Wed, 2007-08-29 at 15:50 +0200, Boris Kolpackov wrote: > Hi Guy, > > Kroizman Guy writes: > > > C:/hdx/HyperRoll-Application.hxx:1122: Warning: Found ';' while parsing > > initializer list! (doxygen could be confused by a macro call without > > semicolon) > > Hm, never seen anything like this. Are you using the latest Doxygen > release? If so, can you show the code around 1122? > > > > C:/hdx/hdx.h:76: Warning: Member ColumnTypes (enumeration) of class > > hdxns::Hdx is not documented. > > > > C:/hdx/HyperRoll-Application.hxx:79: Warning: Member simple_type > > (typedef) of namespace xml_schema is not documented. > > These are harmless. > > > Boris